-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Support for aws_nat_gateway #4381
Conversation
Will (eventually) fix #4374. |
return err | ||
} | ||
if ngRaw == nil { | ||
d.SetId("") |
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.
Can we insert a debug log here, indicating that nat gateway d.Id()
wasn't found? Otherwise, in a plan
/refresh
situation where this line hits, we just remove it from the state file and don't tell anyone why
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.
👍
Acceptance test output:
|
LGTM! |
provider/aws: Support for aws_nat_gateway
@jen20 thanks for getting this done so quickly! It will really save my team tons of time and effort. I'm really impressed with the turn around time. |
👍 Insane turnaround |
👍 This was fast! So fast, that AWS CloudFormation does not support it yet. |
(thumbsup) Awesome |
GREAT WORK! |
👍 thanks guys this will be a huge help to us |
❤️ ❤️ ❤️ ❤️ ❤️ |
When were u planning on including this in a release? |
We need to create nat gateway soon. It will be good to know when this feature will be included in a release. |
Guys, it seems that this change breaks
Resource:
|
After investigating a bit further setting Suggestion: diff --git i/builtin/providers/aws/resource_aws_route_table.go w/builtin/providers/aws/resource_aws_route_table.go
index 752b771..dc31504 100644
--- i/builtin/providers/aws/resource_aws_route_table.go
+++ w/builtin/providers/aws/resource_aws_route_table.go
@@ -285,12 +285,15 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error
// Then loop through all the newly configured routes and create them
for _, route := range nrs.List() {
m := route.(map[string]interface{})
-
+ natGateway := aws.String(m["nat_gateway_id"].(string))
+ if len(*natGateway) == 0 {
+ natGateway = nil
+ }
opts := ec2.CreateRouteInput{
RouteTableId: aws.String(d.Id()),
DestinationCidrBlock: aws.String(m["cidr_block"].(string)),
GatewayId: aws.String(m["gateway_id"].(string)),
- NatGatewayId: aws.String(m["nat_gateway_id"].(string)),
+ NatGatewayId: natGateway,
InstanceId: aws.String(m["instance_id"].(string)),
VpcPeeringConnectionId: aws.String(m["vpc_peering_connection_id"].(string)),
NetworkInterfaceId: aws.String(m["network_interface_id"].(string)), |
@odise good catch - this definitely needs to be fixed prior to release. I'll open up a new issue for it. |
When is this up for release? 😸 |
"as soon as testing and the release process it complete" - See the mailing list for the original confirmation. |
thanks @ketzacoatl |
FWIW, I created an aws_nat_gateway as part of a deployment in us-west-2.
I was using the wrong syntax in my route table definition. |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Example usage: