Complete the code to specify the AWS region for deployment.
provider "aws" { region = "[1]" }
The correct AWS region code for US East (N. Virginia) is us-east-1. Other options are not valid AWS region codes.
Complete the code to select an Availability Zone in the us-east-1 region.
resource "aws_instance" "example" { availability_zone = "us-east-1[1]" ami = "ami-0c94855ba95c71c99" instance_type = "t2.micro" }
Availability Zones in AWS regions are labeled with letters like 'a', 'b', 'c'. Here, 'us-east-1b' is a valid AZ.
Fix the error in the code to correctly reference an Availability Zone in the eu-west-1 region.
resource "aws_subnet" "example" { vpc_id = "vpc-123456" cidr_block = "10.0.1.0/24" availability_zone = "eu-west-1[1]" }
The correct AZ suffix is a single letter like 'a'. 'eu-west-1a' is valid, while '1a' or 'west-1a' are incorrect.
Fill both blanks to create a subnet in the us-west-2 region and specify its Availability Zone.
resource "aws_subnet" "example" { vpc_id = "vpc-789012" cidr_block = "10.0.2.0/24" availability_zone = "[1][2]" }
The subnet's Availability Zone must be in the correct region and use a valid AZ suffix. 'us-west-2a' is valid.
Fill all three blanks to define an EC2 instance in the ap-southeast-1 region, in Availability Zone 'b', with instance type 't3.micro'.
resource "aws_instance" "example" { ami = "ami-0abcdef1234567890" instance_type = "[1]" availability_zone = "[2][3]" }
The instance type is 't3.micro'. The region is 'ap-southeast-1' and the AZ suffix is 'b', so the availability zone is 'ap-southeast-1b'.