-
Notifications
You must be signed in to change notification settings - Fork 9
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
feature: Add security group as input #67
Conversation
Terraform Format and Style 🖌
|
5324407
to
366b8b5
Compare
af3b2ba
to
60ecab4
Compare
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.
Hi! In the current state of the PR if you specify both a security_group_id
and security_group_egress_rules
TF will fail on resource "aws_vpc_security_group_egress_rule" "default".
Also the variable security_group_name_prefix
should not be set when security_group_id
is set.
Could you add validation to security_group_id
and check if security_group_egress_rules
or security_group_name_prefix
are set?
a8bc5db
to
8ab1e0f
Compare
0e1656b
to
46710ed
Compare
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.
Small change requested
74a9e58
to
0784ae5
Compare
a3898c1
to
50719e0
Compare
This PR adds the capability to pass a security group instead always creating one with the Lambda itself.
Reasoning
Currently, for every Lambda it's own security group is created (when running in a VPC), with just a simple Egress. Downside it that this can cause limits being hit:
AWS is not happy with updating these limits BTW...
The change
By allowing to pass along the security group, it's possible to reuse SG's (e.g. between similar Lambda's) and prevent the limitation issue.
Update
Passing a single SG as a string causes new deployments (where the SG and the Lambda are deployed in the same TF run) to break ("unable to determine..." thing).
Changed into an array (which is the actual settings of a Lambda) so we can use
length
which works for Terraform.Kept the "old" output to return the generated ID, added a new for all the ID's.
With this it's fully backwards compatible and just adds a feature (to pass your own SG's)