In the previous two post, we have discussed how to write a bash script with AWS CLI to create AWS Lightsail instance and, how to setup a service connection in Azure DevOps for AWS. IN this post, lets explore the steps required to get the bash script executed in a release pipeline to create AWS Lightsail infrastructure.
As the first step we need to create a build pipeline to publish the script as an artifact. Instead of creating a build you can directly use the Azure Git repo in the release as an artifact as well. However, let’s create a build and release pipeline both to implement a clear solution.
In the build pipeline we can add a copy file step to copy the bash script to build artifact staging directory. Then using a publish step we can publish the content of the build artifact staging directory as build output.
The build produces an output drop with the file. Using the build as a trigger we can setup a release pipeline. In the release pipeline you can add AWS Shell script step. In the step select the AWS service connection, we have created in the previous post. Then select the script that is in the build artifact as the script to execute. You need to supply the four arguments, name of the AWS Lightsail instance, the region (availability zone), the type of machine (blueprint) and the size (bundle) as parameters.
You can setup them as variables in the release pipeline. You can define same step in multiple stages in release pipeline to enable creation of multiple environments in the release workflow.
Once the pipeline is executed, AWS Lightsail instance would be created if it is not already exist.
Monday, 25 May 2020
Deploying Infrastructure to AWS Lightsail Using Azure DevOps – Part 3 – Creating a Release Pipeline to Deploy AWS Lightsail Infrastructure
Subscribe to:
Post Comments (Atom)
Popular Posts
-
az aks get-credentials is used to get the kubeconfig updated so that we can access AKS clusters from a terminal (You need to first use az ...
-
GitHub Actions are the CI/CD workflow implementation tool built into GitHub repos. While using the GitHub Actions workflows you may want to ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
-
Pull Request are the controlled way to bring in the changes to your stable branches in your Azure Git repos, or for that matter all Git prov...
-
Using Azure Redis cache with C# throws an error message such as below while accessing the Redis cache via a private endpoint. StackExchange...
No comments:
Post a Comment