Skip to content

Commit 88201a8

Browse files
author
Pavel Bakhmetev
committed
added aws s3 bucket module
1 parent fe3c180 commit 88201a8

File tree

10 files changed

+358
-24
lines changed

10 files changed

+358
-24
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module "example" {
4444
| AWS Lambda | [tf-aws-lambda](https://github.com/Devoteam/terraform-modules/tree/main/tf-aws-lambda) | Terraform module for launching Lambda Functions |
4545
| AWS Lambda Layer | [tf-aws-lambda-layer](https://github.com/Devoteam/terraform-modules/tree/main/tf-aws-lambda-layer) | Terraform module for Lambda Functions Layer definition |
4646
| AWS DynamoDb | [tf-aws-dynamodb](https://github.com/Devoteam/terraform-modules/tree/main/tf-aws-dynamodb) | Terraform module for DynamoDb table definition |
47+
| AWS S3 Bucket | [tf-aws-s3-bucket](https://github.com/Devoteam/terraform-modules/tree/main/tf-aws-s3-bucket) | Terraform module for AWS S3 Bucket definition |
4748

4849
## Contributing
4950

tf-aws-dynamodb/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module "name" {
3232
project = var.project
3333
component = var.component
3434
label_case = var.label_case
35+
tags = var.tags
3536
}
3637

3738
resource "aws_dynamodb_table" "default" {

tf-aws-dynamodb/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ variable "label_case" {
3939
}
4040
}
4141

42+
variable "tags" {
43+
type = map(string)
44+
default = {}
45+
description = "Additional custom tags (e.g. `{'Billing': 'Department_1'}`)."
46+
}
47+
4248
variable "table_name" {
4349
type = string
4450
default = null

tf-aws-lambda-layer/variables.tf

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,51 +41,51 @@ variable "label_case" {
4141

4242
variable "filename" {
4343
type = string
44-
description = "The path to the layer's deployment package within the local filesystem. Exactly one of filename or s3_bucket must be specified."
4544
default = null
45+
description = "The path to the layer's deployment package within the local filesystem. Exactly one of filename or s3_bucket must be specified."
4646
}
4747

4848
variable "s3_bucket" {
4949
type = string
50+
default = null
5051
description = <<EOF
5152
The S3 bucket location containing the function's deployment package. Exactly one of filename or s3_bucket must be specified.
5253
This bucket must reside in the same AWS region where you are creating the Lambda function.
5354
EOF
54-
default = null
5555
}
5656

5757
variable "s3_key" {
5858
type = string
59-
description = "The S3 key of an object containing the function's deployment package. Only if s3_bucket is specified."
6059
default = null
60+
description = "The S3 key of an object containing the function's deployment package. Only if s3_bucket is specified."
6161
}
6262

6363
variable "s3_object_version" {
6464
type = string
65-
description = "The object version containing the function's deployment package. Only if s3_bucket is specified."
6665
default = null
66+
description = "The object version containing the function's deployment package. Only if s3_bucket is specified."
6767
}
6868

6969
variable "layer_name" {
7070
type = string
71-
description = "Layer name"
7271
default = null
72+
description = "Layer name"
7373
}
7474

7575
variable "description" {
7676
type = string
77-
description = "Description of the Lambda layer."
7877
default = null
78+
description = "Description of the Lambda layer."
7979
}
8080

8181
variable "compatible_architectures" {
8282
type = list(string)
83-
description = "List of Architectures this layer is compatible with. Currently x86_64 and arm64 can be specified."
8483
default = null
84+
description = "List of Architectures this layer is compatible with. Currently x86_64 and arm64 can be specified."
8585
}
8686

8787
variable "compatible_runtimes" {
8888
type = list(string)
89-
description = "List of Runtimes this layer is compatible with. Up to 15 runtimes can be specified."
9089
default = null
90+
description = "List of Runtimes this layer is compatible with. Up to 15 runtimes can be specified."
9191
}

tf-aws-lambda/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module "name" {
1616
project = var.project
1717
component = var.component
1818
label_case = var.label_case
19+
tags = var.tags
1920
}
2021

2122
resource "aws_cloudwatch_log_group" "this" {

tf-aws-lambda/variables.tf

+22-16
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,37 @@ variable "label_case" {
3939
}
4040
}
4141

42+
variable "tags" {
43+
type = map(string)
44+
default = {}
45+
description = "Additional custom tags (e.g. `{'Billing': 'Department_1'}`)."
46+
}
47+
4248
variable "filename" {
4349
type = string
44-
description = "The path to the function's deployment package within the local filesystem. Exactly one of filename or s3_bucket must be specified."
4550
default = null
51+
description = "The path to the function's deployment package within the local filesystem. Exactly one of filename or s3_bucket must be specified."
4652
}
4753

4854
variable "s3_bucket" {
4955
type = string
56+
default = null
5057
description = <<EOF
5158
The S3 bucket location containing the function's deployment package. Exactly one of filename or s3_bucket must be specified.
5259
This bucket must reside in the same AWS region where you are creating the Lambda function.
5360
EOF
54-
default = null
5561
}
5662

5763
variable "s3_key" {
5864
type = string
59-
description = "The S3 key of an object containing the function's deployment package. Only if s3_bucket is specified."
6065
default = null
66+
description = "The S3 key of an object containing the function's deployment package. Only if s3_bucket is specified."
6167
}
6268

6369
variable "s3_object_version" {
6470
type = string
65-
description = "The object version containing the function's deployment package. Only if s3_bucket is specified."
6671
default = null
72+
description = "The object version containing the function's deployment package. Only if s3_bucket is specified."
6773
}
6874

6975
variable "function_name" {
@@ -73,84 +79,84 @@ variable "function_name" {
7379

7480
variable "description" {
7581
type = string
76-
description = "Description of what the Lambda Function does."
7782
default = null
83+
description = "Description of what the Lambda Function does."
7884
}
7985

8086
variable "architectures" {
8187
type = list(string)
88+
default = null
8289
description = <<EOF
8390
Instruction set architecture for the Lambda function. Valid values are ["x86_64"] and ["arm64"].
8491
Default is ["x86_64"].
8592
EOF
86-
default = null
8793
}
8894

8995
variable "handler" {
9096
type = string
91-
description = "The function entrypoint in your code."
9297
default = null
98+
description = "The function entrypoint in your code."
9399
}
94100

95101
variable "memory_size" {
96102
type = number
97-
description = "Amount of memory in MB the Lambda Function can use at runtime."
98103
default = 128
104+
description = "Amount of memory in MB the Lambda Function can use at runtime."
99105
}
100106

101107
variable "ephemeral_storage_size" {
102108
type = number
109+
default = null
103110
description = <<EOF
104111
The size of the Lambda function Ephemeral storage (/tmp) represented in MB.
105112
The minimum supported ephemeral_storage value defaults to 512MB and the maximum supported value is 10240MB.
106113
EOF
107-
default = null
108114
}
109115

110116
variable "reserved_concurrent_executions" {
111117
type = number
112-
description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations."
113118
default = -1
119+
description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations."
114120
}
115121

116122
variable "runtime" {
117123
type = string
118-
description = "The runtime environment for the Lambda function you are uploading."
119124
default = null
125+
description = "The runtime environment for the Lambda function you are uploading."
120126
}
121127

122128
variable "timeout" {
123129
type = number
124-
description = "The amount of time the Lambda Function has to run in seconds."
125130
default = 3
131+
description = "The amount of time the Lambda Function has to run in seconds."
126132
}
127133

128134
variable "layers" {
129135
type = list(string)
130-
description = "List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda Function."
131136
default = []
137+
description = "List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda Function."
132138
}
133139

134140
variable "cloudwatch_logs_retention_in_days" {
135141
type = number
142+
default = null
136143
description = <<EOF
137144
Specifies the number of days you want to retain log events in the specified log group. Possible values are:
138145
1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0. If you select 0, the events in the
139146
log group are always retained and never expire.
140147
EOF
141-
default = null
142148
}
143149

144150
variable "lambda_environment" {
145151
type = object({
146152
variables = map(string)
147153
})
148-
description = "Map of environment variables that are accessible from the function code during execution. If provided at least one key must be present."
149154
default = null
155+
description = "Map of environment variables that are accessible from the function code during execution. If provided at least one key must be present."
150156
}
151157

152158
variable "custom_iam_policy_arns" {
153159
type = set(string)
154-
description = "ARNs of custom policies to be attached to the lambda role"
155160
default = []
161+
description = "ARNs of custom policies to be attached to the lambda role"
156162
}

tf-aws-s3-bucket/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Terraform module tf-aws-s3-bucket
2+
3+
## Terraform module for creating AWS S3 Bucket resources.
4+
5+
## Usage
6+
7+
```
8+
module "s3_bucket" {
9+
source = "git::https://github.com/devoteam/terraform-modules.git//tf-aws-s3-bucket"
10+
11+
namespace = "devoteam"
12+
environment = "prod"
13+
project = "genai"
14+
component = "storage"
15+
16+
versioning_enabled = true
17+
}
18+
```

0 commit comments

Comments
 (0)