@@ -58,10 +58,10 @@ Let's configure our base application to look like the following code snippet.
58
58
- x86_64
59
59
Events:
60
60
HelloWorld:
61
- Type: Api
62
- Properties:
63
- Path: /hello
64
- Method: get
61
+ Type: Api
62
+ Properties:
63
+ Path: /hello
64
+ Method: get
65
65
Outputs:
66
66
HelloWorldApi:
67
67
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
@@ -142,36 +142,35 @@ One approach is to create another lambda with required method and set up the API
142
142
```yaml hl_lines="21-32"
143
143
AWSTemplateFormatVersion: "2010-09-09"
144
144
Transform: AWS::Serverless-2016-10-31
145
- Description: >
146
- Sample SAM Template for powertools-quickstart
145
+ Description: Sample SAM Template for powertools-quickstart
147
146
Globals:
148
147
Function:
149
148
Timeout: 3
150
149
Resources:
151
150
HelloWorldFunction:
152
151
Type: AWS::Serverless::Function
153
152
Properties:
154
- CodeUri: hello_world/
155
- Handler: app.lambda_handler
156
- Runtime: python3.9
157
- Events:
158
- HelloWorld:
159
- Type: Api
160
- Properties:
161
- Path: /hello
162
- Method: get
153
+ CodeUri: hello_world/
154
+ Handler: app.lambda_handler
155
+ Runtime: python3.9
156
+ Events:
157
+ HelloWorld:
158
+ Type: Api
159
+ Properties:
160
+ Path: /hello
161
+ Method: get
163
162
HelloWorldFunctionName:
164
163
Type: AWS::Serverless::Function
165
164
Properties:
166
- CodeUri: hello_world/
167
- Handler: app_name.lambda_handler
168
- Runtime: python3.9
169
- Events:
170
- HelloWorldName:
171
- Type: Api
172
- Properties:
173
- Path: /hello/{name}
174
- Method: get
165
+ CodeUri: hello_world/
166
+ Handler: app_name.lambda_handler
167
+ Runtime: python3.9
168
+ Events:
169
+ HelloWorldName:
170
+ Type: Api
171
+ Properties:
172
+ Path: /hello/{name}
173
+ Method: get
175
174
Outputs:
176
175
HelloWorldApi:
177
176
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
@@ -233,11 +232,10 @@ The simple code might look similar to the following code snippet.
233
232
```yaml hl_lines="15-25"
234
233
AWSTemplateFormatVersion: "2010-09-09"
235
234
Transform: AWS::Serverless-2016-10-31
236
- Description: >
237
- Sample SAM Template for powertools-quickstart
235
+ Description: Sample SAM Template for powertools-quickstart
238
236
Globals:
239
237
Function:
240
- Timeout: 3
238
+ Timeout: 3
241
239
Resources:
242
240
HelloWorldFunction:
243
241
Type: AWS::Serverless::Function
@@ -249,13 +247,13 @@ The simple code might look similar to the following code snippet.
249
247
HelloWorld:
250
248
Type: Api
251
249
Properties:
252
- Path: /hello
253
- Method: get
250
+ Path: /hello
251
+ Method: get
254
252
HelloWorldName:
255
253
Type: Api
256
254
Properties:
257
- Path: /hello/{name}
258
- Method: get
255
+ Path: /hello/{name}
256
+ Method: get
259
257
Outputs:
260
258
HelloWorldApi:
261
259
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
@@ -480,11 +478,10 @@ Let's first explore how we can achieve this with [x-ray SDK](https://docs.aws.am
480
478
```yaml hl_lines="15"
481
479
AWSTemplateFormatVersion: "2010-09-09"
482
480
Transform: AWS::Serverless-2016-10-31
483
- Description: >
484
- Sample SAM Template for powertools-quickstart
481
+ Description: Sample SAM Template for powertools-quickstart
485
482
Globals:
486
- Function:
487
- Timeout: 3
483
+ Function:
484
+ Timeout: 3
488
485
Resources:
489
486
HelloWorldFunction:
490
487
Type: AWS::Serverless::Function
@@ -495,15 +492,15 @@ Let's first explore how we can achieve this with [x-ray SDK](https://docs.aws.am
495
492
Tracing: Active
496
493
Events:
497
494
HelloWorld:
498
- Type: Api
499
- Properties:
500
- Path: /hello
501
- Method: get
495
+ Type: Api
496
+ Properties:
497
+ Path: /hello
498
+ Method: get
502
499
HelloWorldName:
503
- Type: Api
504
- Properties:
505
- Path: /hello/{name}
506
- Method: get
500
+ Type: Api
501
+ Properties:
502
+ Path: /hello/{name}
503
+ Method: get
507
504
Outputs:
508
505
HelloWorldApi:
509
506
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
@@ -643,32 +640,31 @@ Let's expand our application with custom metrics without Powertools to see how i
643
640
```yaml hl_lines="27 28"
644
641
AWSTemplateFormatVersion: "2010-09-09"
645
642
Transform: AWS::Serverless-2016-10-31
646
- Description: >
647
- Sample SAM Template for powertools-quickstart
643
+ Description: Sample SAM Template for powertools-quickstart
648
644
Globals:
649
645
Function:
650
646
Timeout: 3
651
647
Resources:
652
648
HelloWorldFunction:
653
649
Type: AWS::Serverless::Function
654
650
Properties:
655
- CodeUri: hello_world/
656
- Handler: app.lambda_handler
657
- Runtime: python3.9
658
- Tracing: Active
659
- Events:
660
- HelloWorld:
661
- Type: Api
662
- Properties:
663
- Path: /hello
664
- Method: get
665
- HelloWorldName:
666
- Type: Api
667
- Properties:
668
- Path: /hello/{name}
669
- Method: get
670
- Policies:
671
- - CloudWatchPutMetricPolicy: {}
651
+ CodeUri: hello_world/
652
+ Handler: app.lambda_handler
653
+ Runtime: python3.9
654
+ Tracing: Active
655
+ Events:
656
+ HelloWorld:
657
+ Type: Api
658
+ Properties:
659
+ Path: /hello
660
+ Method: get
661
+ HelloWorldName:
662
+ Type: Api
663
+ Properties:
664
+ Path: /hello/{name}
665
+ Method: get
666
+ Policies:
667
+ - CloudWatchPutMetricPolicy: {}
672
668
Outputs:
673
669
HelloWorldApi:
674
670
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
0 commit comments