Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Add multip-port-sg module #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add multip-port-sg module #252

wants to merge 1 commit into from

Conversation

qrilka
Copy link
Contributor

@qrilka qrilka commented Sep 18, 2019


name: Multip-port security group module

Please include the following in your PR:

Please also note that these are not hard requirements, but merely serve to define
what maintainers are looking for in PR's. Including these will more likely lead
to your PR being reviewed and accepted.

  • Update the changelog
  • Make sure that modules and files are documented. This can be done inside the module and files.
  • Make sure that new modules directories contain a basic README.md file.
  • Make sure that the module is added to tests/main.tf
  • Make sure that the linting passes on CI.
  • Make sure that there is an up to date example for your code:
    - For new modules this would entail example code for how to use the module or some explanation in the module readme.
    - For new examples please provide a README explaining how to run the example. It's also ideal to provide a basic makefile to use the example as well.
  • Make sure that there is a manual CI trigger that can test the deployment.

@qrilka
Copy link
Contributor Author

qrilka commented Sep 18, 2019

The main motivation for this module is the fact that TF 0.12 doesn't allow for_each to be used with modules (though the argument is already reserved for future versions). Because of that single-port-sg can't be used with a list of ports to open and this module allows this to be done.

Copy link
Contributor

@ketzacoatl ketzacoatl left a comment

Choose a reason for hiding this comment

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

Minor updates:

  • add example to the doc
  • update tests/main.tf to include this module with empty params

@@ -0,0 +1,3 @@
## Multiple Port Security Group Rule

Create an `aws_security_group_rule` to allow ingress on some ports.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an example of how you intend the module to be used.

type = set(string)
default = []
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Separate the above into a variables.tf

protocol = "udp"
cidr_blocks = var.cidr_blocks
security_group_id = var.security_group_id
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great!

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.

2 participants