-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-dev.tf
57 lines (49 loc) · 1.58 KB
/
app-dev.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-863362256468" // TODO replace <DEV_AWS_ACCT_NUM>
dynamodb_table = "terraform-state-lock-863362256468" // TODO replace <DEV_AWS_ACCT_NUM>
key = "sg738-fav-color-ui/dev/app.tfstate" // TODO replace <APP_NAME>
region = "us-west-2"
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
required_version = ">= 0.13.3"
}
locals {
app_name = "sg738-fav-color-ui" // 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/sg738-fav-color-ui" # TODO fix to match your GitHub repo
app = local.app_name
team = "OIT-BYU-APPS-CUSTOM"
data-sensitivity = "confidential" // TODO Update if needed
env = "dev"
}
}
module "acs" {
source = "github.com/byu-oit/terraform-aws-acs-info?ref=v3.1.0"
}
data "aws_route53_zone" "hosted_zone" {
name = local.url
}
module "s3_site" {
source = "github.com/byu-oit/terraform-aws-s3staticsite?ref=v6.0.0"
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
}