From ddcfa75a03e4283bb51b324c8aeede06ea3874dd Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 13 Mar 2026 11:16:41 +0000 Subject: [PATCH] address PR --- .github/workflows/deploy_terraform.yml | 1 - infrastructure/terraform/cdn/main.tf | 3 ++- infrastructure/terraform/cdn/variables.tf | 4 ---- infrastructure/terraform/lambda/fast-api/main.tf | 8 -------- infrastructure/terraform/lambda/fast-api/outputs.tf | 7 +++++++ infrastructure/terraform/modules/cloudfront/main.tf | 4 +--- infrastructure/terraform/modules/cloudfront/variables.tf | 7 +------ 7 files changed, 11 insertions(+), 23 deletions(-) create mode 100644 infrastructure/terraform/lambda/fast-api/outputs.tf diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 506f11f6..1d84505b 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -361,5 +361,4 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.DEV_AWS_REGION }} - TF_VAR_domain_name: ${{ secrets.ARA_DEV_DOMAIN_NAME }} diff --git a/infrastructure/terraform/cdn/main.tf b/infrastructure/terraform/cdn/main.tf index 29abe6e4..daa3b0f1 100644 --- a/infrastructure/terraform/cdn/main.tf +++ b/infrastructure/terraform/cdn/main.tf @@ -28,7 +28,8 @@ data "terraform_remote_state" "fast_api" { module "cdn" { source = "../modules/cloudfront" - aliases = ["domna.homes", "api.dev.domna.homes"] + # Comment out temporarily just to see what happens + # aliases = [data.terraform_remote_state.fast_api.outputs.domain_name] origins = [ # ---- S3 ---- diff --git a/infrastructure/terraform/cdn/variables.tf b/infrastructure/terraform/cdn/variables.tf index 6fe0073b..423f0b0f 100644 --- a/infrastructure/terraform/cdn/variables.tf +++ b/infrastructure/terraform/cdn/variables.tf @@ -1,7 +1,3 @@ variable "stage" { type = string -} - -variable "domain_name" { - type = string } \ No newline at end of file diff --git a/infrastructure/terraform/lambda/fast-api/main.tf b/infrastructure/terraform/lambda/fast-api/main.tf index 5e8d2b3b..f71b6f60 100644 --- a/infrastructure/terraform/lambda/fast-api/main.tf +++ b/infrastructure/terraform/lambda/fast-api/main.tf @@ -39,14 +39,6 @@ locals { db_credentials = jsondecode(data.aws_secretsmanager_secret_version.db_credentials.secret_string) } -# data "aws_ssm_parameter" "certificate_arn" { -# name = "/ssl_certificate_arn" -# } - -# data "aws_route53_zone" "this" { -# name = var.domain_name -# } - ############################################ # FastAPI Lambda + API Gateway ############################################ diff --git a/infrastructure/terraform/lambda/fast-api/outputs.tf b/infrastructure/terraform/lambda/fast-api/outputs.tf new file mode 100644 index 00000000..d3d9dbaa --- /dev/null +++ b/infrastructure/terraform/lambda/fast-api/outputs.tf @@ -0,0 +1,7 @@ +output "domain_name" { + value = module.fastapi.domain_name +} + +output "api_endpoint" { + value = module.fastapi.api_endpoint +} \ No newline at end of file diff --git a/infrastructure/terraform/modules/cloudfront/main.tf b/infrastructure/terraform/modules/cloudfront/main.tf index 6fa1331e..02b64606 100644 --- a/infrastructure/terraform/modules/cloudfront/main.tf +++ b/infrastructure/terraform/modules/cloudfront/main.tf @@ -98,9 +98,7 @@ resource "aws_cloudfront_distribution" "this" { ########################################## viewer_certificate { - acm_certificate_arn = var.acm_certificate_arn - ssl_support_method = "sni-only" - cloudfront_default_certificate = var.acm_certificate_arn == null + cloudfront_default_certificate = true } } diff --git a/infrastructure/terraform/modules/cloudfront/variables.tf b/infrastructure/terraform/modules/cloudfront/variables.tf index 92ba2347..feff2faa 100644 --- a/infrastructure/terraform/modules/cloudfront/variables.tf +++ b/infrastructure/terraform/modules/cloudfront/variables.tf @@ -3,7 +3,7 @@ variable "origins" { origin_type = string # "s3" or "api" origin_domain_name = string origin_id = string - + bucket_id = optional(string) bucket_arn = optional(string) })) @@ -11,9 +11,4 @@ variable "origins" { variable "aliases" { type = list(string) -} - -variable "acm_certificate_arn" { - type = string - default = null } \ No newline at end of file