When there is a change in edge_location to a different region in aws_networkmanager_core_network_policy_attachment with an existing aws_networkmanager_vpc_attachment resource attached to the aws_networkmanager_core_network we get an error:
Within the Errors list, Error code: ORPHANED_ATTACHMENT
Within the Errors list, Message: $.core-network-configuration.edge-locations: us-west-2 cannot be removed from policy because it would orphan attachment-id
Message: Incorrect policy
Proposed fix
Add a retry when the line of error is detected (set it for 4 minutes for retry because VPC attachments could take a while to delete). This retry is added to aws_networkmanager_core_network_policy_attachment.
Trade off
There could be false positives where the policy is truly invalid and it is not an actual error with the vpc attachments. This means that users would have to wait the entire retry duration before getting the accurate error message.
Other useful information
For aws_networkmanager_vpc_attachment resources to be attached to aws_networkmanager_core_network there needs to be a policy_document with an edge_location in the region that the aws_networkmanager_vpc_attachment is created in.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
Main issue
When there is a change in
edge_location
to a different region inaws_networkmanager_core_network_policy_attachment
with an existingaws_networkmanager_vpc_attachment
resource attached to theaws_networkmanager_core_network
we get an error:Errors
list, Error code:ORPHANED_ATTACHMENT
Errors
list, Message:$.core-network-configuration.edge-locations: us-west-2 cannot be removed from policy because it would orphan attachment-id
Incorrect policy
Proposed fix
Add a retry when the line of error is detected (set it for 4 minutes for retry because VPC attachments could take a while to delete). This retry is added to
aws_networkmanager_core_network_policy_attachment
.Trade off
There could be false positives where the policy is truly invalid and it is not an actual error with the vpc attachments. This means that users would have to wait the entire retry duration before getting the accurate error message.
Other useful information
For
aws_networkmanager_vpc_attachment
resources to be attached toaws_networkmanager_core_network
there needs to be apolicy_document
with anedge_location
in the region that theaws_networkmanager_vpc_attachment
is created in.Affected Resource(s) and/or Data Source(s)
aws_networkmanager_core_network_policy_attachment
Potential Terraform Configuration
No response
References
No response
Would you like to implement a fix?
None