Skip to content
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

Unable to use stageVariables from integrations #12

Open
henhal opened this issue Apr 7, 2022 · 3 comments
Open

Unable to use stageVariables from integrations #12

henhal opened this issue Apr 7, 2022 · 3 comments

Comments

@henhal
Copy link
Contributor

henhal commented Apr 7, 2022

I followed the example regarding usage of stageVariables from integrations:

      x-amazon-apigateway-integration:
        type: aws_proxy
        passthroughBehavior: when_no_match
        httpMethod: POST
        uri: ${stageVariables.LambdaArn}

But when I deploy, I get this:

An error occurred: ApiGatewayRestApi - Errors found during import:
  	Unable to put integration on 'POST' for resource at path '/test': Invalid ARN specified in the request

I've verified that LambdaArn is assigned as a stage variable.

If changing my integration to an absolute value, like arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:xxxxxyyyyzzz:function:test-api-dev/invocations, it works. And the stage variable has this exact value.

Any idea why referencing stageVariables does not work?

@yndlingsfar
Copy link
Owner

Hi henhal,
currently only http and http_proxy is supported

@mefengl
Copy link

mefengl commented Jan 4, 2023

Hello @henhal, I noticed that you had a need to use something like uri: ${stageVariables.LambdaArn} in the past. Have you found a solution to this? I am currently facing the same issue and am looking for a way to resolve it. Any updates or suggestions you have would be greatly appreciated.

@henhal
Copy link
Contributor Author

henhal commented Jan 4, 2023

@mefengl What works for me is something like this:

x-amazon-apigateway-integration: 
  type: aws_proxy 
  httpMethod: POST 
  uri: arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:583329677394:function:${stageVariables.LambdaName}/invocations

It didn't work when putting that entire string S a stage variable, only when building it like this, keeping everything up until function: outside the variable. No idea why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants