
In the previous blog, we spinned up AWS resources using spacelift and terraform configurations. Now lets look at the feature of Spacelift which enables state locking on simultaneously triggered build.
Prerequisites:
- Spacelift
- AWS account
- Terraform
Let’s begin:
We have now added resource blocks for a network interface and an instance.
When we push the commit to the main branch, a build will trigger automatically.
Once the planning stage runs successfully, it will wait for confirmation for next stage to run. The state is Unconfrimed currently.
Now, let’s assume another commit was made which had a new resource block of S3 bucket.
Similar to the previous behaviour, a new build will trigger automatically.
This build will move to Queued state. It won’t run until the previous run is confirmed or discarded.
Let’s confirm the previous build state.
This has started to process and spin up the resources we have mentioned in the configuration block.
Once this build is completed, Spacelift will then execute the new build.
In case we don’t want to approve the execution mentioned in the planning stage, we can discard the build.
The new build has been discarded.
To view the resouces it was supposed to spin up, click on Changes.
Spacelift provides a better visualisation of every component, hence enhancing the capabilities of any IaaC tool.
Hey, readers! Thank you for sticking up till the end. This was a brief on spinning AWS resources using Spacelift and Terraform. If you have any questions/feedbacks regarding this blog, I am reachable at vidushi.bansal@nashtechglobal.com. You can find more of my blogs here.
Proudly powered by WordPress