adding dev deployment

This commit is contained in:
2021-03-19 04:18:40 +00:00
parent 2ac3a940fa
commit 5728f34b3b
8 changed files with 1220 additions and 519 deletions

View File

@@ -1,197 +1,19 @@
{
"version": 4,
"terraform_version": "0.13.5",
"serial": 41,
"serial": 72,
"lineage": "baf13f49-a91e-4ef3-40f8-b010f53cf030",
"outputs": {
"cf_arn": {
"value": "arn:aws:cloudfront::745437999005:distribution/E8811LTEVQX71",
"type": "string"
},
"cf_domain_name": {
"value": "duzt5fbttumv4.cloudfront.net",
"type": "string"
},
"cf_etag": {
"value": "EWX7K6JLLQ02T",
"type": "string"
},
"cf_hosted_zone_id": {
"value": "Z2FDTNDATAQYW2",
"type": "string"
},
"cf_id": {
"value": "E8811LTEVQX71",
"type": "string"
},
"cf_status": {
"value": "Deployed",
"type": "string"
},
"s3_bucket": {
"value": "prod-onmyojideckbuilder-origin",
"type": "string"
},
"s3_bucket_domain_name": {
"value": "prod-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
"value": "prod-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
"type": "string"
}
},
"resources": [
{
"mode": "data",
"type": "archive_file",
"name": "lambda_main",
"provider": "provider[\"registry.terraform.io/hashicorp/archive\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"excludes": null,
"id": "320d4868dd37d1674e98bd790b8a54b006838d04",
"output_base64sha256": "5EVmwQDkgGfYMpMXNaWHUz3cmb/dSssoWl8mM8o3aMs=",
"output_md5": "611fc9e8b494e4b399217f632b8e35ed",
"output_path": "./lambda/main.js.zip",
"output_sha": "320d4868dd37d1674e98bd790b8a54b006838d04",
"output_size": 601,
"source": [],
"source_content": null,
"source_content_filename": null,
"source_dir": null,
"source_file": "./lambda/main.js",
"type": "zip"
}
}
]
},
{
"mode": "managed",
"type": "aws_iam_policy",
"name": "lambda_logging",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:iam::745437999005:policy/prod-onmyojideckbuilder-lambda_logging",
"description": "",
"id": "arn:aws:iam::745437999005:policy/prod-onmyojideckbuilder-lambda_logging",
"name": "prod-onmyojideckbuilder-lambda_logging",
"name_prefix": null,
"path": "/",
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Action\": [\n \"logs:CreateLogGroup\",\n \"logs:CreateLogStream\",\n \"logs:PutLogEvents\"\n ],\n \"Resource\": \"arn:aws:logs:*:*:*\",\n \"Effect\": \"Allow\"\n }\n ]\n}\n"
},
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_iam_role",
"name": "lambda_role",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:iam::745437999005:role/prod-onmyojideckbuilder-lambda",
"assume_role_policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"edgelambda.amazonaws.com\",\"lambda.amazonaws.com\"]},\"Action\":\"sts:AssumeRole\"}]}",
"create_date": "2021-03-18T00:54:31Z",
"description": "",
"force_detach_policies": false,
"id": "prod-onmyojideckbuilder-lambda",
"max_session_duration": 3600,
"name": "prod-onmyojideckbuilder-lambda",
"name_prefix": null,
"path": "/",
"permissions_boundary": null,
"tags": {
"Description": "website to build and share onmyoji decks",
"Project": "onmyoji-deck-builder"
},
"unique_id": "AROA23D4RF6OTBMEPSDVE"
},
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_iam_role_policy_attachment",
"name": "lambda_logging",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "prod-onmyojideckbuilder-lambda-20210318005433729100000002",
"policy_arn": "arn:aws:iam::745437999005:policy/prod-onmyojideckbuilder-lambda_logging",
"role": "prod-onmyojideckbuilder-lambda"
},
"private": "bnVsbA==",
"dependencies": [
"aws_iam_policy.lambda_logging",
"aws_iam_role.lambda_role"
]
}
]
},
{
"mode": "managed",
"type": "aws_lambda_function",
"name": "directory_indexes",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"].us_east_1",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:lambda:us-east-1:745437999005:function:prod-onmyojideckbuilder-directory_indexes",
"dead_letter_config": [],
"description": "",
"environment": [],
"file_system_config": [],
"filename": "./lambda/main.js.zip",
"function_name": "prod-onmyojideckbuilder-directory_indexes",
"handler": "main.handler",
"id": "prod-onmyojideckbuilder-directory_indexes",
"invoke_arn": "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:745437999005:function:prod-onmyojideckbuilder-directory_indexes/invocations",
"kms_key_arn": "",
"last_modified": "2021-03-18T00:54:40.108+0000",
"layers": [],
"memory_size": 128,
"publish": true,
"qualified_arn": "arn:aws:lambda:us-east-1:745437999005:function:prod-onmyojideckbuilder-directory_indexes:1",
"reserved_concurrent_executions": -1,
"role": "arn:aws:iam::745437999005:role/prod-onmyojideckbuilder-lambda",
"runtime": "nodejs12.x",
"s3_bucket": null,
"s3_key": null,
"s3_object_version": null,
"source_code_hash": "5EVmwQDkgGfYMpMXNaWHUz3cmb/dSssoWl8mM8o3aMs=",
"source_code_size": 601,
"tags": {
"Description": "website to build and share onmyoji decks",
"Project": "onmyoji-deck-builder"
},
"timeout": 3,
"timeouts": null,
"tracing_config": [
{
"mode": "PassThrough"
}
],
"version": "1",
"vpc_config": []
},
"dependencies": [
"aws_iam_policy.lambda_logging",
"aws_iam_role.lambda_role",
"aws_iam_role_policy_attachment.lambda_logging",
"data.archive_file.lambda_main"
]
}
]
},
{
"module": "module.cloudfront_s3_cdn",
"mode": "data",
@@ -319,8 +141,8 @@
"hosted_zone_id": "Z1BKCTXD74EZPE",
"id": "prod-onmyojideckbuilder-origin",
"region": "eu-west-1",
"website_domain": null,
"website_endpoint": null
"website_domain": "s3-website-eu-west-1.amazonaws.com",
"website_endpoint": "prod-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
}
}
]
@@ -336,12 +158,12 @@
"schema_version": 0,
"attributes": {
"filename": null,
"id": "541c995169040d9ea986cc60699d59e5d5514e3b475898df8051e5638f80277c",
"rendered": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
"template": "{\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 \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
"id": "d2728ff6ec7bcb2e66ffe5cd0e8a610cec902d51af8660f5da737b296b07277c",
"rendered": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"S3GetObjectForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
"template": "{\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 \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}",
"vars": {
"bucket_name": "prod-onmyojideckbuilder-origin",
"cloudfront_origin_access_identity_iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U",
"cloudfront_origin_access_identity_iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1T3NXW4C57SNI",
"origin_path": "/"
}
}
@@ -365,9 +187,9 @@
"aliases": [
"onmyojideckbuilder.com"
],
"arn": "arn:aws:cloudfront::745437999005:distribution/E8811LTEVQX71",
"arn": "arn:aws:cloudfront::745437999005:distribution/E5L0TBPLNYZX7",
"cache_behavior": [],
"caller_reference": "terraform-20210318012218188400000002",
"caller_reference": "terraform-20210319041540786500000002",
"comment": "Managed by Terraform",
"custom_error_response": [],
"default_cache_behavior": [
@@ -405,13 +227,7 @@
"query_string_cache_keys": null
}
],
"lambda_function_association": [
{
"event_type": "origin-request",
"include_body": false,
"lambda_arn": "arn:aws:lambda:us-east-1:745437999005:function:prod-onmyojideckbuilder-directory_indexes:1"
}
],
"lambda_function_association": [],
"max_ttl": 31536000,
"min_ttl": 0,
"smooth_streaming": false,
@@ -421,15 +237,15 @@
}
],
"default_root_object": "index.html",
"domain_name": "duzt5fbttumv4.cloudfront.net",
"domain_name": "daws4um51qzk4.cloudfront.net",
"enabled": true,
"etag": "EWX7K6JLLQ02T",
"etag": "EJ2IXAOH2KIVR",
"hosted_zone_id": "Z2FDTNDATAQYW2",
"http_version": "http2",
"id": "E8811LTEVQX71",
"id": "E5L0TBPLNYZX7",
"in_progress_validation_batches": 0,
"is_ipv6_enabled": true,
"last_modified_time": "2021-03-18 01:22:20.572 +0000 UTC",
"last_modified_time": "2021-03-19 04:15:43.087 +0000 UTC",
"logging_config": [
{
"bucket": "prod-onmyojideckbuilder-logs.s3.amazonaws.com",
@@ -441,15 +257,24 @@
"origin": [
{
"custom_header": [],
"custom_origin_config": [],
"domain_name": "prod-onmyojideckbuilder-origin.s3.eu-west-1.amazonaws.com",
"custom_origin_config": [
{
"http_port": 80,
"https_port": 443,
"origin_keepalive_timeout": 5,
"origin_protocol_policy": "http-only",
"origin_read_timeout": 30,
"origin_ssl_protocols": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
]
}
],
"domain_name": "prod-onmyojideckbuilder-origin.s3-website.eu-west-1.amazonaws.com",
"origin_id": "prod-onmyojideckbuilder",
"origin_path": "",
"s3_origin_config": [
{
"origin_access_identity": "origin-access-identity/cloudfront/E3899P9Y5AOS3U"
}
]
"s3_origin_config": []
}
],
"origin_group": [],
@@ -486,7 +311,6 @@
},
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
"dependencies": [
"aws_lambda_function.directory_indexes",
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
@@ -506,13 +330,13 @@
"index_key": 0,
"schema_version": 0,
"attributes": {
"caller_reference": "terraform-20210318012209443100000001",
"cloudfront_access_identity_path": "origin-access-identity/cloudfront/E3899P9Y5AOS3U",
"caller_reference": "terraform-20210319041535137100000001",
"cloudfront_access_identity_path": "origin-access-identity/cloudfront/E1T3NXW4C57SNI",
"comment": "prod-onmyojideckbuilder",
"etag": "E1OBPL8GJS1IFK",
"iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U",
"id": "E3899P9Y5AOS3U",
"s3_canonical_user_id": "c6ca7e493807b1f8d4d0384bd9afb42dd1fae658b306d8e2acb0953a4f7d8d8edb3a33810cf86f79c01990e91c97e112"
"etag": "E68AOIVG56N5A",
"iam_arn": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E1T3NXW4C57SNI",
"id": "E1T3NXW4C57SNI",
"s3_canonical_user_id": "682642153922ad412e294e6f379b5ae0ae60c161e20e0fd5dc47d5fb1051d3282ab7d7edd050d78e448363fcde4e0a31"
},
"private": "bnVsbA=="
}
@@ -612,9 +436,16 @@
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
"website": [
{
"error_document": "index.html",
"index_document": "index.html",
"redirect_all_requests_to": "",
"routing_rules": ""
}
],
"website_domain": "s3-website-eu-west-1.amazonaws.com",
"website_endpoint": "prod-onmyojideckbuilder-origin.s3-website-eu-west-1.amazonaws.com"
},
"private": "bnVsbA=="
}
@@ -633,7 +464,7 @@
"attributes": {
"bucket": "prod-onmyojideckbuilder-origin",
"id": "prod-onmyojideckbuilder-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-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U\"\n }\n },\n {\n \"Sid\": \"S3ListBucketForCloudFront\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:ListBucket\",\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3899P9Y5AOS3U\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}"
"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-onmyojideckbuilder-origin/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n },\n {\n \"Sid\": \"PublicRead\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\"\n ],\n \"Resource\": \"arn:aws:s3:::prod-onmyojideckbuilder-origin/*\",\n \"Principal\": \"*\"\n }\n ]\n}"
},
"private": "bnVsbA==",
"dependencies": [
@@ -684,46 +515,7 @@
"type": "aws_route53_record",
"name": "default",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"index_key": 0,
"schema_version": 2,
"attributes": {
"alias": [
{
"evaluate_target_health": false,
"name": "duzt5fbttumv4.cloudfront.net",
"zone_id": "Z2FDTNDATAQYW2"
}
],
"allow_overwrite": false,
"failover_routing_policy": [],
"fqdn": "onmyojideckbuilder.com",
"geolocation_routing_policy": [],
"health_check_id": null,
"id": "Z0511918V1SF3MCG22JU_onmyojideckbuilder.com_A",
"latency_routing_policy": [],
"multivalue_answer_routing_policy": null,
"name": "onmyojideckbuilder.com",
"records": null,
"set_identifier": null,
"ttl": null,
"type": "A",
"weighted_routing_policy": [],
"zone_id": "Z0511918V1SF3MCG22JU"
},
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
"dependencies": [
"aws_lambda_function.directory_indexes",
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
]
}
]
"instances": []
},
{
"module": "module.cloudfront_s3_cdn.module.dns",
@@ -731,46 +523,7 @@
"type": "aws_route53_record",
"name": "ipv6",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"index_key": 0,
"schema_version": 2,
"attributes": {
"alias": [
{
"evaluate_target_health": false,
"name": "duzt5fbttumv4.cloudfront.net",
"zone_id": "Z2FDTNDATAQYW2"
}
],
"allow_overwrite": false,
"failover_routing_policy": [],
"fqdn": "onmyojideckbuilder.com",
"geolocation_routing_policy": [],
"health_check_id": null,
"id": "Z0511918V1SF3MCG22JU_onmyojideckbuilder.com_AAAA",
"latency_routing_policy": [],
"multivalue_answer_routing_policy": null,
"name": "onmyojideckbuilder.com",
"records": null,
"set_identifier": null,
"ttl": null,
"type": "AAAA",
"weighted_routing_policy": [],
"zone_id": "Z0511918V1SF3MCG22JU"
},
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
"dependencies": [
"aws_lambda_function.directory_indexes",
"module.cloudfront_s3_cdn.aws_cloudfront_distribution.default",
"module.cloudfront_s3_cdn.aws_cloudfront_origin_access_identity.default",
"module.cloudfront_s3_cdn.aws_s3_bucket.origin",
"module.cloudfront_s3_cdn.data.aws_s3_bucket.selected",
"module.cloudfront_s3_cdn.module.dns.data.aws_route53_zone.default",
"module.cloudfront_s3_cdn.module.logs.aws_s3_bucket.default"
]
}
]
"instances": []
},
{
"module": "module.cloudfront_s3_cdn.module.logs",