aws-actions / amazon-ecs-deploy-task-definition

Registers an Amazon ECS task definition and deploys it to an ECS service.
MIT License
643 stars 238 forks source link

Unmasking the URL of ALB #572

Open viral-siddhapura opened 3 months ago

viral-siddhapura commented 3 months ago

I have my react application running on ECS which is connected to ALB for the unique URL. Now whenever my code changes are pushed to GitHub, I run a particular CI/CD pipeline that updates my ECR for fetching the latest docker image and that triggers my ECS which generates tasks. Ultimately see the below deploy.yaml file code to get the URL but it comes with masking (***) which I want to remove.

- name: Retrieve ALB DNS Name
      id: get-alb-dns
      run: |
        TARGET_GROUP_ARN=$(aws ecs describe-services --cluster transfer-chain-cluster --services transfer-file-service --query "services[0].loadBalancers[0].targetGroupArn" --output text --region ${{ env.AWS_REGION }})
        ALB_ARN=$(aws elbv2 describe-target-groups --target-group-arns $TARGET_GROUP_ARN --query "TargetGroups[0].LoadBalancerArns[0]" --output text --region ${{ env.AWS_REGION }})
        ALB_DNS=$(aws elbv2 describe-load-balancers --load-balancer-arns $ALB_ARN --query "LoadBalancers[0].DNSName" --output text --region ${{ env.AWS_REGION }})
        echo "ALB_DNS=${ALB_DNS}" >> $GITHUB_ENV

    - name: Output ALB DNS Name
      run: |
        echo "Application URL: http://${{ env.ALB_DNS }}"

Now assume that the application URL is as follows: my-app-1234567890.us-east-1.elb.amazonaws.com but it shows me my-app-1234567890.***.elb.amazonaws.com so how to unmask the URL generated by GitHub YAML workflow?

I know it is the issue of secrets but how to solve that?

viral-siddhapura commented 3 months ago

Anyone have thoughts on the above issue? @egyptianbman @hyandell @clareliguori @Louisblack

egyptianbman commented 3 months ago

You probably need to set this to false: https://github.com/aws-actions/configure-aws-credentials/blob/main/action.yml#L40-L42