// Copyright 2022 Amazon.com and its affiliates; all rights reserved. // SPDX-License-Identifier: MIT No Attribution terraform { required_providers { aws = { source = "hashicorp/aws" configuration_aliases = [aws] } } } resource "aws_api_gateway_deployment" "deployment" { rest_api_id = var.API_ID triggers = { redeployment = var.DEPLOYMENT_TRIGGER } lifecycle { create_before_destroy = true } } data "aws_elb_service_account" "main" {} resource "aws_api_gateway_account" "demo" { cloudwatch_role_arn = var.CLOUDWATCH_IAM_ROLE } data "aws_caller_identity" "current" {} data "aws_region" "current" {} resource "aws_kms_key" "key" { description = "${var.APP}-${var.ENV}-${var.API_NAME}-log-key" enable_key_rotation = true tags = { Name = "${var.APP}-${var.ENV}-${var.API_NAME}-log-key" } policy = <