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
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
No comments:
Post a Comment