# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 resource "aws_api_gateway_method" "sessions_get" { rest_api_id = aws_api_gateway_rest_api.api.id resource_id = aws_api_gateway_resource.sessions.id authorization = "COGNITO_USER_POOLS" authorizer_id = aws_api_gateway_authorizer.api_authorizer.id http_method = "GET" } resource "aws_api_gateway_method_response" "sessions_get_200" { rest_api_id = aws_api_gateway_rest_api.api.id resource_id = aws_api_gateway_resource.sessions.id http_method = aws_api_gateway_method.sessions_get.http_method status_code = "200" response_parameters = { "method.response.header.Access-Control-Allow-Headers" = true "method.response.header.Access-Control-Allow-Methods" = true "method.response.header.Access-Control-Allow-Origin" = true } } resource "aws_api_gateway_integration" "sessions_get_integration" { rest_api_id = aws_api_gateway_rest_api.api.id resource_id = aws_api_gateway_resource.sessions.id http_method = aws_api_gateway_method.sessions_get.http_method integration_http_method = "POST" type = "AWS" uri = "arn:aws:apigateway:${var.region}:dynamodb:action/Query" credentials = aws_iam_role.api.arn request_templates = { "application/json" = <