Skip to content

Commit 8fd2cf7

Browse files
authored
docs: fixed some documentation issues (#101)
1 parent 9be8d18 commit 8fd2cf7

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Terraform module to create AWS [Lambda](https://www.terraform.io/docs/providers/
66
development of Lambda functions like:
77

88
- inline declaration of triggers for DynamodDb, EventBridge (CloudWatch Events), Kinesis, SNS or SQS including all required permissions
9-
- IAM role with permissions following the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)
9+
- IAM role with permissions following the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)
1010
- CloudWatch Logs and Lambda Insights configuration
11-
- blue/green deployments with AWS CodePipeline and CodeDeploy
11+
- [blue/green deployments](https://github.com/moritzzimmer/terraform-aws-lambda/blob/main/modules/deployment/README.md) with AWS CodePipeline and CodeDeploy
1212

1313
## Features
1414

modules/deployment/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,25 @@ module "lambda" {
133133
}
134134
135135
resource "aws_s3_bucket" "source" {
136-
acl = "private"
137136
bucket = "source-bucket"
138137
force_destroy = true
139-
140-
versioning {
141-
enabled = true
142-
}
143138
}
144139
140+
// make sure to enable S3 bucket notifications to start CodePipeline
145141
resource "aws_s3_bucket_notification" "source" {
146142
bucket = aws_s3_bucket.source.id
147143
eventbridge = true
148144
}
149145
146+
// versioning is required for CodePipeline
147+
resource "aws_s3_bucket_versioning" "source" {
148+
bucket = aws_s3_bucket.source.id
149+
150+
versioning_configuration {
151+
status = "Enabled"
152+
}
153+
}
154+
150155
resource "aws_s3_bucket_public_access_block" "source" {
151156
bucket = aws_s3_bucket.source.id
152157
@@ -170,13 +175,10 @@ resource "aws_s3_object" "source" {
170175
}
171176
```
172177

173-
**Note**:
174178
The [Amazon S3 source action](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html)
175179
of the CodePipeline needs an AWS S3 Notification for emitting events in your Amazon S3 source bucket and sending
176-
filtered events to EventBridge and trigger the pipeline (see [docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) for details).
177-
178-
S3 event notifications will be created by this module if `codepipeline_artifact_store_bucket=true`.
179-
If the bucket is created externally the bucket notifications **must** be declared outside of this module.
180+
filtered events to EventBridge and trigger the pipeline (see [docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) for details). Make sure to enable S3 bucket
181+
notifications for your source bucket!
180182

181183
### with custom deployment configuration
182184

@@ -191,11 +193,12 @@ module "deployment" {
191193
source = "moritzzimmer/lambda/aws//modules/deployment"
192194
193195
alias_name = aws_lambda_alias.this.name
194-
deployment_config_name = aws_codedeploy_deployment_config.custom.id
195-
// optionally use custom deployment configuration or a different default deployment configuration like `CodeDeployDefault.LambdaLinear10PercentEvery1Minute` from https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations.html
196196
function_name = local.function_name
197197
s3_bucket = aws_s3_bucket.source.bucket
198198
s3_key = local.s3_key
199+
200+
// optionally use custom deployment configuration or a different default deployment configuration like `CodeDeployDefault.LambdaLinear10PercentEvery1Minute` from https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations.html
201+
deployment_config_name = aws_codedeploy_deployment_config.custom.id
199202
}
200203
201204
resource "aws_codedeploy_deployment_config" "custom" {

0 commit comments

Comments
 (0)