The correct attribute to enable encryption is encrypt = true. The region must match the bucket's region, which is us-west-2. Option B correctly sets these along with the DynamoDB table for state locking.
terraform init?Terraform requires the DynamoDB table to exist before initialization. If the table is missing, terraform init will fail with an error to prevent unsafe concurrent state modifications.
Using a single S3 bucket with cross-region replication ensures state files are available in multiple regions automatically, improving availability and disaster recovery. This is better than managing multiple buckets or local files.
Encrypting state files with AWS KMS keys ensures data is protected at rest. Restricting access with IAM policies limits who can read or modify the state, following security best practices.
bucket-a. After some deployments, you change the backend configuration to use bucket-b without migrating the state file. What will happen when you run terraform plan?Changing the backend bucket without migrating the state causes Terraform to see no existing state in the new bucket. It assumes no resources exist and plans to create all resources anew.