https://pulumi.com logo
#getting-started
Title
# getting-started
w

wonderful-lock-17109

09/01/2023, 12:19 PM
Hey everyone, I'm new to Pulumi and I was hoping someone could help me out with an issue I'm experiencing. I'm trying to resolve the problem mentioned in https://github.com/pulumi/pulumi/issues/2309. If anyone has any insights or suggestions, I'd really appreciate it. Here's some context: I'm using the Micro-stack pattern and I have two stacks, A and B. Stack B references a stack output from A. When I initially deploy the resources, everything works fine. However, when I update a stack output from A and try to deploy it, the deployment is put on hold for an extended period. This is likely because Pulumi is having trouble deleting the resource of stack A, which is already referenced by resources from Stack B. To solve the issue, I have to deploy Stack B, which identifies a change in state and updates the resources accordingly. After B is successfully deployed, the deployment of Stack A also completes successfully. If I don't deploy Stack B, the deployment of Stack A times out and I get an error message that says "deleting subnet :1 error occurred: * deleting EC2 Subnet: DependencyViolation: The subnet 'subnet-id' has dependencies and cannot be deleted. status code: 400, request id: request-id."
s

stocky-restaurant-98004

09/01/2023, 1:34 PM
This isn't really a Pulumi issue as far as I can tell. This is more about how VPCs work: You can't delete (or make a change that requires re-creating) a subnet when it has stuff in it. The "dependency" text here is originating from the AWS API, not Pulumi. I would recommend working within a single stack for now since you're new to Pulumi.
If your network architecture isn't stable, you're gonna have to tear down any resources in the VPC if the VPC structure changes. Unless you're doing something more advanced, you can't go wrong with public and private subnets split across 3 AZs. If you use the AWSX VPC, you get this by default: https://www.pulumi.com/registry/packages/awsx/api-docs/ec2/vpc/
w

wonderful-lock-17109

09/01/2023, 1:48 PM
Thanks. Ill look into it
s

salmon-account-74572

09/01/2023, 3:16 PM
Also see my reply to your post in #automation-api