Skip to content

Commit a06925f

Browse files
authored
Merge pull request #6 from missionmike/develop
feat: add CloudFront domain to allowed origins.
2 parents a2961e1 + 18113ae commit a06925f

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/actions/terraform-plan/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ runs:
77
steps:
88
- uses: actions/checkout@v3
99

10+
- name: Setup Terraform
11+
uses: hashicorp/setup-terraform@v3
12+
1013
- name: Initialize Terraform
1114
working-directory: terraform
1215
shell: bash

terraform/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ terraform {
1414
encrypt = true
1515
}
1616
}
17+
18+
variable "region" {
19+
default = "us-west-2"
20+
}

terraform/s3_policies.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ resource "aws_s3_bucket_cors_configuration" "medialocal_cors" {
77
allowed_origins = [
88
"http://*.${local.domain}",
99
"https://*.${local.domain}",
10-
"http://localhost:3000"
10+
"http://localhost:3000",
11+
"https://${aws_cloudfront_distribution.medialocal_distribution.domain_name}"
1112
]
1213
expose_headers = []
1314
max_age_seconds = 3000
@@ -23,7 +24,9 @@ resource "aws_s3_bucket_cors_configuration" "mediatest_cors" {
2324
allowed_origins = [
2425
"http://*.${local.domain}",
2526
"https://*.${local.domain}",
26-
"http://localhost:3000"
27+
"http://localhost:3000",
28+
"https://${aws_cloudfront_distribution.mediatest_distribution.domain_name}"
29+
2730
]
2831
expose_headers = []
2932
max_age_seconds = 3000
@@ -39,7 +42,8 @@ resource "aws_s3_bucket_cors_configuration" "media_cors" {
3942
allowed_origins = [
4043
"http://*.${local.domain}",
4144
"https://*.${local.domain}",
42-
"http://localhost:3000"
45+
"http://localhost:3000",
46+
"https://${aws_cloudfront_distribution.media_distribution.domain_name}"
4347
]
4448
expose_headers = []
4549
max_age_seconds = 3000

0 commit comments

Comments
 (0)