-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add support for AWS::EC2::NatGateway #76
Conversation
@@ -244,6 +181,18 @@ trait Subnet extends AvailabilityZone with Outputs { | |||
|
|||
f(sub) ++ sub.andOutput(name, name) | |||
} | |||
|
|||
def nat(routeTables: Seq[`AWS::EC2::RouteTable`])(implicit s: `AWS::EC2::Subnet`) = { |
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.
This needs to accept the VPC Gateway Attachment resource and set it as a DependsOn for the EIP. See http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-eip.html
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.
Good catch! I had done some standing up of NATs using this code that seemed to work just fine without the depends. Perhaps I just got lucky, either way better safe than sorry.
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.
thoughts on whether we should pass it explicitly or implicitly?
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.
Are there other places where subnets are implicit? If that's an established convention, I suppose it's fine. However, it seems better to me as an explicit parameter.
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.
The Builder for EC2 currently takes an implicit subnet and we are routinely using implicit VPCs. I'm fairly neutral on which way we go though.
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 think the Subnet one makes sense as an implicit since this function is used nested within a subnet. The VPC Gateway attachment isn't in that hierarchy though, so i'd make it explicit.
adding in depends upon VPCGatewayAttachment for NAT EIP adding in depends upon for NATGateway
Add support for AWS::EC2::NatGateway
fixes #72