Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6cd8ccd

Browse files
rubenfonsecaleandrodamascena
andauthoredDec 13, 2023
fix(docs): make the Lambda Layer version consistent (#3498)
* fix(docs): make the Lambda Layer version consistent * fix: arm64 and all runtimes * Update layer/scripts/layer-balancer/main.go Co-authored-by: Leandro Damascena <[email protected]> Signed-off-by: Ruben Fonseca <[email protected]> * Update layer/scripts/layer-balancer/main.go Co-authored-by: Leandro Damascena <[email protected]> Signed-off-by: Ruben Fonseca <[email protected]> --------- Signed-off-by: Ruben Fonseca <[email protected]> Co-authored-by: Leandro Damascena <[email protected]>
1 parent fcb4086 commit 6cd8ccd

File tree

5 files changed

+79
-79
lines changed

5 files changed

+79
-79
lines changed
 

‎docs/index.md

Lines changed: 70 additions & 70 deletions
Large diffs are not rendered by default.

‎examples/logger/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Globals:
1414
Layers:
1515
# Find the latest Layer version in the official documentation
1616
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
17-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:53
17+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:55
1818

1919
Resources:
2020
LoggerLambdaHandlerExample:

‎examples/metrics/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Globals:
1515
Layers:
1616
# Find the latest Layer version in the official documentation
1717
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
18-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:53
18+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:55
1919

2020
Resources:
2121
CaptureLambdaHandlerExample:

‎examples/tracer/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Globals:
1313
Layers:
1414
# Find the latest Layer version in the official documentation
1515
# https://docs.powertools.aws.dev/lambda/python/latest/#lambda-layer
16-
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:53
16+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:55
1717

1818
Resources:
1919
CaptureLambdaHandlerExample:

‎layer/scripts/layer-balancer/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"log"
88
"net/http"
99
"os"
@@ -172,7 +172,7 @@ func balanceRegionToVersion(ctx context.Context, region string, layer *LayerInfo
172172
ZipFile: payload,
173173
},
174174
LayerName: aws.String(layer.Name),
175-
CompatibleRuntimes: []types.Runtime{types.RuntimePython37, types.RuntimePython38, types.RuntimePython39},
175+
CompatibleRuntimes: []types.Runtime{types.RuntimePython37, types.RuntimePython38, types.RuntimePython39, types.RuntimePython310, types.RuntimePython311},
176176
Description: aws.String(layer.Description),
177177
LicenseInfo: aws.String("MIT-0"),
178178
})
@@ -183,7 +183,7 @@ func balanceRegionToVersion(ctx context.Context, region string, layer *LayerInfo
183183
},
184184
LayerName: aws.String(layer.Name),
185185
CompatibleArchitectures: []types.Architecture{layer.Architecture},
186-
CompatibleRuntimes: []types.Runtime{types.RuntimePython37, types.RuntimePython38, types.RuntimePython39},
186+
CompatibleRuntimes: []types.Runtime{types.RuntimePython37, types.RuntimePython38, types.RuntimePython39, types.RuntimePython310, types.RuntimePython311},
187187
Description: aws.String(layer.Description),
188188
LicenseInfo: aws.String("MIT-0"),
189189
})
@@ -197,7 +197,7 @@ func balanceRegionToVersion(ctx context.Context, region string, layer *LayerInfo
197197
LayerName: aws.String(layer.Name),
198198
Principal: aws.String("*"),
199199
StatementId: aws.String("PublicLayerAccess"),
200-
VersionNumber: layerVersionResponse.Version,
200+
VersionNumber: &layerVersionResponse.Version,
201201
})
202202
if err != nil {
203203
return fmt.Errorf("error making layer public: %w", err)
@@ -260,7 +260,7 @@ func downloadCanonicalLayerZip(ctx context.Context, layer *LayerInfo) ([]byte, e
260260
// Gets the Layer content URL from S3
261261
getLayerVersionResult, err := lambdaSvc.GetLayerVersion(ctx, &lambda.GetLayerVersionInput{
262262
LayerName: aws.String(layer.Name),
263-
VersionNumber: version,
263+
VersionNumber: &version,
264264
})
265265
if err != nil {
266266
innerErr = fmt.Errorf("error getting eu-central-1 layer download URL: %w", err)
@@ -275,7 +275,7 @@ func downloadCanonicalLayerZip(ctx context.Context, layer *LayerInfo) ([]byte, e
275275
}
276276
defer resp.Body.Close()
277277

278-
body, err := ioutil.ReadAll(resp.Body)
278+
body, err := io.ReadAll(resp.Body)
279279
if err != nil {
280280
innerErr = err
281281
}

0 commit comments

Comments
 (0)
Please sign in to comment.