0

https://u1i7vf9mnl.execute-api.us-west-1.amazonaws.com/v1

How can I get the u1i7vf9mnl portion of the URL from inside of the cloudformation template as a Ref or Fn::GetAtt or some other way?

1 Answer 1

2

Did you try the variable ServerlessRestApi? It works for us like this:

Outputs:    
    EncryptURL:
      Description: "Encrypt endpoint URL for Stage environment"
      Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Stage/encrypt"
2
  • 1
    Hey thanks. Yep! That was it! I had to reference the actual RestApi resource. I was referencing the method resource. Oct 13, 2018 at 14:43
  • 1
    @mutant_city Cool! Oct 13, 2018 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.