Skip to content

feat: Use vpc cidr for efs sg unless overridden #315

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

Closed

Conversation

nitrocode
Copy link
Member

Description

  • Use vpc cidr for efs sg unless overridden

Motivation and Context

  • The module allows passing in a cidr to create a vpc and use that same cidr as ingress_cidr_blocks to the efs sg.
  • If a vpc_id is passed in, the hcl will still use the cidr input to set the efs sg
  • This change will continue to let cidr input as the efs sg ingress cidr blocks but if it is left empty (default), the efs sg ingress cidr blocks will default to the vpcs cidr, either the vpc passed in or the vpc created.

Breaking Changes

N/A

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

references

Copy link
Member

@dynamike dynamike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped a comment on just removing the cidr ingress rule.

@@ -383,7 +388,8 @@ module "efs_sg" {
vpc_id = local.vpc_id
description = "Security group allowing access to the EFS storage"

ingress_cidr_blocks = [var.cidr]
ingress_cidr_blocks = local.efs_sg_ingress_cidr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this whole security group makes me think that you don't need to allow ingress to the EFS volume from the entire VPC. Instead we can just rely on https://github.com/terraform-aws-modules/terraform-aws-atlantis/blob/master/main.tf#L387-L390, which already allows nfs-tcp from the Atlantis security group.

@dynamike
Copy link
Member

dynamike commented Nov 1, 2022

Closing in favor of #318

@dynamike dynamike closed this Nov 1, 2022
@nitrocode nitrocode deleted the use-vpc-cidr branch November 5, 2022 04:12
@github-actions
Copy link

github-actions bot commented Dec 6, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with EFS security group if using existing VPC
2 participants