File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module "ecs_apps" {
2828
2929| Name | Description | Type | Default | Required |
3030| ------| -------------| :----:| :-----:| :-----:|
31+ | alb_only | Whether to deploy only an alb and no cloudFront or not with the cluster | string | ` "false" ` | no |
3132| alb | Whether to deploy an ALB or not with the cluster | string | ` "true" ` | no |
3233| asg\_ max | Max number of instances for autoscaling group | string | ` "4" ` | no |
3334| asg\_ memory\_ target | Target average memory percentage to track for autoscaling | string | ` "60" ` | no |
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ variable "alb" {
5959 default = true
6060 description = " Whether to deploy an ALB or not with the cluster"
6161}
62+ variable "alb_only" {
63+ default = false
64+ description = " Whether to deploy only an alb and no cloudFront or not with the cluster"
65+ }
6266
6367variable "asg_min" {
6468 default = 1
@@ -89,4 +93,4 @@ variable "target_group_arns" {
8993 default = []
9094 type = " list"
9195 description = " List of target groups for ASG to register"
92- }
96+ }
Original file line number Diff line number Diff line change 11resource "aws_wafregional_web_acl_association" "alb" {
2- count = " ${ var . alb ? 1 : 0 } "
2+ count = " ${ var . alb && ! var . alb_only ? 1 : 0 } "
33
44 resource_arn = aws_lb. ecs [0 ]. arn
55 web_acl_id = aws_wafregional_web_acl. alb [0 ]. id
66}
77
88resource "aws_wafregional_web_acl" "alb" {
9- count = " ${ var . alb ? 1 : 0 } "
9+ count = " ${ var . alb && ! var . alb_only ? 1 : 0 } "
1010
1111 depends_on = [" aws_wafregional_rule.alb_header" ]
1212 name = " alb_ecs_${ var . name } "
@@ -28,7 +28,7 @@ resource "aws_wafregional_web_acl" "alb" {
2828}
2929
3030resource "aws_wafregional_rule" "alb_header" {
31- count = " ${ var . alb ? 1 : 0 } "
31+ count = " ${ var . alb && ! var . alb_only ? 1 : 0 } "
3232
3333 depends_on = [" aws_wafregional_byte_match_set.alb_header" ]
3434 name = " alb_cloudfront_header_ecs_${ var . name } "
@@ -47,7 +47,7 @@ resource "random_string" "alb_cloudfront_key" {
4747}
4848
4949resource "aws_wafregional_byte_match_set" "alb_header" {
50- count = " ${ var . alb ? 1 : 0 } "
50+ count = " ${ var . alb && ! var . alb_only ? 1 : 0 } "
5151
5252 name = " alb_cloudfront_header_ecs_${ var . name } "
5353
You can’t perform that action at this time.
0 commit comments