Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Nov 21, 2024
1 parent b3bd062 commit b1eeb1a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 1 addition & 3 deletions terraform/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ resource "aws_cloudfront_distribution" "main" {
enabled = true
is_ipv6_enabled = true
http_version = "http2and3"
aliases = [
var.domain_name
]
aliases = local.domains

origin {
domain_name = aws_lb.main.dns_name
Expand Down
6 changes: 5 additions & 1 deletion terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ locals {
repo = "code4romania/rezultatevot",
tag = "0.1.1"
}
# availability_zone = data.aws_availability_zones.current.names[0]

domains = [
var.domain_name,
"www.${var.domain_name}",
]

networking = {
cidr_block = "10.0.0.0/16"
Expand Down
7 changes: 5 additions & 2 deletions terraform/route53.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# A record
resource "aws_route53_record" "ipv4" {
count = length(local.domains)

zone_id = data.aws_route53_zone.main.zone_id
name = var.domain_name
name = local.domains[count.index]
type = "A"

alias {
Expand All @@ -14,8 +15,10 @@ resource "aws_route53_record" "ipv4" {

# AAAA record
resource "aws_route53_record" "ipv6" {
count = length(local.domains)

zone_id = data.aws_route53_zone.main.zone_id
name = var.domain_name
name = local.domains[count.index]
type = "AAAA"

alias {
Expand Down

0 comments on commit b1eeb1a

Please sign in to comment.