Skip to content

Latest commit

 

History

History

task-000-initialization-setup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Initialization Setup

  • Create a user terraform by navigating Login to AWS -> IAM -> Users -> Add User

  • Create a group terraform-administrators

  • Review screen

  • Download the credentials.csv containing Access key ID and Secret access key

  • These values can be used in the following ways

    1. Export the values of Access key ID and Secret access key as showing below in your current shell.

      export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
      export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
      • Now you can run the terrform commands in the same shell session.
    2. Add these values to the file terraform.tfvars in project directory DEFINATELY ADD IT TO .gitignore file. NEVER NEVER NEVER commit terraform.tfvars this file to git repository (as it contains you access key id and secret access key)

      $ cat terraform.tfvars           
      AWS_ACCESS_KEY = "YOUR_ACCESS_KEY_ID"
      AWS_SECRET_KEY = "YOUR_SECRET_ACCESS_KEY"      
      • Now while running terraform commands you will have to pass this file as argument at the end like shown below
      $ terraform apply -var-file=../../terraform.tfvars

Configuring AWS CLI

$ aws configure                                
AWS Access Key ID [None]: **********************
AWS Secret Access Key [None]: ************************
Default region name [None]: us-east-1
Default output format [None]: