env variable for access key and secret key in terraform 1

env variable for access key and secret key in terraform

#Terraform env variable for provider AWS

$ export AWS_ACCESS_KEY_ID="anaccesskey"
$ export AWS_SECRET_ACCESS_KEY="asecretkey"
$ export AWS_DEFAULT_REGION="us-west-2"
$ terraform plan

Here is what the above code is Doing:
1. We’re using the AWS provider.
2. We’re creating a security group called “terraform-example” that allows SSH and HTTP traffic.
3. We’re creating an EC2 instance called “terraform-example” using the latest Amazon Linux AMI.
4. We’re opening up port 80 on the instance using the security group we created.
5. We’re setting the name tag on the instance to “terraform-example”.

Similar Posts