Skip to content

Commit 636df70

Browse files
authored
add provided.al2023 integration tests (awslabs#727)
1 parent 8cdedc0 commit 636df70

File tree

2 files changed

+88
-2
lines changed

2 files changed

+88
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ You can find the resulting zip file in `target/lambda/YOUR_PACKAGE/bootstrap.zip
162162
$ aws lambda create-function --function-name rustTest \
163163
--handler bootstrap \
164164
--zip-file fileb://./target/lambda/basic/bootstrap.zip \
165-
--runtime provided.al2 \ # Change this to provided.al if you would like to use Amazon Linux 1.
165+
--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).
166166
--role arn:aws:iam::XXXXXXXXXXXXX:role/your_lambda_execution_role \
167167
--environment Variables={RUST_BACKTRACE=1} \
168168
--tracing-config Mode=Active
@@ -202,7 +202,7 @@ Resources:
202202
MemorySize: 128
203203
Architectures: ["arm64"]
204204
Handler: bootstrap
205-
Runtime: provided.al2
205+
Runtime: provided.al2023
206206
Timeout: 5
207207
CodeUri: target/lambda/basic/
208208

lambda-integration-tests/template.yaml

+86
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ Globals:
88
Timeout: 5
99

1010
Resources:
11+
# Rust function using runtime_fn running on AL2023
12+
RuntimeFnAl2023:
13+
Type: AWS::Serverless::Function
14+
Properties:
15+
CodeUri: ../build/runtime-fn/
16+
Runtime: provided.al2023
17+
Layers:
18+
- !Ref LogsTrait
19+
- !Ref ExtensionFn
20+
- !Ref ExtensionTrait
21+
1122
# Rust function using runtime_fn running on AL2
1223
RuntimeFnAl2:
1324
Type: AWS::Serverless::Function
@@ -30,6 +41,17 @@ Resources:
3041
- !Ref ExtensionFn
3142
- !Ref ExtensionTrait
3243

44+
# Rust function using a Service implementation running on AL2023
45+
RuntimeTraitAl2023:
46+
Type: AWS::Serverless::Function
47+
Properties:
48+
CodeUri: ../build/runtime-trait/
49+
Runtime: provided.al2023
50+
Layers:
51+
- !Ref LogsTrait
52+
- !Ref ExtensionFn
53+
- !Ref ExtensionTrait
54+
3355
# Rust function using a Service implementation running on AL2
3456
RuntimeTraitAl2:
3557
Type: AWS::Serverless::Function
@@ -52,6 +74,38 @@ Resources:
5274
- !Ref ExtensionFn
5375
- !Ref ExtensionTrait
5476

77+
# Rust function using lambda_http::service_fn running on AL2023
78+
HttpFnAl2023:
79+
Type: AWS::Serverless::Function
80+
Properties:
81+
CodeUri: ../build/http-fn/
82+
Runtime: provided.al2023
83+
Events:
84+
ApiGet:
85+
Type: Api
86+
Properties:
87+
Method: GET
88+
Path: /al2/get
89+
ApiPost:
90+
Type: Api
91+
Properties:
92+
Method: POST
93+
Path: /al2/post
94+
ApiV2Get:
95+
Type: HttpApi
96+
Properties:
97+
Method: GET
98+
Path: /al2/get
99+
ApiV2Post:
100+
Type: HttpApi
101+
Properties:
102+
Method: POST
103+
Path: /al2/post
104+
Layers:
105+
- !Ref LogsTrait
106+
- !Ref ExtensionFn
107+
- !Ref ExtensionTrait
108+
55109
# Rust function using lambda_http::service_fn running on AL2
56110
HttpFnAl2:
57111
Type: AWS::Serverless::Function
@@ -84,6 +138,38 @@ Resources:
84138
- !Ref ExtensionFn
85139
- !Ref ExtensionTrait
86140

141+
# Rust function using lambda_http with Service running on AL2023
142+
HttpTraitAl2023:
143+
Type: AWS::Serverless::Function
144+
Properties:
145+
CodeUri: ../build/http-trait/
146+
Runtime: provided.al2023
147+
Events:
148+
ApiGet:
149+
Type: Api
150+
Properties:
151+
Method: GET
152+
Path: /al2-trait/get
153+
ApiPost:
154+
Type: Api
155+
Properties:
156+
Method: POST
157+
Path: /al2-trait/post
158+
ApiV2Get:
159+
Type: HttpApi
160+
Properties:
161+
Method: GET
162+
Path: /al2-trait/get
163+
ApiV2Post:
164+
Type: HttpApi
165+
Properties:
166+
Method: POST
167+
Path: /al2-trait/post
168+
Layers:
169+
- !Ref LogsTrait
170+
- !Ref ExtensionFn
171+
- !Ref ExtensionTrait
172+
87173
# Rust function using lambda_http with Service running on AL2
88174
HttpTraitAl2:
89175
Type: AWS::Serverless::Function

0 commit comments

Comments
 (0)