Install Terraform
- Add the HashiCorp GPG key
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
- Add the official HashiCorp Linux repository.
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
- Update and install
sudo apt-get update && sudo apt-get install terraform
- Known you version:
terraform -version
https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct&src=header_signup
- Connect to AWS console
- Follow the official guide : https://console.aws.amazon.com/iam/home?#/security_credentials
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console
- Connect to AWS console with root account
- Go to IAM service
- Create Group named
Developers
- Add existing Policy
PowerUserAccess
to the group - Create User named
dev
- Check Programmatic access
- Check AWS Management Console access (optional)
- Add it to the administrator group
- Copy Access keys (access key ID and secret access key)
- Put them in
~/.aws/credentials
file, like that:
[p-dev]
aws_access_key_id = dev_ACCESS_KEY
aws_secret_access_key = dev_ACCESS_KEY
region = eu-west-1
4. (Optional) Create Administrator user with programmatic access (optional, if you need to deal with IAM or other things)
- Connect to AWS console
- Go to IAM service
- Create Group named
Administrators
- Add existing Policy
AdministratorAccess
to the group - Create User named
admin
- Check Programmatic access
- Check AWS Management Console access (optional)
- Add it to the administrator group
- Copy Access keys (access key ID and secret access key)
- Put them in
~/.aws/credentials
file, like that:
[p-admin]
aws_access_key_id = admin_ACCESS_KEY
aws_secret_access_key = admin_ACCESS_KEY
region = eu-west-1
Deploy the infrastructure using terraform
terraform init; terraform plan; terraform apply --auto-approve