Skip to content

Commit

Permalink
chore: add LB_DNS env var for internal ALBs (#5483)
Browse files Browse the repository at this point in the history
```
Variables

  Name                                Container  Environment           Value
  ----                                ---------  -----------           -----
  COPILOT_APPLICATION_NAME            be         env-name-with-dashes  v129-testing
    "                                   "        test                    "
  COPILOT_ENVIRONMENT_NAME              "        env-name-with-dashes  env-name-with-dashes
    "                                   "        test                  test
  COPILOT_LB_DNS                        "        env-name-with-dashes  internal-internalALBforImport-1595089742.us-west-2.elb.amazonaws.com
  COPILOT_SERVICE_DISCOVERY_ENDPOINT    "          "                   env-name-with-dashes.v129-testing.local
    "                                   "        test                  test.v129-testing.local
  COPILOT_SERVICE_NAME                  "        env-name-with-dashes  be
    "                                   "        test                    "
```

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
huanjani committed Dec 1, 2023
1 parent 3369798 commit 9103b4d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Resources:
Value: !Sub "${EnvName}"
- Name: COPILOT_SERVICE_NAME
Value: !Sub "${WorkloadName}"
- Name: COPILOT_LB_DNS
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
EnvironmentFiles:
- !If
- HasEnvFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Resources:
Value: !Sub "${EnvName}"
- Name: COPILOT_SERVICE_NAME
Value: !Sub "${WorkloadName}"
- Name: COPILOT_LB_DNS
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
EnvironmentFiles:
- !If
- HasEnvFile
Expand Down Expand Up @@ -119,6 +121,8 @@ Resources:
Value: !Sub "${EnvName}"
- Name: COPILOT_SERVICE_NAME
Value: !Sub "${WorkloadName}"
- Name: COPILOT_LB_DNS
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
EnvironmentFiles:
- !If
- HasEnvFileForfluentbit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Resources:
Value: !Sub "${EnvName}"
- Name: COPILOT_SERVICE_NAME
Value: !Sub "${WorkloadName}"
- Name: COPILOT_LB_DNS
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
EnvironmentFiles:
- !If
- HasEnvFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Resources:
Value: !Sub '${EnvName}'
- Name: COPILOT_SERVICE_NAME
Value: !Sub '${WorkloadName}'
- Name: COPILOT_LB_DNS
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
EnvironmentFiles:
- !If
- HasEnvFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@
{{- end}}
{{- end}}
{{- end}}{{- end}}
{{- if eq .WorkloadType "Load Balanced Web Service"}}
{{- if .ALBListener}}
- Name: COPILOT_LB_DNS
{{- if .ImportedALB}}
{{- if eq .WorkloadType "Load Balanced Web Service"}}
{{- if .ImportedALB}}
Value: {{.ImportedALB.DNSName}}
{{- else}}
{{- else}}
Value: !GetAtt EnvControllerAction.PublicLoadBalancerDNSName
{{- end}}
{{- end}}
{{- end}}
{{- else if eq .WorkloadType "Backend Service"}}
{{- if .ImportedALB}}
Value: {{.ImportedALB.DNSName}}
{{- else}}
Value: !GetAtt EnvControllerAction.InternalLoadBalancerDNSName
{{- end}}
{{- end}}
{{- end}}

0 comments on commit 9103b4d

Please sign in to comment.