-
-
Notifications
You must be signed in to change notification settings - Fork 355
fix: Only create mount point for EFS when using EFS #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Only create mount point for EFS when using EFS #261
Conversation
for_each = zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids) | ||
for_each = { | ||
for k, v in zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids) : k => v | ||
if var.enable_ephemeral_storage == false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if var.enable_ephemeral_storage == false | |
if var.enable_ephemeral_storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an example which github-ephemeral-storage
which uses ephemeral storage and works with the code as written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be if ! var.enable_ephemeral_storage
? We only want to make this map if we need to mount EFS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh thats my bad, didn't understand the variable fully. this is not great - we should have never accepted the enable_ephemeral_storage
and instead it should have been enable_efs_storage
which is false by default and users then opt in. reading through the module now, everything is backwards and confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggled with how to simultaneously support ephemeral storage, EFS, and whatever Amazon calls the capacity constrained storage that Fargate provides by default.
Ultimately, I decided to try to encourage EFS adoption because it fixes #206. In doing that, I unintentionally broke ephemeral storage users (who apparently aren't too worried about #206 ).
So... Where to go from here?
I agree with @llamahunter. Merge #261 so we can fix stuff for the people who rely on the ephemeral storage and #257 so we're safer by default.
That doesn't resolve the everything is "backwards and confusing problem" (which is a pretty good way to describe it :)
Long term, I'd like to see us fix #19. Doing so would allow us to remove a lot of complexity (and cost) from this module since we wouldn't need ALB or ephemeral storage support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand the whole picture, but I have executed examples/github-complete
with enable_ephemeral_storage
set as true
and false
. Both cases created some resources.
@bryantbiggs Should this be merged as it is, or do we still need something implemented in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If its deployable, lets ship it - we can continue making adjustments after
what's the status of this PR? Seems unmerged for nearly a month after approval. In the meantime, ephemeral storage doesn't work at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works!
@bryantbiggs WDYT?
@@ -37,6 +37,9 @@ module "atlantis" { | |||
private_subnets = ["10.20.1.0/24", "10.20.2.0/24", "10.20.3.0/24"] | |||
public_subnets = ["10.20.101.0/24", "10.20.102.0/24", "10.20.103.0/24"] | |||
|
|||
# EFS | |||
enable_ephemeral_storage = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is enough to have this argument in one example. I have removed the copied one.
for_each = zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids) | ||
for_each = { | ||
for k, v in zipmap(coalescelist(var.private_subnets, var.private_subnet_ids), local.private_subnet_ids) : k => v | ||
if var.enable_ephemeral_storage == false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand the whole picture, but I have executed examples/github-complete
with enable_ephemeral_storage
set as true
and false
. Both cases created some resources.
@bryantbiggs Should this be merged as it is, or do we still need something implemented in this PR?
### [3.13.1](v3.13.0...v3.13.1) (2022-04-01) ### Bug Fixes * Only create mount point for EFS when using EFS ([#261](#261)) ([b1b61f3](b1b61f3))
This PR is included in version 3.13.1 🎉 |
@antonbabenko I am still having efs related problems after the fixes that are done yesterday. Here is my config file include {
path = find_in_parent_folders()
}
locals {
common_vars = yamldecode(file(find_in_parent_folders("common_vars.yaml")))
hosted_zone = "example.com"
certificate_arn = "arn:aws:acm:eu-west-1:141757035671:certificate/52bbc00f-857c-45dd-b8ea-20bb8dfbcfec"
alb_ingress_cidr_blocks = "MY_EXTERNAL_IP_ADDRESS/32"
}
terraform {
source = "../../..//modules/terraform-aws-atlantis"
}
inputs = {
name = "atlantis"
vpc_id = dependency.vpc.outputs.vpc_id
private_subnet_ids = dependency.vpc.outputs.private_subnets
public_subnet_ids = dependency.vpc.outputs.public_subnets
# DNS
create_route53_record = false
route53_zone_name = local.hosted_zone
certificate_arn = local.certificate_arn
# Atlantis
atlantis_github_user = "atlantis-bot"
atlantis_github_user_token = "examplegithubtoken"
atlantis_repo_allowlist = ["github.com/MyGitHubOrg/*"]
# EFS
enable_ephemeral_storage = false
allow_unauthenticated_access = true
allow_github_webhooks = true
# alb
alb_ingress_cidr_blocks = local.alb_ingress_cidr_blocks
tags = local.common_vars.tags
}
dependency "vpc" {
config_path = "../vpc"
}
dependency "alb" {
config_path = "../alb/main"
} As you see, I have the latest updates. Any suggestions on what might I be missing? |
@dgokcin please file a new issue with a complete reproduction (i.e. - without your terragrunt and other specifics, start with the examples provided in the project and modify to reproduce your issue) |
…dules#261) Co-authored-by: Anton Babenko <[email protected]>
### [3.13.1](terraform-aws-modules/terraform-aws-atlantis@v3.13.0...v3.13.1) (2022-04-01) ### Bug Fixes * Only create mount point for EFS when using EFS ([terraform-aws-modules#261](terraform-aws-modules#261)) ([b1b61f3](terraform-aws-modules@b1b61f3))
…dules#261) Co-authored-by: Anton Babenko <[email protected]>
### [3.13.1](terraform-aws-modules/terraform-aws-atlantis@v3.13.0...v3.13.1) (2022-04-01) ### Bug Fixes * Only create mount point for EFS when using EFS ([terraform-aws-modules#261](terraform-aws-modules#261)) ([b1b61f3](terraform-aws-modules@b1b61f3))
…dules#261) Co-authored-by: Anton Babenko <[email protected]>
### [3.13.1](terraform-aws-modules/terraform-aws-atlantis@v3.13.0...v3.13.1) (2022-04-01) ### Bug Fixes * Only create mount point for EFS when using EFS ([terraform-aws-modules#261](terraform-aws-modules#261)) ([b1b61f3](terraform-aws-modules@b1b61f3))
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Fixes #254 by adding a conditional to the mount so we only create the mount when we are adding storage for EFS.
How Has This Been Tested?
examples/*
projectsNeeds an example which I haven't completed yet.