Skip to content

Commit

Permalink
add listener rule for webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxstorm committed Feb 17, 2023
1 parent b7e7e0d commit 704d5cb
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import pulumi_aws as aws
import pulumi_random as random
import pulumi_cloudflare as cloudflare
import pulumi_cloudflare as cloudflare
import components.database as database
import components.elasticache as elasticache
import components.fargateapp as fargate
Expand All @@ -23,6 +23,7 @@
cluster_arn = cluster.get_output("cluster_arn")

loadbalancer = pulumi.StackReference(f"{org}/aws_loadbalancer/{stack}")
lb_arn = loadbalancer.require_output("lb_arn")
target_group_arn = loadbalancer.require_output("target_group_arn")
address = loadbalancer.require_output("lb_dns_name")

Expand Down Expand Up @@ -214,6 +215,31 @@
),
)

lb = aws.lb.get_load_balancer_output(arn=lb_arn)

https_listener = aws.lb.get_listener_output(
load_balancer_arn=lb.arn,
port=443,
)

rule = aws.lb.ListenerRule(
"brig.gs",
listener_arn=https_listener.arn,
priority=99,
actions=[
aws.lb.ListenerRuleActionArgs(
type="forward",
target_group_arn=target_group_arn,
)
],
conditions=[
aws.lb.ListenerRuleConditionArgs(
host_header=aws.lb.ListenerRuleConditionHostHeaderArgs(values=["brig.gs"])
)
],
)


"""
Allow the task to access the secrets
in secrets manager
Expand Down

0 comments on commit 704d5cb

Please sign in to comment.