aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.53k stars 417 forks source link

Feature request: Export load balancer ARN from the application CF template #1434

Open perevernihata opened 4 years ago

perevernihata commented 4 years ago

Currently, only PublicLoadBalancerDNSName is exported, therefore if you want to add custom listeners via addon - it is not possible without some custom resource (lambda) to find correct ALB which will be complicated. Should be easy to change? :)

  PublicLoadBalancerArm:
    Condition: CreatePublicLoadBalancer
    Value: !GetAtt PublicLoadBalancer.Arn
    Export:
      Name: !Sub ${AWS::StackName}-PublicLoadBalancerArn

Just add to this file? https://github.com/aws/copilot-cli/blob/87308f4a50fe22dd3e8c85b9ea567bdca51053de/templates/environment/versions/cf-v1.0.0.yml

iamhopaul123 commented 4 years ago

Hello @perevernihata. Good call! It's already on our schedule. We have a plan for adding this output after the feature of enabling users to upgrade their environment.

bathsundeep-graticule commented 10 months ago

@iamhopaul123 Any update on this feature? Would love to get the Load Balancer's ARN for use in an environment addons stack

iamhopaul123 commented 10 months ago

We currently have a workaround for it: you can use env override and deploy the env with the following override file

- op: add
  path: /Outputs/PublicLoadBalancerArn
  value:
    Condition: CreatePublicLoadBalancer
    Value: !GetAtt PublicLoadBalancer.Arn
    Export:
      Name: !Sub ${AWS::StackName}-PublicLoadBalancerArn