I am defining my API Gateway APIs using AWS SAM
ApiGatewayApi:
Type: AWS::Serverless::Api
Properties:
DefinitionUri: swagger.yml
StageName: prod
Variables:
Region: !Ref AWS::Region
AccountId: !Ref AWS::AccountId
Ec2Index: !Ref Ec2Index
AuthLogin: !Ref AuthLogin
Ec2Patch: !Ref Ec2Patch
AutoScalingIndex: !Ref AutoScalingIndex
AutoScalingPatch: !Ref AutoScalingPatch
AutoScalingScale: !Ref AutoScalingScale
In my swagger file:
paths: /auth/session: post: produces: - application/json x-amazon-apigateway-integration: uri: arn:aws:apigateway:ap-southeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-1:598545985414:function:${stageVariables.AuthLogin}/invocations passthroughBehavior: when_no_match httpMethod: POST type: aws_proxy responses: 200: description: App token 401: description: 401 403: description: 403
AWS CloudFormation errors saying
Errors found during import: Unable to put integration on 'POST' for resource at path '/auth/session': Lambda function ARN must be in same account Unable to put integration on 'GET' for resource at path '/autoscaling': Lambda function ARN must be in same account Unable to put integration on 'PATCH' for resource at path '/autoscaling/{groupName}': Lambda function ARN must be in same account Unable to put integration on 'POST' for resource at path '/autoscaling/{groupName}/scale': Lambda function ARN must be in same account Unable to put integration on 'GET' for resource at path '/ec2': Lambda function ARN must be in same account Unable to put integration on 'PATCH' for resource at path '/ec2/{id}': Lambda function ARN must be in same account
Seems like my ARN is invalid. This is resolved once I remove the variables. Whats wrong here?