Skip to content

Commit 4d0d6b5

Browse files
authored
Fix for issue #795 and code clearnup (#797)
1 parent 10e7565 commit 4d0d6b5

File tree

20 files changed

+1202
-807
lines changed

20 files changed

+1202
-807
lines changed

docs/syntax/compose_x/elbv2.rst

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,55 @@ Similar syntax as for ECS Services Ingress, allow you to define Ingress. See the
135135
Listeners
136136
=========
137137

138+
.. hint::
139+
140+
Since version 1.1.8 you can define the listeners with a mapping, key being the port. For example
141+
142+
.. code-block::
143+
144+
x-elbv2:
145+
lbA:
146+
Properties:
147+
Type: application
148+
Scheme: internet-facing
149+
DnsAliases:
150+
- Route53Zone: x-route53::public-domain-01
151+
Names:
152+
- test.bdd-testing.compose-x.io
153+
- someother.test.bdd-testing.compose-x.io
154+
Settings:
155+
S3Logs: bucket:/prefix
156+
timeout_seconds: 60
157+
desync_mitigation_mode: defensive
158+
drop_invalid_header_fields: True
159+
http2: False
160+
cross_zone: True
161+
Listeners:
162+
80:
163+
Protocol: HTTP
164+
DefaultActions:
165+
- Redirect: HTTP_TO_HTTPS
166+
443:
167+
Protocol: HTTP
168+
Certificates:
169+
- x-acm: public-acm-01
170+
Targets:
171+
- name: bignicefamily:app01
172+
access: /somewhere
173+
8080:
174+
Protocol: HTTP
175+
Certificates:
176+
- x-acm: public-acm-01
177+
- CertificateArn: arn:aws:acm:eu-west-1:012345678912:certificate/102402a1-d0d2-46ff-b26b-33008f072ee8
178+
Targets:
179+
- name: bignicefamily:rproxy
180+
access: /
181+
- name: youtoo:rproxy
182+
access: /stupid
183+
- name: bignicefamily:app01
184+
access: thereisnospoon.ews-network.net:8080/abcd
185+
186+
138187
You can define in a very simple way your `Listener definition`_ and cross-reference other resources, here, the services
139188
and ACM certificates you might be creating.
140189

@@ -149,6 +198,10 @@ The following properties are identical to the original CFN definition.
149198

150199
`JSON Schema definition <https://github.com/compose-x/ecs_composex_specs/blob/main/ecs_composex_specs/x-elbv2.spec.json#L82>`__
151200

201+
.. note::
202+
203+
When using the dict/object format for Listener ports, the ``Port`` property defined is ignored as to avoid having conflicting values.
204+
152205
.. hint::
153206

154207
For certificates, you can also use **x-acm** to refer to an ACM certificate you are creating with this stack.
@@ -611,7 +664,7 @@ as reference for your use-case.
611664
.. _Type: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html#cfn-elasticloadbalancingv2-loadbalancer-type
612665
.. _Target Group: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html
613666
.. _Listener definition: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listener.html
614-
.. _AuthenticateCognitoConfig : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-listenerrule-authenticatecognitoconfig.html#cfn-elasticloadbalancingv2-listenerrule-authenticatecognitoconfig-userpoolarn
667+
.. _AuthenticateCognitoConfig : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-listenerrule-authenticatecognitoconfig.html
615668
.. _AuthenticateOidcConfig: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-listenerrule-authenticateoidcconfig.html
616669
.. _LoadBalancerAttributes: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html#cfn-elasticloadbalancingv2-loadbalancer-loadbalancerattributes
617670
.. _Tags: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html#cfn-elasticloadbalancingv2-loadbalancer-tags

ecs_composex/common/cfn_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Copyright 2020-2025 John Mille <john@compose-x.io>
33

4-
""""
4+
"""
55
Common parameters for CFN
66
This is a crucial part as all the titles, marked `_T` are string which are then used the same way
77
across all imports, which gives consistency for CFN to use the same names,

ecs_composex/ecs_ingress/ecs_ingress_stack.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Copyright 2024 John Mille <john@compose-x.io>
33

4-
"""
5-
6-
"""
4+
""" """
75

86
from __future__ import annotations
97

0 commit comments

Comments
 (0)