Skip to content

Commit a13a528

Browse files
committed
Fix tf variables
1 parent 6316d3c commit a13a528

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

static-site/cloudfront.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resource "aws_cloudfront_distribution" "static_site" {
22
comment = "Distribution for ${var.domain_name}"
3-
aliases = var.cloudfront.aliases
3+
aliases = local.aliases
44
enabled = true
55
is_ipv6_enabled = true
66
default_root_object = "index.html"

static-site/data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data "aws_iam_policy_document" "oidc" {
1616
condition {
1717
test = "StringLike"
1818
variable = "token.actions.githubusercontent.com:sub"
19-
values = ["repo:${var.repo_path}"]
19+
values = ["repo:${var.repo}"]
2020
}
2121
}
2222
}

static-site/locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
locals {
2+
aliases = [var.domain_name]
3+
}

static-site/variables.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ variable "repo" {
2121

2222
variable "cloudfront" {
2323
type = object({
24-
aliases = list(string)
25-
2624
restriction = object({
2725
type = string
2826
locations = list(string)
@@ -32,10 +30,8 @@ variable "cloudfront" {
3230
minimum_protocol_version = string
3331
})
3432
})
35-
33+
description = "The configuration for the CloudFront distribution"
3634
default = {
37-
aliases = [var.domain_name]
38-
3935
restriction = {
4036
type = "none"
4137
locations = []

0 commit comments

Comments
 (0)