0
0
AWScloud~10 mins

Resources and methods in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an AWS S3 bucket resource.

AWS
resource "aws_s3_bucket" "my_bucket" {
  bucket = [1]
}
Drag options to blanks, or click blank then click option'
A"bucket_name"
Bmy_bucket
C"my-unique-bucket-name"
Dbucket
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the bucket name.
Using an invalid bucket name.
2fill in blank
medium

Complete the code to define an HTTP GET method for an API Gateway resource.

AWS
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"
}
Drag options to blanks, or click blank then click option'
A"GET"
B"PUT"
C"DELETE"
D"POST"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong HTTP method string.
Not using quotes around the HTTP method.
3fill in blank
hard

Fix the error in the API Gateway integration resource by completing the integration HTTP method.

AWS
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
}
Drag options to blanks, or click blank then click option'
A"DELETE"
B"POST"
C"PUT"
D"GET"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting integration_http_method to GET instead of POST.
Not using quotes around the method.
4fill in blank
hard

Fill both blanks to define an API Gateway resource path and its parent resource ID.

AWS
resource "aws_api_gateway_resource" "my_resource" {
  rest_api_id = aws_api_gateway_rest_api.my_api.id
  parent_id   = [1]
  path_part   = [2]
}
Drag options to blanks, or click blank then click option'
Aaws_api_gateway_rest_api.my_api.root_resource_id
Baws_api_gateway_rest_api.my_api.id
C"items"
D"/items"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the API ID as parent_id.
Including a slash in path_part.
5fill in blank
hard

Fill all three blanks to define an API Gateway deployment with stage name and description.

AWS
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]
  }
}
Drag options to blanks, or click blank then click option'
A"prod"
B"Production stage deployment"
Ctimestamp()
D"dev"
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid stage name.
Not using a string for description.
Not using timestamp() for redeploy trigger.