AWS ebs volume created with multiple snapshots taken with a for loop
-
Create a new stack
pulumi stack init dev
-
Restore npm dependencies
npm install
-
Set the AWS region location to use
pulumi config set aws:region us-east-2
-
Run pulumi up to preview and deploy changes via selecting y
pulumi up Previewing update (dev) View Live: https://app.pulumi.com/shaht/aws-classic-ts-ebs-volume-snapshot/dev/updates/18 Type Name Status + pulumi:pulumi:Stack aws-classic-ts-ebs-volume-snapshot-dev created + ├─ aws:ebs:Volume demo-ebs-volume created + ├─ aws:ebs:Snapshot demo-snapshot-0 created + └─ aws:ebs:Snapshot demo-snapshot-1 created Outputs: availability_zone_used : "us-east-1a" ebs_snapshots_id : [ [0]: "snap-0318191a81be67a1d" [1]: "snap-07188e473127b39e8" ] number_of_snapshots_taken: 2 Resources: + 4 created Duration: 3m25s
-
View the outputs.
pulumi stack output
Results
Current stack outputs (3): OUTPUT VALUE availability_zone_used us-east-1a ebs_snapshots_id ["snap-0318191a81be67a1d","snap-07188e473127b39e8"] number_of_snapshots_taken 2
-
When you destroy this Pulumi program, that the snapshots WILL BE DESTROYED, UNLESS you enable protection. The code shows how to
protect
andunprotect
the resource -
Destroy the stack
pulumi stack destroy -y
-
Remove the stack. This will remove the Pulumi.dev.yaml file
pulumi stack rm