Skip to content

Commit

Permalink
fix: Skips the runtime test when building in docker (#362)
Browse files Browse the repository at this point in the history
Co-authored-by: Allan Benson <[email protected]>
  • Loading branch information
lorengordon and AllanBenson001 authored Oct 21, 2022
1 parent adf6ea7 commit 2055256
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit 2055256

Please sign in to comment.