Courseiva

TF-004

Study mode — explanations shown

1

Use the core Terraform workflow

easy

Refer to the exhibit. A developer runs `terraform init` and then `terraform plan`. The plan output shows that Terraform will create the AWS instance. However, the state file is expected to be stored in S3 under the key "prod/terraform.tfstate". Which statement is true?

Exhibit

Refer to the exhibit.

```hcl
# main.tf
terraform {
  backend "s3" {
    bucket = "my-org-terraform-state"
    key    = "prod/terraform.tfstate"
    region = "us-east-1"
  }
}

provider "aws" {
  region = "us-west-2"
}

resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
}
```
0 of 25 answered