Skip to content

Commit

Permalink
chore(lambda-go-alpha): update docker base image (aws#31766)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change


The `build-go` [image](https://gallery.ecr.aws/sam/build-go1.x) is [depracated](aws/aws-sam-build-images#139).

### Description of changes



As recommended in [this announcement](https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/), migrating the base image of `aws-lambda-go-alpha` integration test dockerfile base image to `al2023`.

Additionally, an assertion was added to test the lambda function invocation. This is a custom lambda runtime, as previouse comment noted, the [aws-lambda-go](https://github.com/aws/aws-lambda-go) runtime package is not available.


### Description of how you validated changes

- `yarn integ-runner --directory packages/@aws-cdk/aws-lambda-go-alpha`



### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
5d authored Oct 17, 2024
1 parent 0260046 commit cf63e90
Show file tree
Hide file tree
Showing 27 changed files with 71,740 additions and 78 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-go-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ new go.GoFunction(this, 'handler', {

## Local Bundling

If `Go` is installed locally and the version is >= `go1.11` then it will be used to bundle your code in your environment. Otherwise, bundling will happen in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-go1.x) with the Docker platform based on the target architecture of the Lambda function.
If `Go` is installed locally and the version is >= `go1.11` then it will be used to bundle your code in your environment. Otherwise, bundling will happen in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-provided.al2023) with the Docker platform based on the target architecture of the Lambda function.

For macOS the recommended approach is to install `Go` as Docker volume performance is really poor.

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-go-alpha/lib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The correct AWS SAM build image based on the runtime of the function will be
# passed as build arg. The default allows to do `docker build .` when testing.
ARG IMAGE=public.ecr.aws/sam/build-go1.x
ARG IMAGE=public.ecr.aws/sam/build-provided.al2023
FROM $IMAGE

# set the GOCACHE
Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit cf63e90

Please sign in to comment.