Skip to content
This repository has been archived by the owner on Aug 19, 2021. It is now read-only.

Preparing to work with Amazon AWS

Markus Winkler edited this page Feb 20, 2020 · 11 revisions

Setup awscli

We should start by installing the AWS CLI on a host running Ansible:

$ sudo apt install -y awscli

Confirm installation:

$ aws --version
aws-cli/1.14.44 Python/3.6.9 Linux/4.15.0-74-generic botocore/1.8.48

Use the configure option to continue with the AWS CLI configuration:

$ aws configure
AWS Access Key ID [None]: <access key>
AWS Secret Access Key [None]: <secret key>
Default region name [None]: <default region>
Default output format [None]: json

Example for the default region would be eu-central-1 or eu-west-1.

The Amazon AWS ec2 modules require the boto libraries to be installed. Do

$ pip3 install boto boto3 --user

Create an AWS Key Pair

When using windows instances within AWS EC2 we need to have an keypair to do an initial password change for the administrator. To create it do the following:

$ aws ec2 create-key-pair --key-name moadsd-ng | \
    jq -r '.KeyMaterial' > ~/.ssh/moadsd-ng
$ chmod 600 ~/.ssh/moadsd-ng

We now have a private key which allows us to authenticate to the instances.

Next Step

Clone this wiki locally