Open AlexGurtoff opened 8 months ago
@AlexGurtoff , after experiencing the same unexpected behavior and reaching out to the AWS support, it seems that the VPCGatewayAttachment resource cannot be imported at the moment, even though it's documented that it's supported. It's a reported bug.
As a workaround, it was suggested to create the VPCGatewayAttachment via Cloudformation directly.
As a workaround, it was suggested to create the VPCGatewayAttachment via Cloudformation directly.
@thodorisit Yeah, but in this case I need to detach the old VPCGateway, and this will require deleting all ENIs, and this in turn will cause our system to downtime... So, I hope that the CFN team will add support for importing this resource
Any update on this? I'm experiencing the same issue
Also hit this - and as part of stack refactoring. As with @AlexGurtoff this will likely cause production downtime
bump into this as well - down the road is there any cons of leaving this out of the import?
Workaround:
Network vpc-xxxx has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.
you are good to continue.Are there issues down the road? Most likely. One potential issue will appear when VPCAttachement supports drift detection. The physical ID of the VPCAttachment is IGW|vpc-dummy-vpc-id
. That's the only delta I was able to detect.
If it ever becomes an issue, the chances are high that it can also be imported. You can use a similar hack to make it disappear from the stack. Remove the VPCAttachement from the stack while it's being blocked due to active public IPs.
The lack of support for this resource is particularly troublesome as it can't be trivially recreated. Detaching an IGW from a VPC requires all public IP addresses to also be removed. Bringing the IGW attachment under the management of a CloudFormation template is thus often a lot of work, which may entail extended downtime. This feels like a resource for which support for importing should be prioritised given there isn't really any acceptable workaround.
Name of the resource
Other
Resource Name
AWS::EC2::VPCGatewayAttachment
Issue Description
Existing resource AWS::EC2::VPCGatewayAttachment can't be imported to stack. There is a weird error with such description:
READ operation is not supported
Expected Behavior
Reffering to: https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html
and
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html
Resource is supported by import. So, I should be able to import this resource into my cloudformation stack.
Observed Behavior
Existing resource AWS::EC2::VPCGatewayAttachment can't be imported to stack. There is a weird error with such description:
READ operation is not supported
Test Cases
I used such template file to import this resource:
And here is the import.json file that I provide with the template when creating a change set:
I removed redundant information from it
Other Details
No response