DependencyViolation on changing aws_alb security group #13228
Labels
service/ec2
Issues and PRs that pertain to the ec2 service.
service/elbv2
Issues and PRs that pertain to the elbv2 service.
Milestone
This issue was originally opened by @fomichevmi as hashicorp/terraform#24863. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform v0.12.20
Terraform AWS Provider Version
v2.57.0
Terraform Configuration Files
TF 1:
TF 2
Debug Output
aws_security_group.test_aws_sg: Destroying... [id=sg-1]
aws_security_group.test_aws_sg_2: Creating...
aws_security_group.test_aws_sg_2: Creation complete after 4s [id=sg-2]
[TRACE] Executing graph transform terraform.TransitiveReductionTransformer
[TRACE] Completed graph transform terraform.TransitiveReductionTransformer with new graph:
aws_alb.test_aws_alb - terraform.NodeApplyableResourceInstance
aws_alb.test_aws_alb (prepare state) - terraform.NodeApplyableResource
aws_security_group.test_aws_sg (destroy) - terraform.NodeDestroyResourceInstance
aws_security_group.test_aws_sg_2 - terraform.NodeApplyableResourceInstance
aws_alb.test_aws_alb (prepare state) - terraform.NodeApplyableResource
provider.aws - terraform.NodeApplyableProvider
aws_security_group.test_aws_sg (clean up state) - terraform.NodeDestroyResource
aws_security_group.test_aws_sg (destroy) - terraform.NodeDestroyResourceInstance
aws_security_group.test_aws_sg (destroy) - terraform.NodeDestroyResourceInstance
provider.aws - terraform.NodeApplyableProvider
aws_security_group.test_aws_sg_2 - terraform.NodeApplyableResourceInstance
aws_security_group.test_aws_sg_2 (prepare state) - terraform.NodeApplyableResource
aws_security_group.test_aws_sg_2 (prepare state) - terraform.NodeApplyableResource
provider.aws - terraform.NodeApplyableProvider
meta.count-boundary (EachMode fixup) - terraform.NodeCountBoundary
aws_alb.test_aws_alb - terraform.NodeApplyableResourceInstance
aws_security_group.test_aws_sg (clean up state) - *terraform.NodeDestroyResource
provider.aws - terraform.NodeApplyableProvider
provider.aws (close) - terraform.graphNodeCloseProvider
aws_alb.test_aws_alb - terraform.NodeApplyableResourceInstance
root - terraform.graphNodeRoot
meta.count-boundary (EachMode fixup) - terraform.NodeCountBoundary
provider.aws (close) - terraform.graphNodeCloseProvider
aws_security_group.test_aws_sg: Still destroying... [id=sg-1, 19m20s elapsed]
[TRACE] dag/walk: vertex "aws_alb.test_aws_alb" is waiting for "aws_security_group.test_aws_sg (destroy)"
[TRACE] dag/walk: vertex "aws_alb.test_aws_alb" is waiting for "aws_security_group.test_aws_sg (destroy)"
[TRACE] dag/walk: vertex "provider.aws (close)" is waiting for "aws_alb.test_aws_alb"
[TRACE] dag/walk: vertex "aws_security_group.test_aws_sg (clean up state)" is waiting for "aws_security_group.test_aws_sg (destroy)"
[TRACE] dag/walk: vertex "root" is waiting for "meta.count-boundary (EachMode fixup)"
2020/05/05 13:32:51 [TRACE] vertex "aws_security_group.test_aws_sg (destroy)": visit complete
[TRACE] dag/walk: upstream of "aws_alb.test_aws_alb" errored, so skipping
[TRACE] dag/walk: upstream of "aws_security_group.test_aws_sg (clean up state)" errored, so skipping
Error: Error deleting security group: DependencyViolation: resource sg-1 has a dependent object
status code: 400, request id: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeffffffff
Expected Behavior
Actual Behavior
Steps to Reproduce
Description
When I try to change security group related to aws_alb old SG is tried to be deleted before unbind from aws_alb. So instead of refreshing aws_alb I'm receiving DependencyViolation exception
The text was updated successfully, but these errors were encountered: