Complete the code to define a resource block for an imported AWS S3 bucket.
resource "aws_s3_bucket" "[1]" { bucket = "my-imported-bucket" }
The resource block name must match the local name you want to use for the imported bucket. Here, imported_bucket is a clear and valid name.
Complete the code to import an existing AWS EC2 instance by specifying its ID.
resource "aws_instance" "example" { instance_id = "[1]" }
The instance_id must be the actual EC2 instance ID, which starts with i- followed by hexadecimal characters.
Fix the error in the Terraform resource block by completing the missing attribute for an imported AWS VPC.
resource "aws_vpc" "main" { cidr_block = "[1]" }
The cidr_block attribute requires a valid IP range in CIDR notation, such as 10.0.0.0/16. The VPC ID or name is not valid here.
Fill both blanks to correctly define an imported AWS security group with a description and a VPC ID.
resource "aws_security_group" "[1]" { name = "imported_sg" description = "[2]" vpc_id = "vpc-0abc1234def56789" }
The resource name should be a simple identifier like imported_sg. The description should clearly explain the purpose, such as Security group for imported resources.
Fill all three blanks to complete the Terraform configuration for an imported AWS RDS instance with allocated storage, engine type, and instance class.
resource "aws_db_instance" "[1]" { allocated_storage = [2] engine = "[3]" instance_class = "db.t3.medium" identifier = "my-imported-db" }
The resource name is a local label like imported_db. Allocated storage is a number representing GB, here 20. The engine must be a valid database engine like mysql.