Skip to content

Commit

Permalink
Force redeploy resources
Browse files Browse the repository at this point in the history
  • Loading branch information
amarouane-ABDELHAK committed May 31, 2024
1 parent c6a1930 commit f920738
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions stacks/grafana.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def __init__(
service = self.build_service(
vpc=vpc,
container_name=container_name,
cluster_name=settings.grafana_stack_name,
stage=settings.stage
cluster_name=settings.grafana_stack_name
)

container = service.task_definition.find_container(container_name)
Expand Down Expand Up @@ -107,16 +106,15 @@ def build_service(
self,
vpc: ec2.Vpc,
cluster_name: str,
container_name: str,
stage: str = "dev"
container_name: str
):
# Production has a public NAT Gateway subnet, which causes the
# default load balancer creation to fail with too many subnets
# being selected per AZ. We create our own load balancer to
# allow us to select subnets and avoid the issue.
load_balancer: elbv2.ApplicationLoadBalancer = elbv2.ApplicationLoadBalancer(
self,
f"{stage}-load-balancer",
"load-balancer",
vpc=vpc,
internet_facing=True,
vpc_subnets=ec2.SubnetSelection(
Expand All @@ -129,7 +127,7 @@ def build_service(
"Service",
cluster=ecs.Cluster(
self,
f"{stage}-cluster",
"cluster",
cluster_name=cluster_name,
vpc=vpc,
),
Expand All @@ -138,7 +136,7 @@ def build_service(
one_per_az=True,
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED,
),
service_name=f"{stage}-grafana",
service_name="grafana",
desired_count=1,
task_image_options=ecs_patterns.ApplicationLoadBalancedTaskImageOptions(
image=ecs.ContainerImage.from_asset("grafana"),
Expand Down

0 comments on commit f920738

Please sign in to comment.