-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (40 loc) · 1.35 KB
/
main.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
module "lambda_slack" {
count = length(var.slack_webhook) > 5 ? 1 : 0
source = "./modules/lambda_slack"
site_name = var.site_name
slack_webhook = var.slack_webhook
ecs_cluster_arn = aws_ecs_cluster.wordpress_cluster.arn
}
module "codebuild" {
source = "./modules/codebuild"
site_name = var.site_name
site_domain = var.site_domain
codebuild_bucket = "${var.site_name}-build"
main_vpc_id = var.main_vpc_id
wordpress_ecr_repository = aws_ecr_repository.serverless_wordpress.name
aws_account_id = var.aws_account_id
container_memory = var.ecs_memory
}
module "cloudfront" {
source = "./modules/cloudfront"
site_name = var.site_name
site_domain = var.site_domain
cloudfront_ssl = aws_acm_certificate.wordpress_site.arn
cloudfront_aliases = var.cloudfront_aliases
providers = {
aws.ue1 = aws.ue1
}
depends_on = [aws_acm_certificate_validation.wordpress_site,
module.waf]
cloudfront_class = var.cloudfront_class
waf_acl_arn = var.waf_enabled ? module.waf[0].waf_acl_arn : null
}
module "waf" {
count = var.waf_enabled ? 1 : 0
source = "./modules/waf"
site_name = var.site_name
waf_acl_rules = var.waf_acl_rules
providers = {
aws.ue1 = aws.ue1
}
}