Complete the code to create an AWS S3 bucket resource.
resource "aws_s3_bucket" "my_bucket" { bucket = [1] }
The bucket name must be a string enclosed in quotes. Here, "my-unique-bucket-name" is the correct bucket name.
Complete the code to define an HTTP GET method for an API Gateway resource.
resource "aws_api_gateway_method" "get_method" { rest_api_id = aws_api_gateway_rest_api.my_api.id resource_id = aws_api_gateway_resource.my_resource.id http_method = [1] authorization = "NONE" }
The http_method must be set to "GET" to define a GET method for the API Gateway resource.
Fix the error in the API Gateway integration resource by completing the integration HTTP method.
resource "aws_api_gateway_integration" "integration" { rest_api_id = aws_api_gateway_rest_api.my_api.id resource_id = aws_api_gateway_resource.my_resource.id http_method = aws_api_gateway_method.get_method.http_method integration_http_method = [1] type = "AWS_PROXY" uri = aws_lambda_function.my_lambda.invoke_arn }
The integration_http_method for AWS_PROXY type must be "POST" regardless of the method type.
Fill both blanks to define an API Gateway resource path and its parent resource ID.
resource "aws_api_gateway_resource" "my_resource" { rest_api_id = aws_api_gateway_rest_api.my_api.id parent_id = [1] path_part = [2] }
The parent_id must be the root resource ID of the API, and path_part is the relative path without a slash, so "items" is correct.
Fill all three blanks to define an API Gateway deployment with stage name and description.
resource "aws_api_gateway_deployment" "deployment" { rest_api_id = aws_api_gateway_rest_api.my_api.id stage_name = [1] description = [2] triggers = { redeploy = [3] } }
The stage_name is "prod" for production, description is a string describing the deployment, and triggers redeploy on timestamp changes.