famous-ambulance-44173
05/11/2025, 6:02 PMvgw = awscc.ec2.VpnGateway(
"vgw",
tags=VPC.build_tags(
config.common_tags,
config.virtual_private_gateway.tags,
Name=f"{config.name}-vgw",
),
amazon_side_asn=config.virtual_private_gateway.asn,
type="ipsec.1",
**config.virtual_private_gateway.extra_args,
opts=ResourceOptions(parent=self.vpc),
)
attachment = awscc.ec2.VpcGatewayAttachment(
"vgw",
opts=ResourceOptions(parent=vgw),
vpc_id=self.vpc.id,
vpn_gateway_id=vgw.id,
)
so far so good, resources are created successfully.
Then, I update ASN on VpnGateway, which should trigger replacement.
here is what diff shows:
└─ aws-native:ec2:Vpc vpc
+- ├─ aws-native:ec2:VpnGateway vgw replace [diff: ~amazonSideAsn]
~ │ ├─ aws-native:ec2:VpcGatewayAttachment vgw update [diff: ~vpnGatewayId]
which is correct. however, if fails
aws-native:ec2:VpnGateway (vgw):
error: operation DELETE failed with "GeneralServiceException": Vpn Gateway is not in the correct state (Service: Ec2, Status Code: 400, Request ID: 34ada6f3-5619-4a5e-8dda-6d82916501ff) (SDK Attempt Count: 1)
because it must delete VpcGatewayAttachment
first.
how do I signal to pulumi that before attempting to delete aws-native:ec2:VpnGateway
, it must delete its children, e.g. aws-native:ec2:VpcGatewayAttachment
?
I am pretty sure TF does it correctly.
I tried playing around with deleted_with
but I couldn't achieve the outcome I am looking for.billowy-army-68599
depends_ond
in the optsfamous-ambulance-44173
05/11/2025, 8:01 PMlittle-cartoon-10569
05/11/2025, 9:18 PMfamous-ambulance-44173
05/11/2025, 10:22 PMpulumi:pulumi:Stack pulumi-aws-vpc-stacks-dev running..
└─ aws-networking:index:VPC vpc
└─ aws-native:ec2:Vpc vpc
++ ├─ aws-native:ec2:VpnGateway vgw created replacement (51s) [diff: ~amazonSideAsn]
+ │ ├─ aws-native:ec2:VpcGatewayAttachment vgw creating (27s)
magnificent-eve-41729
05/13/2025, 11:22 AMfamous-ambulance-44173
05/13/2025, 1:13 PMopts=ResourceOptions(parent=vgw),this line makes parent-child relationship, no?
little-cartoon-10569
05/13/2025, 7:27 PM