aws / aws/aws-sam-cli

`sam local start-api` does not produce any API's with nested stacks

Open
#3,306 30 comments 11 reactions 0 assignees View on GitHub
area/local/start-api area/nested-stacks maintainer/need-followup type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:

We are currently building our parent stack with nested stacks, each will have their own endpoints from our main API which is defined in the parent stack using a Swagger file and [referenced here](https://github.com/aws/serverless-application-model/issues/1337#issuecomment-863524763) and [discussed here](https://github.com/aws/serverless-application-model/issues/349#issuecomment-863634456).

Note: we are using `AWS::Serverless::API` as we need some of the security features for future integrations.

If I was to deploy this to our development and production environment it builds as expected.

However, when our developer's attempt to run the API Gateway locally, they get the following message: `Error: Template does not have any APIs connected to Lambda functions`. If we define Events in the nested stack, multiple API's are built upon deployment.

### Steps to reproduce:

template.yml - the parent stack
```yaml
Resources:
# Each Lambda function is defined by properties:
# https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
ClientFacingLambdaAPIGateway:
Type: AWS::Serverless::Api
Properties:
Name: !Sub "Client Facing Lambda API Gateway - ${STAGE}"
Cors:
AllowOrigin: "'*'"
AllowHeaders: "'*'"
StageName: !Sub ${STAGE}
TracingEnabled: true
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: ./resources/api/api.yaml

# Further nested stacks defined before
origoHub:
Type: AWS::Serverless::Application
Properties:
Location: ./resources/applications/origo-hub-functions.yaml
```

resources/applications/origo-hub-functions.yaml
```yaml
Resources:

# further resources defined before this
origoSwitch:
Type: AWS::Serverless::Function
Properties:
Handler: src/handlers/switch.switchInstruction
FunctionName: !Sub "${STAGE}-origo-hub-switch"
Timeout: 120
Policies:
- LambdaInvokePolicy:
FunctionName:
!Sub "${STAGE}-origo-hub-switch"

origoSwitchPermisssion:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt switch.Arn
Principal: apigateway.amazonaws.com

Outputs:
origoSwitchFunction:
Description: "Switch Function ARN"
Value: !GetAtt origoSwitch.Arn
```

resources/api/api.yaml
```
swagger: '2.0'
info:
version: '1.0'
title:
Ref: AWS::StackName
paths:
/origohub/switch:
post:
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub:
- >-
arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${origoSwitchFunction}/invocations
- origoSwitchFunction:
Fn::GetAtt:
- origohub
- Outputs.origoSwitchFunction
responses:
'200':
description: 'Success'

# More resources defined after.
```
### Observed result:

```
2021-09-27 14:43:19,501 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2021-09-27 14:43:19,502 | Using config file: samconfig.toml, config environment: default
2021-09-27 14:43:19,502 | Expand command line arguments to:
2021-09-27 14:43:19,502 | --template_file=/Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/template.yaml --host=0.0.0.0 --port=3000 --static_dir=public --layer_cache_basedir=/Users/marcus.rowland/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2021-09-27 14:43:19,613 | local start-api command is called
2021-09-27 14:43:19,634 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'CRYPTO': 'true', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': '', 'WebEndpoint': ''}
2021-09-27 14:43:19,664 | Unable to resolve property DefinitionBody: OrderedDict([('Fn::Transform', OrderedDict([('Name', 'AWS::Include'), ('Parameters', OrderedDict([('Location', '../../resources/api/api.yaml')]))]))]). Leaving as is.
2021-09-27 14:43:19,664 | 3 stacks found in the template
2021-09-27 14:43:19,729 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': ''}
2021-09-27 14:43:19,752 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,752 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,753 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,753 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,753 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,753 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,753 | 6 stacks found in the template
2021-09-27 14:43:19,773 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'ClarityWebPrefix': 'https://dev.'}
2021-09-27 14:43:19,796 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,796 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,796 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,797 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,797 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,797 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,797 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,797 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,797 | 7 stacks found in the template
2021-09-27 14:43:19,797 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'CRYPTO': 'true', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': '', 'WebEndpoint': ''}
2021-09-27 14:43:19,817 | Unable to resolve property DefinitionBody: OrderedDict([('Fn::Transform', OrderedDict([('Name', 'AWS::Include'), ('Parameters', OrderedDict([('Location', '../../resources/api/api.yaml')]))]))]). Leaving as is.
2021-09-27 14:43:19,817 | 3 resources found in the stack
2021-09-27 14:43:19,817 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': ''}
2021-09-27 14:43:19,838 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,838 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,839 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,839 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,839 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,839 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,839 | 6 resources found in the stack morningstar
2021-09-27 14:43:19,839 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'ClarityWebPrefix': 'https://dev.'}
2021-09-27 14:43:19,861 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,861 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,861 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,862 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,862 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,862 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,862 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,862 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,862 | 7 resources found in the stack origohub
2021-09-27 14:43:19,862 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'CRYPTO': 'true', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': '', 'WebEndpoint': ''}
2021-09-27 14:43:19,881 | Unable to resolve property DefinitionBody: OrderedDict([('Fn::Transform', OrderedDict([('Name', 'AWS::Include'), ('Parameters', OrderedDict([('Location', '../../resources/api/api.yaml')]))]))]). Leaving as is.
2021-09-27 14:43:19,882 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': ''}
2021-09-27 14:43:19,903 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,903 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,904 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,904 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,904 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,904 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,904 | Found Serverless function with name='buyListFundPerformance' and CodeUri='buyListFundPerformance'
2021-09-27 14:43:19,904 | --base-dir is not presented, adjusting uri buyListFundPerformance relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/morningstar/template.yaml
2021-09-27 14:43:19,904 | Found Serverless function with name='fundPerformanceGraph' and CodeUri='fundPerformanceGraph'
2021-09-27 14:43:19,904 | --base-dir is not presented, adjusting uri fundPerformanceGraph relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/morningstar/template.yaml
2021-09-27 14:43:19,904 | Found Serverless function with name='fundInfoTooltip' and CodeUri='fundInfoTooltip'
2021-09-27 14:43:19,904 | --base-dir is not presented, adjusting uri fundInfoTooltip relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/morningstar/template.yaml
2021-09-27 14:43:19,904 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'ClarityWebPrefix': 'https://dev.'}
2021-09-27 14:43:19,926 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,926 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,926 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,927 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:19,927 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:19,927 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,927 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,927 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:19,927 | Found Serverless function with name='receiveAlert' and CodeUri='receiveAlert'
2021-09-27 14:43:19,927 | --base-dir is not presented, adjusting uri receiveAlert relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/origohub/template.yaml
2021-09-27 14:43:19,928 | Found Serverless function with name='processDocument' and CodeUri='processDocument'
2021-09-27 14:43:19,928 | --base-dir is not presented, adjusting uri processDocument relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/origohub/template.yaml
2021-09-27 14:43:19,928 | Found Serverless function with name='origoSwitch' and CodeUri='origoSwitch'
2021-09-27 14:43:19,928 | --base-dir is not presented, adjusting uri origoSwitch relative to /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/origohub/template.yaml
2021-09-27 14:43:19,933 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'CRYPTO': 'true', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': '', 'WebEndpoint': ''}
2021-09-27 14:43:19,953 | Unable to resolve property DefinitionBody: OrderedDict([('Fn::Transform', OrderedDict([('Name', 'AWS::Include'), ('Parameters', OrderedDict([('Location', '../../resources/api/api.yaml')]))]))]). Leaving as is.
2021-09-27 14:43:19,953 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'CRYPTO': 'true', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': '', 'WebEndpoint': ''}
2021-09-27 14:43:19,972 | Unable to resolve property DefinitionBody: OrderedDict([('Fn::Transform', OrderedDict([('Name', 'AWS::Include'), ('Parameters', OrderedDict([('Location', '../../resources/api/api.yaml')]))]))]). Leaving as is.
2021-09-27 14:43:19,972 | Successfully parsed location from AWS::Include transform: ../../resources/api/api.yaml
2021-09-27 14:43:19,972 | Trying to download Swagger from ../../resources/api/api.yaml
2021-09-27 14:43:19,972 | Reading Swagger document from local file at /Users/marcus.rowland/Projects/clarity-clientaccessible-lambda/.aws-sam/build/../../resources/api/api.yaml
2021-09-27 14:43:19,994 | Resolved Sub intrinsic function: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${origoSwitchFunction}/invocations
2021-09-27 14:43:19,994 | Extracted Function ARN: ${origoSwitchFunction}
2021-09-27 14:43:19,994 | No Lambda function ARN defined for integration containing ARN ${origoSwitchFunction}
2021-09-27 14:43:19,994 | Lambda function integration not found in Swagger document at path='/origohub/switch' method='post'
2021-09-27 14:43:19,994 | Resolved Sub intrinsic function: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${receiveAlertFunction}/invocations
2021-09-27 14:43:19,994 | Extracted Function ARN: ${receiveAlertFunction}
2021-09-27 14:43:19,994 | No Lambda function ARN defined for integration containing ARN ${receiveAlertFunction}
2021-09-27 14:43:19,994 | Lambda function integration not found in Swagger document at path='/origohub/alert' method='post'
2021-09-27 14:43:19,994 | Resolved Sub intrinsic function: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${buyListFundPerformanceFunction}/invocations
2021-09-27 14:43:19,994 | Extracted Function ARN: ${buyListFundPerformanceFunction}
2021-09-27 14:43:19,994 | No Lambda function ARN defined for integration containing ARN ${buyListFundPerformanceFunction}
2021-09-27 14:43:19,994 | Lambda function integration not found in Swagger document at path='/morningstar/buylistfundperfomance' method='get'
2021-09-27 14:43:19,994 | Lambda function integration not found in Swagger document at path='/morningstar/buylistfundperfomance' method='options'
2021-09-27 14:43:19,994 | Resolved Sub intrinsic function: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${fundInfoTooltipFunction}/invocations
2021-09-27 14:43:19,994 | Extracted Function ARN: ${fundInfoTooltipFunction}
2021-09-27 14:43:19,994 | No Lambda function ARN defined for integration containing ARN ${fundInfoTooltipFunction}
2021-09-27 14:43:19,994 | Lambda function integration not found in Swagger document at path='/morningstar/fundinfotooltipdata' method='get'
2021-09-27 14:43:19,995 | Lambda function integration not found in Swagger document at path='/morningstar/fundinfotooltipdata' method='options'
2021-09-27 14:43:19,995 | Resolved Sub intrinsic function: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${fundPerformanceGraphFunction}/invocations
2021-09-27 14:43:19,995 | Extracted Function ARN: ${fundPerformanceGraphFunction}
2021-09-27 14:43:19,995 | No Lambda function ARN defined for integration containing ARN ${fundPerformanceGraphFunction}
2021-09-27 14:43:19,995 | Lambda function integration not found in Swagger document at path='/morningstar/fundperformancegraphdata' method='get'
2021-09-27 14:43:19,995 | Lambda function integration not found in Swagger document at path='/morningstar/fundperformancegraphdata' method='options'
2021-09-27 14:43:19,995 | Found '0' APIs in resource 'ClientFacingLambdaAPIGateway'
2021-09-27 14:43:19,995 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'IntranetWebPrefix': 'https://dev-intr.', 'ClarityWebPrefix': 'https://dev.', 'DBUSER': '', 'DBCLIENT': '', 'DBPASSWORD': '', 'DBDATABASE': '', 'DBHOST': '', 'DBPORT': ''}
2021-09-27 14:43:20,016 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,016 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,017 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,017 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['buyListFundPerformance', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,017 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundPerformanceGraph', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,017 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['fundInfoTooltip', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,017 | Found '0' API Events in Serverless function with name 'buyListFundPerformance'
2021-09-27 14:43:20,017 | Found '0' API Events in Serverless function with name 'fundPerformanceGraph'
2021-09-27 14:43:20,017 | Found '0' API Events in Serverless function with name 'fundInfoTooltip'
2021-09-27 14:43:20,017 | Collected default values for parameters: {'DEBUG': 'false', 'STAGE': 'dev', 'ClarityWebPrefix': 'https://dev.'}
2021-09-27 14:43:20,040 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:20,040 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:20,040 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,040 | Unable to resolve property queueName: OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])]). Leaving as is.
2021-09-27 14:43:20,040 | Unable to resolve property Resource: {'Fn::Sub': ['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': OrderedDict([('Fn::GetAtt', ['OrigoAWSSQSQueue', 'QueueName'])])}]}. Leaving as is.
2021-09-27 14:43:20,041 | Unable to resolve property FunctionName: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,041 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['origoSwitch', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,041 | Unable to resolve property Value: OrderedDict([('Fn::GetAtt', ['receiveAlert', 'Arn'])]). Leaving as is.
2021-09-27 14:43:20,041 | Found '0' API Events in Serverless function with name 'receiveAlert'
2021-09-27 14:43:20,041 | Found '0' API Events in Serverless function with name 'processDocument'
2021-09-27 14:43:20,041 | Found '0' API Events in Serverless function with name 'origoSwitch'
2021-09-27 14:43:20,041 | Removed duplicates from '0' Explicit APIs and '0' Implicit APIs to produce '0' APIs
2021-09-27 14:43:20,041 | 0 APIs found in the template
2021-09-27 14:43:20,046 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '5692639e-efb6-4d2e-a7a0-e47bdfee37db', 'installationId': '0abac36d-28de-45ba-a90c-d56e9a011c21', 'sessionId': '7c1c8e19-c987-41b2-80e0-af79ff1c9acf', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.12', 'samcliVersion': '1.31.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local start-api', 'duration': 544, 'exitReason': 'NoApisDefined', 'exitCode': 1}}]}
2021-09-27 14:43:20,735 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Template does not have any APIs connected to Lambda functions
```

### Expected result:

When I run `sam build` followed by `sam local start-api --host 0.0.0.0` I expect the API's that I have defined in my api.yaml file to be available locally.

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

1. OS: macOS Big Sur 11.6
2. `sam --version`: 1.31.0
3. AWS region: eu-west-1.

`Add --debug flag to command you are running`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.