The AMI ID will be different based on the region you are using. The AMI ID used in this example is for the ap-south-1
region.
ssh-keygen -t rsa -b 4096 -C "example@gmail.com" -f "$HOME\.ssh\testing_key_pair"
from_port
andto_port
in a Security Group specify the port range for which the rule is applied.
- Copy the private key to Bastion Host:
scp -i "$HOME\.ssh\testing_key_pair" "$HOME\.ssh\testing_key_pair.pem" ec2-user@bastion-host-ip:/home/ec2-user/
- SSH into the Bastion Host:
ssh -i "$HOME\.ssh\testing_key_pair" ec2-user@bastion-host-ip
- Change Ssh Key Permissions:
chmod 400 testing_key_pair
- SSH into the Private Host from the Bastion Host:
ssh -i testing_key_pair ec2-user@private-host-ip
-
In
main.tf
as the access_key and secret_key provider "aws" { access_key = XXX secret_Key = XXX } -
in terminal set the ENV variable EXPORT export AWS_SECRET_ACCESS_KEY=XXX export AWS_ACCESS_KEY_ID=XXX
only the current and the present terminal
-
seting it on the user level ~/.aws/credentials
-
AWS configure using aws cli (Best Way)
aws configure
-
Custom Terraform Enviornment Variable it should start with TF_VAR_
export TF_VAR_avail_zone=ap-south-1
in
main.tf
variable avail_zone{}var.avail_zone