From 6279f157a226f2ab3806b8f35de1a9ad392a1ce2 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Sat, 2 May 2026 16:39:06 +0900 Subject: [PATCH 1/4] terraform-lambda-ecr-integration: Update AWS Provider to v6 --- terraform-lambda-ecr-integration/versions.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-lambda-ecr-integration/versions.tf b/terraform-lambda-ecr-integration/versions.tf index aeb24d5749..ab6ff491b4 100644 --- a/terraform-lambda-ecr-integration/versions.tf +++ b/terraform-lambda-ecr-integration/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.24" + version = "~> 6.0" } external = { source = "hashicorp/external" @@ -15,4 +15,4 @@ terraform { version = ">= 3.2" } } -} \ No newline at end of file +} From c709592dc0cbd152c38487284434ee2885c113ee Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Sat, 2 May 2026 16:44:04 +0900 Subject: [PATCH 2/4] terraform-lambda-ecr-integration: Fix deprecated aws_region name attribute --- terraform-lambda-ecr-integration/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-lambda-ecr-integration/main.tf b/terraform-lambda-ecr-integration/main.tf index f8a6650e81..73cbeaba06 100644 --- a/terraform-lambda-ecr-integration/main.tf +++ b/terraform-lambda-ecr-integration/main.tf @@ -14,7 +14,7 @@ locals { organization = var.organization env = var.env } - region = data.aws_region.current.name + region = data.aws_region.current.id account_id = data.aws_caller_identity.current.account_id standard_resource_name = "${var.env}-${var.organization}-ecr-lambda" ecr_base_arn = "${local.account_id}.dkr.ecr.${local.region}.amazonaws.com" From 1416403764cb217c711611864aafe7bd3eafaab8 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Sat, 2 May 2026 16:59:20 +0900 Subject: [PATCH 3/4] terraform-lambda-ecr-integration: Fix docker build for containerd image store --- terraform-lambda-ecr-integration/bin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-lambda-ecr-integration/bin/build.sh b/terraform-lambda-ecr-integration/bin/build.sh index c2a26406b7..cc48563823 100755 --- a/terraform-lambda-ecr-integration/bin/build.sh +++ b/terraform-lambda-ecr-integration/bin/build.sh @@ -36,7 +36,7 @@ aws ecr get-login-password --region ${TARGET_AWS_REGION} | docker login --userna } # Build image -docker build --no-cache -t ${IMAGE_NAME} ${BUILD_FOLDER} --platform linux/amd64 +docker build --no-cache --provenance=false -t ${IMAGE_NAME} ${BUILD_FOLDER} --platform linux/amd64 # Docker Tag and Push docker tag ${IMAGE_NAME}:latest ${IMAGE_URI}:latest From 8ef42e295efa4aec8c1a820fd145ad51b8ce09c9 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Sat, 2 May 2026 17:02:09 +0900 Subject: [PATCH 4/4] terraform-lambda-ecr-integration: Fix service name --- terraform-lambda-ecr-integration/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/terraform-lambda-ecr-integration/README.md b/terraform-lambda-ecr-integration/README.md index e8d95f6a78..e5b75562cc 100644 --- a/terraform-lambda-ecr-integration/README.md +++ b/terraform-lambda-ecr-integration/README.md @@ -2,7 +2,7 @@ This pattern will provision Amazon Elastic Container Registry (ECR), push the code into the Container Registry along with AWS Lambda function to execute the container. -As part of the build process, a container will be built, pushed into ECR, and ultimately deployed as an AWS Lambda function. When an AWS Lambda is executed, the container's example bash script will run. Following the completion of the AWS lambda function execution, logs will be published to AWS Cloudwatch. The security component is likewise handled by KMS Keys and IAM Roles. +As part of the build process, a container will be built, pushed into ECR, and ultimately deployed as an AWS Lambda function. When an AWS Lambda is executed, the container's example bash script will run. Following the completion of the AWS lambda function execution, logs will be published to AWS CloudWatch. The security component is likewise handled by KMS Keys and IAM Roles. ## Getting started with Terraform Serverless Patterns @@ -14,27 +14,27 @@ You also need [docker](https://www.docker.com/) and md5 to be installed on your The deployment will require you to provide the AWS VPC id along with the Subnet id(s) where you want this pattern to be deployed. -Optionally, you can also specify env and organization (tagging purposes), timeout and memory_size (AWS Lmabda function compute purposes) and lastly logging_level to specify the logging level for your function. These values default to entires in the variable.tf file if not provided at deployment. +Optionally, you can also specify env and organization (tagging purposes), timeout and memory_size (AWS Lambda function compute purposes) and lastly logging_level to specify the logging level for your function. These values default to entires in the variable.tf file if not provided at deployment. ```shell # terraform init terraform init # terraform plan with sample values for vpc and subnet -terraform plan -var="aws_vpc_id=vpc-xxxx" -var='aws_subnets=["subnet-xxxx","subnet-xxxx","subnet-xxxx"]' +terraform plan -var="aws_vpc_id=vpc-xxxx" -var='aws_subnets=["subnet-xxxx","subnet-xxxx","subnet-xxxx"]' # terraform apply terraform apply -var="aws_vpc_id=vpc-xxxx" -var='aws_subnets=["subnet-xxxx","subnet-xxxx","subnet-xxxx"]' ``` -Once deployed you can execute the Lambda function from the AWS Lambda Console or via AWS CLI. The logs will be published to Amazon Cloudwatch. +Once deployed you can execute the Lambda function from the AWS Lambda Console or via AWS CLI. The logs will be published to Amazon CloudWatch. ```shell aws lambda invoke \ --function-name testing-serverlessland-ecr-lambda \ --cli-binary-format raw-in-base64-out \ --log-type Tail --query 'LogResult' --output text \ - response.json | base64 --decode + response.json | base64 --decode ```