Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 561749f

Browse files
MarkIannucciantonbabenko
authored and
Mao-hsiang Lien
committed
fix: Only create mount point for EFS when using EFS (terraform-aws-modules#261)
Co-authored-by: Anton Babenko <[email protected]>
1 parent 26d2cb1 commit 561749f

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

examples/github-complete/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ Go to https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/settin
3030
| Name | Version |
3131
|------|---------|
3232
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
33-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.45 |
33+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.45 |
3434
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 4.8 |
3535

3636
## Providers
3737

3838
| Name | Version |
3939
|------|---------|
40-
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.45 |
40+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.45 |
4141

4242
## Modules
4343

4444
| Name | Source | Version |
4545
|------|--------|---------|
4646
| <a name="module_atlantis"></a> [atlantis](#module\_atlantis) | ../../ | n/a |
47-
| <a name="module_atlantis_access_log_bucket"></a> [atlantis\_access\_log\_bucket](#module\_atlantis\_access\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2 |
47+
| <a name="module_atlantis_access_log_bucket"></a> [atlantis\_access\_log\_bucket](#module\_atlantis\_access\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 3.0 |
4848
| <a name="module_github_repository_webhook"></a> [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | n/a |
4949

5050
## Resources

examples/github-complete/main.tf

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ module "atlantis" {
3737
private_subnets = ["10.20.1.0/24", "10.20.2.0/24", "10.20.3.0/24"]
3838
public_subnets = ["10.20.101.0/24", "10.20.102.0/24", "10.20.103.0/24"]
3939

40+
# EFS
41+
enable_ephemeral_storage = true
42+
4043
# ECS
4144
ecs_service_platform_version = "LATEST"
4245
ecs_container_insights = true
@@ -110,7 +113,7 @@ module "github_repository_webhook" {
110113
################################################################################
111114
module "atlantis_access_log_bucket" {
112115
source = "terraform-aws-modules/s3-bucket/aws"
113-
version = "~> 2"
116+
version = "~> 3.0"
114117

115118
bucket = "atlantis-access-logs-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}"
116119

examples/github-complete/terraform.tfvars.sample

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ alb_ingress_cidr_blocks = ["x.x.x.x/32"]
33
github_owner = "myorg"
44
github_user = "atlantis"
55
github_token = "mygithubpersonalaccesstokenforatlantis"
6-
allowed_repo_names = ["repo1", "repo2"]

examples/github-complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = "~> 3.45"
7+
version = ">= 3.45"
88
}
99

1010
github = {

main.tf

+4-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,10 @@ resource "aws_efs_file_system" "this" {
472472

473473
resource "aws_efs_mount_target" "this" {
474474
# we coalescelist in order to specify the resource keys when we create the subnets using the VPC or they're specified for us. This works around the for_each value depends on attributes which can't be determined until apply error
475-
for_each = zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids)
475+
for_each = {
476+
for k, v in zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids) : k => v
477+
if var.enable_ephemeral_storage == false
478+
}
476479

477480
file_system_id = aws_efs_file_system.this[0].id
478481
subnet_id = each.value

0 commit comments

Comments
 (0)