You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform module to create AWS [Lambda](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resources with configurable event sources, IAM configuration (following the [principal of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)), VPC as well as SSM/KMS and log streaming support.
5
+
Terraform module to create AWS [Lambda](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resources with configurable event sources, IAM configuration (following the [principal of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)), VPC as well as SSM and log streaming support.
6
6
7
7
The following [event sources](https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html) are supported (see [examples](#examples)):
8
8
@@ -15,7 +15,7 @@ The following [event sources](https://docs.aws.amazon.com/lambda/latest/dg/invok
15
15
16
16
Furthermore this module supports:
17
17
18
-
-reading configuration and secrets from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) including decryption of [SecureString](https://docs.aws.amazon.com/kms/latest/developerguide/services-parameter-store.html) parameters
18
+
-adding IAM permissions for read access to parameters from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)
19
19
-[CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) Log group configuration including retention time and [subscription filters](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html) e.g. to stream logs via Lambda to Elasticsearch
| description | Description of what your Lambda Function does. |`string`|`""`| no |
140
-
| environment | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries |`map(map(string))`|`{}`| no |
142
+
| environment | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries |<pre>object({<br> variables = map(string)<br> })</pre>|`null`| no |
141
143
| event | Event source configuration which triggers the Lambda function. Supported events: cloudwatch-scheduled-event, dynamodb, s3, sns |`map(string)`|`{}`| no |
142
144
| filename | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. |`string`|`""`| no |
143
145
| function\_name | A unique name for your Lambda Function. |`any`| n/a | yes |
144
146
| handler | The function entrypoint in your code. |`any`| n/a | yes |
145
-
| kms\_key\_arn |The Amazon Resource Name (ARN) of the KMS key to decrypt AWS Systems Manager parameters. |`string`|`""`| no |
147
+
| kms\_key\_arn | Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and Terraform will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration. |`string`|`""`| no |
146
148
| layers | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. |`list(string)`|`[]`| no |
147
149
| log\_retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. Defaults to 14. |`number`|`14`| no |
148
150
| logfilter\_destination\_arn | The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN. |`string`|`""`| no |
@@ -154,10 +156,11 @@ MINOR, and PATCH versions on each release to indicate any incompatibilities.
154
156
| s3\_key | The S3 key of an object containing the function's deployment package. Conflicts with filename. |`string`|`""`| no |
155
157
| s3\_object\_version | The object version containing the function's deployment package. Conflicts with filename. |`string`|`""`| no |
156
158
| source\_code\_hash | Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3\_key. The usual way to set this is filebase64sha256('file.zip') where 'file.zip' is the local filename of the lambda function source archive. |`string`|`""`| no |
157
-
| ssm\_parameter\_names | List of AWS Systems Manager Parameter Store parameters this Lambda will have access to. In order to decrypt secure parameters, a kms\_key\_arn needs to be provided as well. |`list`|`[]`| no |
159
+
| ssm | List of AWS Systems Manager Parameter Store parameter names. The IAM role of this Lambda function will be enhanced with read permissions for those parameters. Parameters must start with a forward slash and can be encrypted with the default KMS key. | <pre>object({<br> parameter_names = list(string)<br> })</pre> |`null`| no |
160
+
| ssm\_parameter\_names | DEPRECATED: use `ssm` object instead. This variable will be removed in version 6 of this module. (List of AWS Systems Manager Parameter Store parameters this Lambda will have access to. In order to decrypt secure parameters, a kms\_key\_arn needs to be provided as well.) |`list`|`[]`| no |
158
161
| tags | A mapping of tags to assign to the Lambda function. |`map(string)`|`{}`| no |
159
162
| timeout | The amount of time your Lambda Function has to run in seconds. Defaults to 3. |`number`|`3`| no |
160
-
| vpc\_config | Provide this to allow your function to access your VPC (if both 'subnet\_ids' and 'security\_group\_ids' are empty then vpc\_config is considered to be empty or unset, see https://docs.aws.amazon.com/lambda/latest/dg/vpc.html for details). |`map(list(string))`|`{}`| no |
163
+
| vpc\_config | Provide this to allow your function to access your VPC (if both 'subnet\_ids' and 'security\_group\_ids' are empty then vpc\_config is considered to be empty or unset, see https://docs.aws.amazon.com/lambda/latest/dg/vpc.html for details). |<pre>object({<br> security_group_ids = list(string)<br> subnet_ids = list(string)<br> })</pre> |`null`| no |
161
164
162
165
## Outputs
163
166
@@ -167,3 +170,4 @@ MINOR, and PATCH versions on each release to indicate any incompatibilities.
167
170
| function\_name | The unique name of your Lambda Function. |
168
171
| invoke\_arn | The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws\_api\_gateway\_integration's uri |
169
172
| role\_name | The name of the IAM role attached to the Lambda Function. |
Terraform module to create AWS [Lambda](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resources with configurable event sources, IAM configuration (following the [principal of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)), VPC as well as SSM/KMS and log streaming support.
5
+
Terraform module to create AWS [Lambda](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resources with configurable event sources, IAM configuration (following the [principal of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)), VPC as well as SSM and log streaming support.
6
6
7
7
The following [event sources](https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html) are supported (see [examples](#examples)):
8
8
@@ -15,7 +15,7 @@ The following [event sources](https://docs.aws.amazon.com/lambda/latest/dg/invok
15
15
16
16
Furthermore this module supports:
17
17
18
-
-reading configuration and secrets from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) including decryption of [SecureString](https://docs.aws.amazon.com/kms/latest/developerguide/services-parameter-store.html) parameters
18
+
-adding IAM permissions for read access to parameters from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)
19
19
-[CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) Log group configuration including retention time and [subscription filters](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html) e.g. to stream logs via Lambda to Elasticsearch
| description | Description of what your Lambda Function does. |`string`|`""`| no |
18
-
| environment | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries |`map(map(string))`|`{}`| no |
18
+
| environment | Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries |<pre>object({<br> variables = map(string)<br> })</pre>|`null`| no |
19
19
| event | Event source configuration which triggers the Lambda function. Supported events: cloudwatch-scheduled-event, dynamodb, s3, sns |`map(string)`|`{}`| no |
20
20
| filename | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. |`string`|`""`| no |
21
21
| function\_name | A unique name for your Lambda Function. |`any`| n/a | yes |
22
22
| handler | The function entrypoint in your code. |`any`| n/a | yes |
23
-
| kms\_key\_arn |The Amazon Resource Name (ARN) of the KMS key to decrypt AWS Systems Manager parameters. |`string`|`""`| no |
23
+
| kms\_key\_arn | Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and Terraform will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration. |`string`|`""`| no |
24
24
| layers | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. |`list(string)`|`[]`| no |
25
25
| log\_retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. Defaults to 14. |`number`|`14`| no |
26
26
| logfilter\_destination\_arn | The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN. |`string`|`""`| no |
@@ -32,10 +32,11 @@
32
32
| s3\_key | The S3 key of an object containing the function's deployment package. Conflicts with filename. |`string`|`""`| no |
33
33
| s3\_object\_version | The object version containing the function's deployment package. Conflicts with filename. |`string`|`""`| no |
34
34
| source\_code\_hash | Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3\_key. The usual way to set this is filebase64sha256('file.zip') where 'file.zip' is the local filename of the lambda function source archive. |`string`|`""`| no |
35
-
| ssm\_parameter\_names | List of AWS Systems Manager Parameter Store parameters this Lambda will have access to. In order to decrypt secure parameters, a kms\_key\_arn needs to be provided as well. |`list`|`[]`| no |
35
+
| ssm | List of AWS Systems Manager Parameter Store parameter names. The IAM role of this Lambda function will be enhanced with read permissions for those parameters. Parameters must start with a forward slash and can be encrypted with the default KMS key. | <pre>object({<br> parameter_names = list(string)<br> })</pre> |`null`| no |
36
+
| ssm\_parameter\_names | DEPRECATED: use `ssm` object instead. This variable will be removed in version 6 of this module. (List of AWS Systems Manager Parameter Store parameters this Lambda will have access to. In order to decrypt secure parameters, a kms\_key\_arn needs to be provided as well.) |`list`|`[]`| no |
36
37
| tags | A mapping of tags to assign to the Lambda function. |`map(string)`|`{}`| no |
37
38
| timeout | The amount of time your Lambda Function has to run in seconds. Defaults to 3. |`number`|`3`| no |
38
-
| vpc\_config | Provide this to allow your function to access your VPC (if both 'subnet\_ids' and 'security\_group\_ids' are empty then vpc\_config is considered to be empty or unset, see https://docs.aws.amazon.com/lambda/latest/dg/vpc.html for details). |`map(list(string))`|`{}`| no |
39
+
| vpc\_config | Provide this to allow your function to access your VPC (if both 'subnet\_ids' and 'security\_group\_ids' are empty then vpc\_config is considered to be empty or unset, see https://docs.aws.amazon.com/lambda/latest/dg/vpc.html for details). |<pre>object({<br> security_group_ids = list(string)<br> subnet_ids = list(string)<br> })</pre> |`null`| no |
39
40
40
41
## Outputs
41
42
@@ -45,3 +46,4 @@
45
46
| function\_name | The unique name of your Lambda Function. |
46
47
| invoke\_arn | The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws\_api\_gateway\_integration's uri |
47
48
| role\_name | The name of the IAM role attached to the Lambda Function. |
0 commit comments