# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 resource "aws_api_gateway_account" "api_account" { cloudwatch_role_arn = aws_iam_role.api_cloudwatch.arn } resource "aws_api_gateway_rest_api" "api" { name = "${var.project}-${var.environment}-session-api" description = "Session API" depends_on = [aws_api_gateway_account.api_account] endpoint_configuration { types = ["REGIONAL"] } lifecycle { create_before_destroy = true } # Only allow some IPs to access the API policy = <