Channels
welcome
pulumi-cdk
cloudengineering
yaml
blog-posts
localstack
pulumi-ai
package-authoring
general
pulumiup-booth-support
oracle-cloud-infrastructure
learn-pulumi-events
linen
registry
built-with-pulumi
pulumi-cloud
contribex
testingtesting321
hacktoberfest
pulumi-crosscode
content-share
finops
multi-language-hackathon
office-hours
workshops
gitlab
pulumi-kubernetes-operator
jobs
pulumi-deployments
dotnet
aws
golang
announcements
java
pulumiverse
python
install
getting-started
cloudengineering-support
testingtesting123
hackathon-03-19-2020
typescript
google-cloud
contribute
azure
kubernetes
docs
automation-api
status
Powered by
#aws
Title
n
narrow-river-17495
08/02/2023, 9:22 PM
Is there a good pattern for deleting all of the default VPCs in an AWS account using Pulumi?
g
gifted-gigabyte-53859
08/03/2023, 2:02 AM
An AWS account can only have 1 default VPC surely? You can reference the default VPC using the crosswalk API (probably other methods, this is the one I know about)
https://www.pulumi.com/docs/clouds/aws/guides/vpc/#getting-the-default-vpc
Ok, I remembered there is a VPC per region. So what you'd do is create a list of all regions you care about, perhaps using something like
https://www.pulumi.com/registry/packages/aws/api-docs/getregions/
and cycle through them, deleting the VPC each time.
2 Views
Post