Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions modules/api_gateway/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
locals {
account_id = data.aws_caller_identity.current.account_id
integration_lambda_list = [
for key, value in var.routes :
value["lambda_key"] if lookup(value, "lambda_key", "") != ""
]
integration_keys = {
for k in distinct(local.integration_lambda_list) :
k => ""
}
routes = {
for key, value in var.routes : trimprefix(key, "/") => {
method = lookup(value, "method", "ANY")
Expand Down Expand Up @@ -50,7 +41,6 @@ locals {
}

data "aws_region" "current" {}
data "aws_caller_identity" "current" {}

data "aws_iam_policy_document" "assume_role" {
statement {
Expand Down Expand Up @@ -108,7 +98,7 @@ resource "aws_iam_role_policy" "invocation_policy" {
], [
for key, value in var.lambdas : replace(value.function_arn, "/:\\d+$/", ":*")
])
): e]
) : e]
}
]
})
Expand Down
2 changes: 2 additions & 0 deletions modules/api_gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
terraform {
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
Expand Down