Complete the code to specify the instance type for an EC2 instance.
resource "aws_instance" "example" { ami = "ami-12345678" instance_type = "[1]" }
The instance_type field defines the EC2 instance size and family, such as t2.micro.
Complete the code to select a compute-optimized instance family.
resource "aws_instance" "compute_optimized" { ami = "ami-87654321" instance_type = "[1]" }
The c5.large instance type belongs to the compute-optimized family, designed for CPU-intensive tasks.
Fix the error in the instance type to use a valid memory-optimized instance.
resource "aws_instance" "memory_optimized" { ami = "ami-11223344" instance_type = "[1]" }
The r5.large instance type is part of the memory-optimized family, suitable for memory-intensive applications.
Fill both blanks to define a burstable instance with the smallest size.
resource "aws_instance" "burstable" { ami = "ami-55667788" instance_type = "[1].[2]" }
The smallest burstable instance type is t3.micro, combining the family 't3' and size 'micro'.
Fill all three blanks to create a general purpose instance with medium size and the latest generation.
resource "aws_instance" "general_purpose" { ami = "ami-99887766" instance_type = "[1][2].[3]" }
The latest generation general purpose instance is m5.medium, combining family 'm', generation '5', and size 'medium'.