Skip to content

add provided.al2023 integration tests #727

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

Merged
merged 1 commit into from
Nov 11, 2023
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ You can find the resulting zip file in `target/lambda/YOUR_PACKAGE/bootstrap.zip
$ aws lambda create-function --function-name rustTest \
--handler bootstrap \
--zip-file fileb://./target/lambda/basic/bootstrap.zip \
--runtime provided.al2 \ # Change this to provided.al if you would like to use Amazon Linux 1.
--runtime provided.al2023 \ # Change this to provided.al2 if you would like to use Amazon Linux 2 (or to provided.al for Amazon Linux 1).
--role arn:aws:iam::XXXXXXXXXXXXX:role/your_lambda_execution_role \
--environment Variables={RUST_BACKTRACE=1} \
--tracing-config Mode=Active
Expand Down Expand Up @@ -202,7 +202,7 @@ Resources:
MemorySize: 128
Architectures: ["arm64"]
Handler: bootstrap
Runtime: provided.al2
Runtime: provided.al2023
Timeout: 5
CodeUri: target/lambda/basic/

Expand Down
86 changes: 86 additions & 0 deletions lambda-integration-tests/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Globals:
Timeout: 5

Resources:
# Rust function using runtime_fn running on AL2023
RuntimeFnAl2023:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../build/runtime-fn/
Runtime: provided.al2023
Layers:
- !Ref LogsTrait
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using runtime_fn running on AL2
RuntimeFnAl2:
Type: AWS::Serverless::Function
Expand All @@ -30,6 +41,17 @@ Resources:
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using a Service implementation running on AL2023
RuntimeTraitAl2023:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../build/runtime-trait/
Runtime: provided.al2023
Layers:
- !Ref LogsTrait
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using a Service implementation running on AL2
RuntimeTraitAl2:
Type: AWS::Serverless::Function
Expand All @@ -52,6 +74,38 @@ Resources:
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using lambda_http::service_fn running on AL2023
HttpFnAl2023:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../build/http-fn/
Runtime: provided.al2023
Events:
ApiGet:
Type: Api
Properties:
Method: GET
Path: /al2/get
ApiPost:
Type: Api
Properties:
Method: POST
Path: /al2/post
ApiV2Get:
Type: HttpApi
Properties:
Method: GET
Path: /al2/get
ApiV2Post:
Type: HttpApi
Properties:
Method: POST
Path: /al2/post
Layers:
- !Ref LogsTrait
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using lambda_http::service_fn running on AL2
HttpFnAl2:
Type: AWS::Serverless::Function
Expand Down Expand Up @@ -84,6 +138,38 @@ Resources:
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using lambda_http with Service running on AL2023
HttpTraitAl2023:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../build/http-trait/
Runtime: provided.al2023
Events:
ApiGet:
Type: Api
Properties:
Method: GET
Path: /al2-trait/get
ApiPost:
Type: Api
Properties:
Method: POST
Path: /al2-trait/post
ApiV2Get:
Type: HttpApi
Properties:
Method: GET
Path: /al2-trait/get
ApiV2Post:
Type: HttpApi
Properties:
Method: POST
Path: /al2-trait/post
Layers:
- !Ref LogsTrait
- !Ref ExtensionFn
- !Ref ExtensionTrait

# Rust function using lambda_http with Service running on AL2
HttpTraitAl2:
Type: AWS::Serverless::Function
Expand Down