Skip to content

Commit

Permalink
add provided.al2023 integration tests (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxday authored Nov 11, 2023
1 parent 8cdedc0 commit 636df70
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 2 deletions.
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

0 comments on commit 636df70

Please sign in to comment.