Amazon Web Services (AWS) is a comprehensive and widely used cloud computing platform provided by Amazon. It offers a vast array of services, allowing individuals and businesses to build and deploy scalable applications and services without the need to invest in physical infrastructure
Prepair and run docker compose file
docker-compose run --rm aws --version
Create keypair to access AWS Instances: tf-cli-keypair.pem
docker-compose run --rm aws ec2 create-key-pair --key-name tf-cli-keypair --query 'KeyMaterial' --output text > tf-cli-keypair.pem
Create AWS Account for Terraform use AWS CLI: tf-cli
docker-compose run --rm aws iam create-user --user-name tf-cli
AWS Checking keypair:
Create Access Key & export to local
docker-compose run --rm aws iam create-access-key --user-name tf-cli > tf_cli-access_key.json
Create policy and configure to allow access EC2 and Limit Region
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:Region": "ap-southeast-1"
}
}
}
]
}
docker-compose run --rm aws iam create-policy --policy-name EC2FullAccessAPSouthEast1 --policy-document file://ec2-limited-access-policy.json
docker-compose run --rm aws iam attach-user-policy --user-name tf-cli --policy-arn arn:aws:iam::637423373411:policy/EC2FullAccessAPSouthEast1
AWS Checking User: