Skip to content

Commit

Permalink
LB and target group resource/edge templates
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSeptimus-Klotho committed Nov 15, 2023
1 parent 534a08a commit 0f908a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/templates/aws/edges/target_group-ecs_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ operational_rules:
field: LoadBalancers
value:
- TargetGroup: '{{ .Source }}'
ContainerName: '{{ .Target.Name }}'
ContainerName: '{{ (downstream "aws:ecs_task_definition" .Target).Name }}'
ContainerPort: '{{ fieldValue "PortMappings[0].ContainerPort" (fieldValue "TaskDefinition" .Target)}}'
- resource: '{{ .Source }}'
configuration:
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/aws/resources/load_balancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ display_name: Load Balancer
sanitize_name:
# https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateLoadBalancer.html
# This name must be unique per region per account,
# can have a maximum of 32 characters,
# can have a maximum of 32 characters (24 since we reserve 8 for an IaC-appended suffix),
# must contain only alphanumeric characters or hyphens,
# must not begin or end with a hyphen,
# and must not begin with "internal-".
Expand All @@ -12,7 +12,7 @@ sanitize_name:
| replace `^internal-` ""
| replace `(^-)|(-$)` ""
| replace `[^[:alnum:]-]+` "-"
| length 1 32
| length 1 24
}}

properties:
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/aws/resources/target_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ display_name: Target Group
sanitize_name:
# https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html
# This name must be unique per region per account,
# can have a maximum of 32 characters,
# can have a maximum of 32 characters (24 since we reserve 8 for an IaC-appended suffix),
# must contain only alphanumeric characters or hyphens,
# and must not begin or end with a hyphen.
|
{{ .
| replace `[^[:alnum:]-]+` "-"
| replace `(^-)|(-$)` ""
| length 1 32
| length 1 24
}}

properties:
Expand Down

0 comments on commit 0f908a4

Please sign in to comment.