Skip to content

Instantly share code, notes, and snippets.

View HunterLarco's full-sized avatar
🚀
making all the things

Hunter Larco HunterLarco

🚀
making all the things
View GitHub Profile
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(),
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
}
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
output "zone" {
value = aws_route53_zone.this
}
output "zones" {
value = {
painted_nyc = module.painted_nyc.zone
paintedlabs_com = module.paintedlabs_com.zone
terrace_co = module.terrace_co.zone
}
}
variable "zones" {
type = object({
painted_nyc = object({
zone_id = string
})
})
}
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
resource "aws_s3_bucket" "frontend" {
bucket = "painted.nyc"
acl = "public-read"
website {
index_document = "index.html"
error_document = "index.html"
}
}
@HunterLarco
HunterLarco / logs
Last active January 26, 2021 20:16
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
name: release
on:
push:
branches:
- master
pull_request:
branches:
- master