Creating Access Key, Role, and Key Pair
Creating an Access Key
First, we need to create an Access Key to access the AWS console via the Command Line Interface (CLI). This Access Key will enable us to manage and interact with AWS services easily from the command line.
- Go to the AWS Console and search for
IAM
. - Select the User you are currently using.
- Go to Security credentials, scroll down, and choose Create access key.
- Select Command Line Interface (CLI).
- Check the Confirmation box and click Next.
- Complete the creation of the access key and download the file containing the access key.
- Select Done to finish.
Creating a Role
Next, we will create a Role to grant permissions for the ECS service that we will use later.
- Select Roles and click Create role.
- Choose AWS service as the type.
- Select CodeDeploy as the service.
- Select CodeDeploy - ECS as the use case.
- You will see a pre-created policy.
- Click Next.
- Enter the name:
CodeDeployServiceRole
. - Enter the description:
Allows CodeDeploy to read S3 objects, invoke Lambda functions, publish to SNS topics, and update ECS services on your behalf.
- Review and click Create role.
Creating a Key Pair
Create a key pair to use with your EC2 instance.
- In the search bar, enter
Key pair
. - Select Key pairs.
- Select Key Pairs.
- Click Create key pair.
- Enter the name:
terraform-cicd
. - Select type RSA.
- Choose file type .pem.
- Click Create key pair.
- The Key pair creation is successful.