Skip to content

Commit cec16bb

Browse files
committed
feat: Added restriction config for CloudFront distribution
1 parent d0d3be9 commit cec16bb

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

CHANGELOG.md

Whitespace-only changes.

static-site/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# static-site
2+
3+
## v0.0.2
4+
5+
### 01 Dec, 2024
6+
7+
- Added variables for CloudFront restrictions types
8+
9+
## v0.0.1
10+
11+
### 01 Dec, 2024
12+
13+
- Added initial module

static-site/cloudfront.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ resource "aws_cloudfront_distribution" "static_site" {
1313

1414
restrictions {
1515
geo_restriction {
16-
restriction_type = "none"
17-
locations = []
16+
restriction_type = var.restriction_type
17+
locations = var.locations
1818
}
1919
}
2020

static-site/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ variable "role_name" {
2525
default = "deploy-static-site"
2626
}
2727

28+
variable "restriction_type" {
29+
type = string
30+
description = "The restriction type for the CloudFront distribution"
31+
default = "none"
32+
}
33+
34+
variable "locations" {
35+
type = list(string)
36+
description = "The locations for the restriction type"
37+
default = []
38+
}
39+
2840
variable "tags" {
2941
type = map(string)
3042
description = "The tags to apply to all resources created"

0 commit comments

Comments
 (0)