Terraform Continued
- While configuring Provider, Authentication has to be configured
- For AWS Provider Authentication Refer Here
- Refer Here on steps to create access key and secret key
- For working with terrafom open terminal , cd into folder where we have terraform templates.
- init => Downloads the necessary providers into .terraform folder
- validate => verify the template for configuration being valid or not
- apply => creates/updates the infrastructure
- init => Downloads the necessary providers into .terraform folder
- Now lets verify the existence of s3 bucket
- Lets execute terraform apply again
- Refer Here for the changes done in the class
Activity 2: Create a Network (VPC) in AWS
- Manual
- To Create VPC =>
- Region
- cidr range
- name tag
- Refer Here for the resource documentation
- Configuring authentication, Install aws cli
choco install awscli -y
- Configure access key and secret key
aws configure
and enter access key, secret access key and region which will create a file called as credentials in<home-dir>/.aws/credentials
and Terraform while executing will pick up from there - Now try applying the tempalte after init, validate to create vpc
- Lets use terraform destroy to delete all the resources created by the template
- Refer Here for the template created in the class.