diff --git a/infrastructure/main.tf b/infrastructure/main.tf index 0ead7860..bdd39e28 100644 --- a/infrastructure/main.tf +++ b/infrastructure/main.tf @@ -273,8 +273,9 @@ resource "null_resource" "update_workflows_lambda_image" { # API Gateway HTTP API resource "aws_apigatewayv2_api" "workflows_http_api" { - name = "${var.prefix}_workflows_http_api" - protocol_type = "HTTP" + name = "${var.prefix}_workflows_http_api" + protocol_type = "HTTP" + disable_execute_api_endpoint = var.disable_default_apigw_endpoint } # Lambda Integration for API Gateway @@ -305,19 +306,3 @@ resource "aws_lambda_permission" "api-gateway" { principal = "apigateway.amazonaws.com" source_arn = "${aws_apigatewayv2_api.workflows_http_api.execution_arn}/*/$default" } - -# Cloudfront update - -resource "null_resource" "update_cloudfront" { - triggers = { - always_run = "${timestamp()}" - } - - count = coalesce(var.cloudfront_id, false) != false ? 1 : 0 - - provisioner "local-exec" { - command = "${path.module}/cf_update.sh ${var.cloudfront_id} workflows_api_origin \"${aws_apigatewayv2_api.workflows_http_api.api_endpoint}\"" - } - - depends_on = [aws_apigatewayv2_api.workflows_http_api] -} diff --git a/infrastructure/terraform.tfvars.tmpl b/infrastructure/terraform.tfvars.tmpl index 0e49bc17..cf5e6613 100644 --- a/infrastructure/terraform.tfvars.tmpl +++ b/infrastructure/terraform.tfvars.tmpl @@ -17,7 +17,6 @@ vector_secret_name="${VECTOR_SECRET_NAME}" vector_security_group="${VECTOR_SECURITY_GROUP}" vector_vpc="${VECTOR_VPC:-null}" workflow_root_path="${WORKFLOW_ROOT_PATH}" -cloudfront_id="${VEDA_CLOUDFRONT_ID}" cognito_domain="${VEDA_COGNITO_DOMAIN}" client_id="${VEDA_CLIENT_ID}" userpool_id="${VEDA_USERPOOL_ID}" diff --git a/infrastructure/variables.tf b/infrastructure/variables.tf index 0b43bef8..25d08958 100644 --- a/infrastructure/variables.tf +++ b/infrastructure/variables.tf @@ -98,10 +98,6 @@ variable "workflow_root_path" { default = "/api/workflows" } -variable "cloudfront_id" { - type = string -} - variable "cognito_domain" { type = string } @@ -134,3 +130,8 @@ variable "ecs_task_memory" { type = number default = 4096 } + +variable "disable_default_apigw_endpoint" { + type = bool + default = false +} \ No newline at end of file