aws / aws/aws-sam-cli

Lambda Container Image support in SAM CLI invoke local

Open
#2,461 19 comments 4 reactions 0 assignees View on GitHub
maintainer/need-followup stage/needs-investigation
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:
Seems like `sam local invoke -t .cfr-template.yaml --no-event myfunc` does not work.

### Steps to reproduce:
create lambda with from local dockerfile and try to run sam local invoke

### Observed result:
```
2020-12-07 14:29:10,526 | Failed to download image with name 123456789012.dkr.ecr.us-west-2.localhost/aws-cdk/assets:rapid-1.13.1
2020-12-07 14:29:10,526 | Container was not created. Skipping deletion
2020-12-07 14:29:10,527 | Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': True, 'debugFlagProvided': True, 'region': 'us-west-2', 'commandName': 'sam local invoke', 'duration': 901, 'exitReason': 'DockerImagePullFailedException', 'exitCode': 1, 'requestId': '0b2dd4d8-261f-475d-acc0-811c986e4e8e', 'installationId': 'e2800af1-28a2-4757-8c89-097af3d3460d', 'sessionId': 'fd6eaa05-8e6c-4d9f-af64-983f77b1c7b3', 'executionEnvironment': 'CLI', 'pyversion': '3.8.6', 'samcliVersion': '1.13.1'}}]}
2020-12-07 14:29:11,016 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Could not find 123456789012.dkr.ecr.us-west-2.localhost/aws-cdk/assets:rapid-1.13.1 image locally and failed to pull it from docker.
```
That localhost in ECR path looks weird

### Expected result:
Function would execute locally

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

1. OS: Mac OS 11.0.1 (20B50)
2. `sam --version`: SAM CLI, version 1.13.1

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.