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

fix: Skips the runtime test when building in docker #362

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ Using this module you can install dependencies from private hosts. To do this, y

docker_with_ssh_agent = true

Note that by default, the `docker_image` used comes from the registry `public.ecr.aws/sam/`, and will be based on the `runtime` that you specify. In other words, if you specify a runtime of `python3.8` and do not specify `docker_image`, then the `docker_image` will resolve to `public.ecr.aws/sam/build-python3.8`. This ensures that by default the `runtime` is available in the docker container.

If you override `docker_image`, be sure to keep the image in sync with your `runtime`. During the plan phase, when using docker, there is no check that the `runtime` is available to build the package. That means that if you use an image that does not have the runtime, the plan will still succeed, but then the apply will fail.

## <a name="package"></a> Deployment package - Create or use existing

By default, this module creates deployment package and uses it to create or update Lambda Function or Lambda Layer.
Expand Down
4 changes: 2 additions & 2 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
raise RuntimeError(
'File not found: {}'.format(requirements))
else:
if not shutil.which(runtime):
if not query.docker and not shutil.which(runtime):
raise RuntimeError(
"Python interpreter version equal "
"to defined lambda runtime ({}) should be "
Expand All @@ -675,7 +675,7 @@ def npm_requirements_step(path, prefix=None, required=False, tmp_dir=None):
raise RuntimeError(
'File not found: {}'.format(requirements))
else:
if not shutil.which(runtime):
if not query.docker and not shutil.which(runtime):
raise RuntimeError(
"Nodejs interpreter version equal "
"to defined lambda runtime ({}) should be "
Expand Down