This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aws | |
import uuidv4 | |
s3client = aws.s3() | |
@app.post('/preupload') | |
def preupload(request, response): | |
metadata = { | |
'dateCreated': datetime.now(), | |
'path': 's3://soot-user-data/uploads/%s' % uuidv4.create(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_route53_record" "frontend" { | |
zone_id = var.zones.painted_nyc.zone_id | |
name = "painted.nyc" | |
type = "A" | |
alias { | |
name = aws_cloudfront_distribution.frontend.domain_name | |
zone_id = aws_cloudfront_distribution.frontend.hosted_zone_id | |
evaluate_target_health = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudfront_distribution" "frontend" { | |
# The CloudFront distribution cannot start until the attached certificate has | |
# passed validation. | |
depends_on = [aws_acm_certificate_validation.this] | |
origin { | |
domain_name = aws_s3_bucket.frontend.website_endpoint | |
origin_id = aws_s3_bucket.frontend.bucket | |
custom_origin_config { | |
http_port = 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "zone" { | |
value = aws_route53_zone.this | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "zones" { | |
value = { | |
painted_nyc = module.painted_nyc.zone | |
paintedlabs_com = module.paintedlabs_com.zone | |
terrace_co = module.terrace_co.zone | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "zones" { | |
type = object({ | |
painted_nyc = object({ | |
zone_id = string | |
}) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_acm_certificate" "this" { | |
domain_name = "painted.nyc" | |
subject_alternative_names = ["www.painted.nyc"] | |
validation_method = "DNS" | |
} | |
resource "aws_route53_record" "certificate_validation" { | |
for_each = { | |
for dvo in aws_acm_certificate.this.domain_validation_options : dvo.domain_name => { | |
name = dvo.resource_record_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_s3_bucket" "frontend" { | |
bucket = "painted.nyc" | |
acl = "public-read" | |
website { | |
index_document = "index.html" | |
error_document = "index.html" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2021-01-26 15:14:25,081 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.0.62 Python/3.7.4 Darwin/20.1.0 exe/x86_64 | |
2021-01-26 15:14:25,082 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['docdb', 'create-db-cluster', '--db-cluster-identifier', 'sample-cluster', '--engine', 'docdb', '--engine-version', '4.0.0', '--deletion-protection', '--master-username', 'master-user', '--master-user-password', 'password', '--debug'] | |
2021-01-26 15:14:25,082 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f9008a155f0> | |
2021-01-26 15:14:25,082 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f90082bccb0> | |
2021-01-26 15:14:25,082 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f9008a63200> | |
2021-01-26 15:14:25,082 - MainThread - botocore.hooks - DEBUG - Event session-initializ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master |