From 620edce247c9a7b7f9bb60d1703393b6bd138295 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Mon, 25 May 2026 20:17:36 +0900 Subject: [PATCH 1/4] terraform-ecs-efs-integration: Update AWS Provider to v6 --- terraform-ecs-efs-integration/Readme.md | 4 ++-- terraform-ecs-efs-integration/versions.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform-ecs-efs-integration/Readme.md b/terraform-ecs-efs-integration/Readme.md index 144897b95d..08b34a7b36 100644 --- a/terraform-ecs-efs-integration/Readme.md +++ b/terraform-ecs-efs-integration/Readme.md @@ -45,7 +45,7 @@ aws ecs run-task \ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.24 | +| [aws](#requirement\_aws) | ~> 6.0 | | [external](#requirement\_external) | >= 2.3 | | [null](#requirement\_null) | >= 3.2 | @@ -53,7 +53,7 @@ aws ecs run-task \ | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.24 | +| [aws](#provider\_aws) | ~> 6.0 | | [external](#provider\_external) | >= 2.3 | | [null](#provider\_null) | >= 3.2 | diff --git a/terraform-ecs-efs-integration/versions.tf b/terraform-ecs-efs-integration/versions.tf index aeb24d5749..ab6ff491b4 100644 --- a/terraform-ecs-efs-integration/versions.tf +++ b/terraform-ecs-efs-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 364466290ec6afe1b5c0b28a47d2670435266b1e Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Mon, 25 May 2026 20:22:44 +0900 Subject: [PATCH 2/4] terraform-ecs-efs-integration: Fix deprecated aws_region name attribute --- terraform-ecs-efs-integration/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-ecs-efs-integration/main.tf b/terraform-ecs-efs-integration/main.tf index c34f9c5b9f..847beaa478 100644 --- a/terraform-ecs-efs-integration/main.tf +++ b/terraform-ecs-efs-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.region account_id = data.aws_caller_identity.current.account_id standard_resource_name = "${var.env}-${var.organization}" ecr_base_arn = "${local.account_id}.dkr.ecr.${local.region}.amazonaws.com" From 6cda5e23667128673f701504faf7ed41cc8ec59f Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Mon, 25 May 2026 20:43:40 +0900 Subject: [PATCH 3/4] terraform-ecs-efs-integration: Fix ECR repository ARN in ECS task role policy --- terraform-ecs-efs-integration/templates/ecs-role.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-ecs-efs-integration/templates/ecs-role.json b/terraform-ecs-efs-integration/templates/ecs-role.json index fdf59686b9..6cf47da551 100644 --- a/terraform-ecs-efs-integration/templates/ecs-role.json +++ b/terraform-ecs-efs-integration/templates/ecs-role.json @@ -45,7 +45,7 @@ "ecr:BatchGetImage", "ecr:GetDownloadUrlForLayer" ], - "Resource": "arn:aws:ecr:*:*:repository/${standard_resource_name}" + "Resource": "arn:aws:ecr:*:*:repository/${standard_resource_name}-efs-updater" }, { "Sid": "ECSGrants", From 90cc18db10f88c8dab81f12c54f2bc0bb43f3ca0 Mon Sep 17 00:00:00 2001 From: kakakakakku Date: Mon, 25 May 2026 20:52:26 +0900 Subject: [PATCH 4/4] terraform-ecs-efs-integration: Fix README --- terraform-ecs-efs-integration/Readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraform-ecs-efs-integration/Readme.md b/terraform-ecs-efs-integration/Readme.md index 08b34a7b36..6e7d846556 100644 --- a/terraform-ecs-efs-integration/Readme.md +++ b/terraform-ecs-efs-integration/Readme.md @@ -1,6 +1,6 @@ -## Amazon EFS and Amazon ECS Integration +# Amazon EFS and Amazon ECS Integration -This pattern creates an Amazon EFS file system and integrates with ECS for a persisent file storage in a containerized environment. +This pattern creates an Amazon EFS file system and integrates with ECS for a persistent file storage in a containerized environment. You will build a container as part of the build, publish it into ECR, and then publish it as an ECS Task in the end. A sample file will be created in the EFS (persistent file system) after the task has been completed. The security component is likewise handled by KMS Keys and IAM Roles. @@ -21,10 +21,10 @@ Optionally, you can also specify env and organization (tagging purposes) and tas 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"]' +terraform apply -var="aws_vpc_id=vpc-xxxx" -var='aws_subnets=["subnet-xxxx","subnet-xxxx","subnet-xxxx"]' ``` Once deployed you can run the ECS task from the ECS Console or via AWS CLI which will create a sample file on the persistent storage using Amazon EFS