Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Error in count condition of HTTP-Api-Gateway #60

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
tf-checks-complete-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9
with:
working_directory: './_examples/complete/'
working_directory: './examples/'
tf-checks-basic-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9
with:
working_directory: './_examples/vpc_link_api/'
working_directory: './examples/vpc_link_api/'
...
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ locals {
environment = "test"
region = "us-east-1"
domain_name = "clouddrove.ca"
hosted_zone_id = "Z015XXXXXXXXXXXXXXIEP"
hosted_zone_id = "Z0xxxxxxxxxxxxxxEP"
}
####----------------------------------------------------------------------------------
## ACM
Expand Down Expand Up @@ -75,7 +75,7 @@ module "lambda" {
## API GATEWAY
####----------------------------------------------------------------------------------
module "api_gateway" {
source = "../../../"
source = "../../."

name = local.name
environment = local.environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module "security_group" {
####----------------------------------------------------------------------------------

module "rest_api_private" {
source = "../../../"
source = "../../."

name = "${local.name}-rest-api-private"
environment = local.environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module "lambda" {
####----------------------------------------------------------------------------------

module "rest_api" {
source = "../../../"
source = "../../."

name = "${local.name}-rest-api"
environment = local.environment
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,14 @@ module "kms_key" {
source = "clouddrove/kms/aws"
version = "1.3.1"

enabled = var.enabled && var.create_rest_api && var.enable_access_logs && var.create_kms_key ? true : false
enabled = var.enabled && var.enable_access_logs && var.create_kms_key ? true : false
name = module.labels.id
enable_key_rotation = var.enable_key_rotation
multi_region = var.multi_region
policy = data.aws_iam_policy_document.cloudwatch[0].json
}


##----------------------------------------------------------------------------------
## Below resource will Manages an Kms key JSON POlicy.
##----------------------------------------------------------------------------------
Expand All @@ -551,7 +552,7 @@ data "aws_partition" "current" {}
data "aws_region" "current" {}

data "aws_iam_policy_document" "cloudwatch" {
count = var.enabled && var.create_rest_api && var.enable_access_logs && var.create_kms_key ? 1 : 0
count = var.enabled && var.enable_access_logs && var.create_kms_key ? 1 : 0
policy_id = "key-policy-cloudwatch"
statement {
sid = "Enable IAM User Permissions"
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ variable "xray_tracing_enabled" {
}

variable "vpc_endpoint_id" {
type = string
default = ""
type = set(string)
default = [""]
description = "ID of the vpc endpoint. Only applicable when "
}

Expand Down
Loading