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: alter CDN module to create public record rather than private #308

Merged
merged 4 commits into from
Sep 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion infra/terraform/environments/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module "service" {

legacy_environment = "DEV"

domain_name = "dev.olcs.dev-dvsacloud.uk"
domain_name = "dev-dvsacloud.uk"
assets_version = var.assets_version

vpc_id = data.aws_vpc.this.id
Expand Down
2 changes: 1 addition & 1 deletion infra/terraform/environments/int/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module "service" {

legacy_environment = "QA"

domain_name = "qa.olcs.dev-dvsacloud.uk"
domain_name = "dev-dvsacloud.uk"
assets_version = var.assets_version

vpc_id = data.aws_vpc.this.id
Expand Down
1 change: 0 additions & 1 deletion infra/terraform/modules/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
| [aws_lb_target_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
| [aws_canonical_user_id.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id) | data source |
| [aws_cloudfront_log_delivery_canonical_user_id.cloudfront](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_log_delivery_canonical_user_id) | data source |
| [aws_route53_zone.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_route53_zone.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_s3_bucket.assets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |

Expand Down
12 changes: 3 additions & 9 deletions infra/terraform/modules/service/cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@ data "aws_route53_zone" "public" {
name = var.domain_name
}

data "aws_route53_zone" "private" {
name = var.domain_name

private_zone = true
}

locals {
domain_name = trimsuffix(data.aws_route53_zone.public.name, ".")
subdomain = "cdn"
domain_name = data.aws_route53_zone.public.name
subdomain = "${var.environment}-cdn"
}

module "acm" {
Expand Down Expand Up @@ -200,7 +194,7 @@ module "records" {
source = "terraform-aws-modules/route53/aws//modules/records"
version = "~> 4.0"

zone_id = data.aws_route53_zone.private.zone_id
zone_id = data.aws_route53_zone.public.zone_id

records = [
{
Expand Down