Saturday, 16 May 2020

Deploying Infrastructure to AWS LIghtsail Using Azure DevOps – Part 2 – Creating a Service Connection

In the previous post, we have discussed how to write a bash script with AWS CLI to create AWS Lightsail instance. In order to run this script to create AWS Lightsail instance via Azure DevOps we need to make a service connection to AWS from Azure DevOps. Let’s look at the steps to create such service connection.
As the first step you need to create an access key for your user account in AWS. You can go to your profile and click on My Security Credentials to access the Identity and Access Management. Expand Access keys and you can click on Create New Access Key button to create an access key.

The created access key will have two parts Access Key ID and the Secret Access Key. The Secret of the access key is visible only once and you have to save it to a secure location with the access key id.
Then you need to setup AWS Toolkit for Azure DevOps to your Azure DevOps organization. Once the toolkit is installed you can go to service connections of your team project and click on create new service connection.

In the new service connections select AWS and click next. You can provide the access key and the secret, then provide a name for the service connection.

Make sure to select Grant access permissions to all pipelines.

Then save the service connection. This service connection now can be used in build and deployment pipelines to create resources in AWS via Azure DevOps.

In the next post, let’s use this service connection in a release pipeline and create AWS Lightsail instance using the script we have discussed in previous post.

No comments:

Popular Posts