Opinionated template Terraform module to spin up infrastructure for a Single Page Application hosted on AWS S3 buckets
domain
- Route 53 hosted zone domain object containing name and zone_idcertificate_arn
- AWS ACM certificate ARNenvironment
- Defaults to production. Intended for CI/CD usage if testing or blue/green deployment environments needed
module "aws_s3_hosted_spa_infra_template" "mySpaInfra" {
source = "git::[email protected]:calinmarina/tf_aws_hosted_spa_infra_template_module.git"
domain = {
"name": data.aws_route53_zone.name,
"zone_id": data.aws_route53_zone.route_zone.zone_id
}
certificate_arn = data.aws_acm_certificate.cert.arn
}
data "aws_route53_zone" "route_zone" {
name = "exampledomain.com"
}
data "aws_acm_certificate" "cert" {
domain_name = "exampledomain.com"
statuses = ["ISSUED"]
}
s3_bucket
- S3 Bucket Namespa_cloudfront
- CloudFront details to access the website