Option D correctly uses the resource block syntax with the nested versioning block and the enabled attribute set to true. Option D misses quotes and uses incorrect versioning syntax. Option D uses name instead of bucket attribute. Option D incorrectly assigns versioning as a boolean instead of a block.
resource "aws_instance" "example" { instance_type = "t2.micro" }
The ami attribute is required for aws_instance. Terraform validates resource blocks and will fail the plan phase if required attributes are missing. It does not provide defaults or partial creations.
Option B uses the correct attribute names cidr_block and enable_dns_support. Option B uses incorrect attribute names. Option B uses dns_support which is invalid. Option B enables DNS hostnames but not DNS support.
Option A correctly uses the ingress block with from_port, to_port, protocol, and cidr_blocks as a list. Option A incorrectly assigns ingress as a list directly. Option A uses port which is invalid. Option A uses cidr_block instead of cidr_blocks list.
resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" } resource "aws_subnet" "subnet1" { vpc_id = ??? cidr_block = "10.0.1.0/24" }
Option A uses the correct direct reference syntax. Option A treats the reference as a string literal. Option A uses deprecated interpolation syntax which is invalid without quotes. Option A uses invalid shell-style variable syntax.