- Download and Install Terraform
- Upload your public ssh key via EC2 console for your account and region (eu-central-1 default) and use the corresponding
Key pair namevalue in the console forkey_namevalue invariable.tfwhen performingterraform plan -out "run.plan". - please export the following -
export AWS_ACCESS_KEY_ID="<<your access key>>" && export AWS_SECRET_ACCESS_KEY="<<your secret access key>>" && export AWS_DEFAULT_REGION="eu-central-1".
You can generate new ones from your EC2 console via the url for your
<<account_user>>-https://console.aws.amazon.com/iam/home?region=eu-central-1#/users/<<account_user>>?section=security_credentials
- Please add ingress allowance rule for port 22 over TCP in the default region VPC for
remote-exevia ssh agent run in the project to target server - from the ec2 console for the region - eu-central-1 git clone https://github.com/dwaiba/aws-terraform && cd aws-terraform && terraform init && terraform plan -out "run.plan" && terraform apply "run.plan".
Post provisioning Automatic
curl http://169.254.169.254/latest/user-data|sudo sh- via terraformremote-execexecutesprep-rhel75.txtshell-scriptfile contents of this repo available as user-data, post provisioning. Various type besidesshell-scriptincluding directcloud-initcommands may be passed as multipart as part of the user-data via terraformremote-exec.
- To destroy
terraform destroy