-
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: Add Support For AWS VPN Gateways using aws-sdk-go #1137
Conversation
Uses the aws-sdk-go module and is based on the way the existing aws_internet_gateway resource works.
One thing is I can't get the TestAccVpnGateway_tags acceptance test to pass and I'm not sure why it's not working. I get this error:
|
Hey @deverton thanks for the contribution! Regarding the acceptance test failure, I patched that issue in |
@catsby That patch has fixed the acceptance tests and everything now passes. Thanks! |
Thanks! Taking a look now. I did notice that it needs |
VPCID: aws.String(d.Get("vpc_id").(string)), | ||
}) | ||
if err != nil { | ||
ec2err, ok := err.(*aws.APIError) |
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.
If I'm not mistaken, the return here should be aws.APIError
. Does the *
work?
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.
Not sure as I'm only just starting to learn Go. I'll take a closer look.
Looks promising, thanks! Pending some nitpicks and questions though, can you take a look @deverton ? |
Current AWS documentation says there's only one type of VPN gateway for now.
AWS returns IncorrectState not DependencyViolation when a VPN gateway is still attached to a VPC.
Okay, I think all of the feedback has been applied. |
@deverton excellent, thanks! One final, super small nitpick that I missed: the Let me know if you can get to that, otherwise I can merge and convert it. Thanks again! |
@catsby no problem, I've made that change. |
@catsby I've updated the code to compile again after the goamz removal. |
func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { | ||
ec2conn := meta.(*AWSClient).ec2conn | ||
|
||
vpnGatewayRaw, _, err := vpnGatewayStateRefreshFunc(ec2conn, d.Id())() |
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.
Here you call a refresh func vpnGatewayStateRefreshFunc
, but we only call it once and never try again, like in a wait.WaitForState
in the resourceAwsVpnGatewayAttach
function.
I see that's basically copied from Internet Gateway, so not a fault of yours 😄 . In your experience does this typically take time, and may fail on the first run?
I had another question, but I don't think it's a blocker. |
provider/aws: Add Support For AWS VPN Gateways using aws-sdk-go
Going ahead an pulling this in, thanks @deverton ! |
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. |
Add's support for managing VPN gateways in AWS. The way it works (and most of the code) is based on the way that internet gateways are currently handled. It's written using the aws-sdk-go library though.