Skip to content

Repo spins up frontend application setup which include CloudFront distribution, S3 bucket and DNS record.

License

Notifications You must be signed in to change notification settings

dasmeta/terraform-aws-frontend-app

Repository files navigation

terraform-aws-frontend-app

Repo spins up frontend application setup which include CloudFront distribution, S3 bucket and DNS record, waf.

Example

module "this" {
  source  = "dasmeta/frontend-app/aws"
  version = "1.1.0"

  domain = "basic-test-front-app.devops.dasmeta.com"
  zone   = "devops.dasmeta.com"

  providers = { aws : aws, aws.virginia : aws.virginia }
}

Requirements

Name Version
terraform > 1.3.0
aws >= 5.27.0, < 6.0

Providers

No providers.

Modules

Name Source Version
cdn dasmeta/modules/aws//modules/cloudfront-ssl-hsts 2.16.0
dns dasmeta/dns/aws 1.0.4
dns_alternative dasmeta/dns/aws 1.0.4
s3 dasmeta/s3/aws 1.2.1
waf dasmeta/modules/aws//modules/waf 2.15.6

Resources

No resources.

Inputs

Name Description Type Default Required
alternative_domains n/a list(string) [] no
alternative_zones n/a list(string) [] no
cdn_configs CDN configuration options
object({
default_root_object = optional(string, "index.html")
additional_origins = optional(any, [])
})
{
"additional_origins": [],
"default_root_object": "index.html"
}
no
domain domain full name string n/a yes
enable_http_security_headers Whether to enable http security headers by creating pass through lambda handler for cdn bool false no
s3_configs S3 bucket configuration options
object({
acl = optional(string, "private")
create_index_html = optional(bool, true)
ignore_public_acls = optional(bool, true)
restrict_public_buckets = optional(bool, true)
block_public_acls = optional(bool, true)
block_public_policy = optional(bool, true)

versioning = optional(object({ enabled = bool }), { enabled = false })
website = optional(object({ index_document = string, error_document = string }), { index_document = "index.html", error_document = "index.html" })
create_iam_user = optional(bool, false)
})
{
"acl": "private",
"block_public_acls": true,
"block_public_policy": true,
"create_iam_user": false,
"create_index_html": true,
"ignore_public_acls": true,
"restrict_public_buckets": true,
"versioning": {
"enabled": false
},
"website": {
"error_document": "index.html",
"index_document": "index.html"
}
}
no
waf waf configs any null no
zone R53 zone name string null no

Outputs

Name Description
distribution_id cloudfront distribution id
s3_bucket_id s3 bucket name/id
s3_config n/a
web_acl_id waf arm/id