Merge latest version #3

Merged
dtomlinson merged 18 commits from develop into master 2020-07-22 23:03:57 +00:00
5 changed files with 6 additions and 12 deletions
Showing only changes of commit 79ebc1dc2b - Show all commits

View File

@@ -35,7 +35,7 @@ module "cloudfront_s3_cdn" {
"Effect":"Allow", "Effect":"Allow",
"Principal": "*", "Principal": "*",
"Action":["s3:GetObject"], "Action":["s3:GetObject"],
"Resource": "arn:aws:s3:::${var.bucket_name}/*" "Resource": "arn:aws:s3:::${module.cloudfront_s3_cdn.s3_bucket}/*"
} }
] ]
} }

View File

@@ -1,7 +1,7 @@
{ {
"version": 4, "version": 4,
"terraform_version": "0.12.26", "terraform_version": "0.12.26",
"serial": 90, "serial": 97,
"lineage": "cda52006-90fc-4aec-a630-42e69057b365", "lineage": "cda52006-90fc-4aec-a630-42e69057b365",
"outputs": { "outputs": {
"cf_arn": { "cf_arn": {

View File

@@ -1,7 +1,7 @@
{ {
"version": 4, "version": 4,
"terraform_version": "0.12.26", "terraform_version": "0.12.26",
"serial": 88, "serial": 95,
"lineage": "cda52006-90fc-4aec-a630-42e69057b365", "lineage": "cda52006-90fc-4aec-a630-42e69057b365",
"outputs": { "outputs": {
"cf_arn": { "cf_arn": {
@@ -50,7 +50,7 @@
"attributes": { "attributes": {
"id": "1149999058", "id": "1149999058",
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n }\n ]\n}", "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}\",\n \"Principal\": {\n \"AWS\": \"${cloudfront_origin_access_identity_iam_arn}\"\n }\n }\n ]\n}",
"override_json": "{\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\": \"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\": \"arn:aws:s3:::prod-panaetius-blog-origin/*\"\n}\n", "override_json": "{}",
"policy_id": null, "policy_id": null,
"source_json": null, "source_json": null,
"statement": [ "statement": [
@@ -116,7 +116,7 @@
"attributes": { "attributes": {
"id": "239689126", "id": "239689126",
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n }\n ]\n}", "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::${bucket_name}${origin_path}*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n }\n ]\n}",
"override_json": "{\n \"Sid\":\"PublicRead\",\n \"Effect\":\"Allow\",\n \"Principal\": \"*\",\n \"Action\":[\"s3:GetObject\"],\n \"Resource\": \"arn:aws:s3:::prod-panaetius-blog-origin/*\"\n}\n", "override_json": "{}",
"policy_id": null, "policy_id": null,
"source_json": null, "source_json": null,
"statement": [ "statement": [
@@ -729,11 +729,10 @@
"attributes": { "attributes": {
"bucket": "prod-panaetius-blog-origin", "bucket": "prod-panaetius-blog-origin",
"id": "prod-panaetius-blog-origin", "id": "prod-panaetius-blog-origin",
"policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"S3GetObjectForCloudFront\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E21A7YWJ1RT3K5\"},\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::prod-panaetius-blog-origin/*\"},{\"Sid\":\"S3ListBucketForCloudFront\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E21A7YWJ1RT3K5\"},\"Action\":\"s3:ListBucket\",\"Resource\":\"arn:aws:s3:::prod-panaetius-blog-origin\"}]}" "policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::prod-panaetius-blog-origin/*\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E21A7YWJ1RT3K5\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::prod-panaetius-blog-origin\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E21A7YWJ1RT3K5\"\n }\n }\n ]\n}"
}, },
"private": "bnVsbA==", "private": "bnVsbA==",
"dependencies": [ "dependencies": [
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
"module.cloudfront_s3_cdn.aws_s3_bucket.origin" "module.cloudfront_s3_cdn.aws_s3_bucket.origin"
] ]
} }

View File

@@ -14,10 +14,6 @@ variable "profile" {
} }
variable "bucket_name" {
}
variable "acm_certificate_arn" { variable "acm_certificate_arn" {
} }

View File

@@ -2,7 +2,6 @@ name = "panaetius-blog"
region = "eu-west-1" region = "eu-west-1"
stage = "prod" stage = "prod"
profile = "admin" profile = "admin"
bucket_name = "prod-panaetius-blog-origin"
acm_certificate_arn = "arn:aws:acm:us-east-1:745437999005:certificate/60af49f0-07bb-4680-8f5b-3c9a33f756e5" acm_certificate_arn = "arn:aws:acm:us-east-1:745437999005:certificate/60af49f0-07bb-4680-8f5b-3c9a33f756e5"
parent_zone_id = "Z05316671VABVSMAAF1RC" parent_zone_id = "Z05316671VABVSMAAF1RC"
aliases = ["panaetius.io"] aliases = ["panaetius.io"]