2. Setup

An AWS account is required for building and deploying on AWS. An account can be created here

Necessary tools

Setting up the AWS CLI

In order for the AWS CLI to access our account, it must be configured.

In the first step, it makes sense to create a new user for the AWS CLI in order to be able to restrict the rights. The use of the admin account is not recommended.

  1. The new user can be created in the Identity and Access Management (IAM) portal at AWS.

  2. Click on Create user. AWS IAM Users AWS IAM Users

  3. Enter a user name of your choice. AWS IAM Create User - Username AWS IAM Create User - Username

  4. Select Attach policies directly. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  5. Add AdministratorAccess to the policies. This gives you full access to all resources. This is best for development purposes. Users in pipelines should never have AdministratorAccess!. AWS IAM Create User - Permissions 2 AWS IAM Create User - Permissions 2

  6. Click on Next. AWS IAM Create User - Permissions 3 AWS IAM Create User - Permissions 3

  7. Review your user and click on Create User. AWS IAM Create User - Check and create AWS IAM Create User - Check and create

  8. The user is now created. Now we need to create access keys for the AWS CLI. To do this, click on the user name to edit the user. AWS IAM Users AWS IAM Users

  9. Select the Security credentials tab. AWS IAM Create access key - Permissions 1 AWS IAM Create access key - Permissions 1

  10. Scroll down to Access Keys. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  11. Click on Create Access Key. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  12. Select Command Line Interface (CLI). AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  13. Confirm the conditions below. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  14. The “description tags” can be left empty. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  15. Now we receive the required AWS Access Keys. AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  16. Open a terminal and enter the following command:

    aws configure

    Now enter the access key, then the secret access key, eu-central-1 and leave the last field empty.

    AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  17. The connection can be checked with the following command:

    aws sts get-caller-identity

    AWS IAM Create User - Permissions 1 AWS IAM Create User - Permissions 1

  18. This completes the setup of the AWS CLI. Next, you can continue with the deployment of the application on AWS here.