-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic URI in Swagger file #79
Comments
Unfortunately not. This is a API Gateway limitation and SAM does not have any control over it. You have to hard-code AccountId and Region in APIGateway until this limitation is fixed. |
Is this changed yet ? I have the same issue. |
I believe it's still the same. We've resorted to using inline swagger definitions being as our APIs are fairly simple. |
@sanathkr Following the api_swagger_cors example (minus cors) I'm still seeing 'Invalid Arn' when creating the stack. Do we still need to hard code the account and region when using a separate swagger.yml file? |
+1, do we still have to in-line swagger? |
It seems swagger files referenced by
depending on exactly how you try - all somewhat lacking in clarity / line number of error. However there does appear to be a solution which doesn't involve inlining the swagger: this example template.yaml uses
and the accompanying example swagger.yaml contains substitutions which will be filled in with the relevant values. EDIT: turns out @dinvlad posted about this here already #8 (comment) see also https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html EDIT: see also aws/aws-cli#3454 which (I think) enables this to work for local files by auto-uploading them to s3 first |
Hi,
Is there a way that I'm missing to have a more dynamic URI to the lambda function defined in a swagger file.
I've tried passing in region and arn/accountId variables in the same way that the function name is passed in in this example but it never works, even though I've confirmed that the variables contain the correct values.
The error I keep getting in the cloudformation console is
Thanks for any advice
The text was updated successfully, but these errors were encountered: