-
Notifications
You must be signed in to change notification settings - Fork 1
/
app-prd.tf
57 lines (49 loc) · 1.58 KB
/
app-prd.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
provider "aws" {
region = "us-west-2"
}
terraform {
backend "s3" {
encrypt = true
bucket = "terraform-state-storage-<PRD_AWS_ACCT_NUM>" // TODO replace <PRD_AWS_ACCT_NUM>
dynamodb_table = "terraform-state-lock-<PRD_AWS_ACCT_NUM>" // TODO replace <PRD_AWS_ACCT_NUM>
key = "<APP_NAME>/prd/app.tfstate" // TODO replace <APP_NAME>
region = "us-west-2"
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
required_version = ">= 1.3.0"
}
locals {
app_name = "<APP_NAME>" // TODO replace <APP_NAME>
url = "${local.app_name}.byu.edu" // TODO double check if <APP_NAME>.byu.edu is what you want for your public URL
default_tags = {
repo = "https://github.com/byu-oit/<REPO_NAME>" # TODO fix to match your GitHub repo
app = local.app_name
team = "OIT-BYU-APPS-CUSTOM"
data-sensitivity = "confidential" // TODO Update if needed
env = "prd"
}
}
module "acs" {
source = "github.com/byu-oit/terraform-aws-acs-info?ref=v4.0.0"
}
data "aws_route53_zone" "hosted_zone" {
name = local.url
}
module "s3_site" {
source = "github.com/byu-oit/terraform-aws-s3staticsite?ref=v7.0.3"
site_url = local.url
hosted_zone_id = data.aws_route53_zone.hosted_zone.zone_id
s3_bucket_name = "${local.app_name}.byu.edu"
tags = local.default_tags
}
output "s3_bucket" {
value = module.s3_site.site_bucket.bucket
}
output "cf_distribution_id" {
value = module.s3_site.cf_distribution.id
}