Flashcards
8 Terraform remote state
Cards in this deck (16)
- 1What is name of feature that prevents using terraform apply command in two terminals simulataneouslystate locking
- 2What is advantage of remote state backendTerraform load and upload statefile
and state locking is supported - 3What do we need for remote backend with s3?s3 bucket and dynamo db table
- 4Why Dynamo DB table is needed?In order to implement state locking
- 5What should we keep note of after creation of S3 and Dynamo DB table?Bucket name
Key
Region
Dynamo DB table name - 6Configure remote bakcend stateCreate separate terraform.tf file
terraform {
backend "s3" {
bucket ="kodekloud -terraform -state -bucket01"
key ="finance/ terraform.tfstate "
region region ="us -west-1"
dynamodb_table = "state -locking"
}
} - 7What does key represent?The folder in which state file is stored
- 8What we should do after copying ocnfiguration to remote backend?delete tf state file
rm-rf terraform.tfstate - 9What is terraform state general commandterraform state [options][args]
- 10What are subcommands?list
mv
pull
rm
show - 11List resources recoreded within TF state fileterraform state list
- 12List aws s3 bucket named finance-1111 in TF state fileterraform state list aws_s3_bucket.finance-1111
- 13Display detailed information about aws s3 bucket finance-1111 in state fileterraform state show aws_s3_bucket.finance-1111
- 14Rename state-locking dyname table to state-locking-db using terraform stateterraform state mv aws_dynamodb_table.state-locking aws_dynamodb_table.state-locking-db
then rename it config file (main.tf) - 15View the contents of remote state fileterraform state pull
- 16Remove resource fro terrasorm stateterraform state rm ADDRESS
(example aws_s3_bucket.finance-1111)
then remove from config file
Information
- Description
- Easy Kodekloud Terraform basics Flashcards on 8 Terraform remote state, created by Archimed Nemes on 18/12/2022.
- Created by
- Archimed Nemes
- Views
- 0
- Rating