Skip to content
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

rdk deploy ignore[-g | --generated-lambda-layer] flag #492

Open
lktslionel opened this issue Apr 12, 2024 · 0 comments
Open

rdk deploy ignore[-g | --generated-lambda-layer] flag #492

lktslionel opened this issue Apr 12, 2024 · 0 comments

Comments

@lktslionel
Copy link

lktslionel commented Apr 12, 2024

BUG REPORT

SUMMARY

GIVEN

An existing lambda layer with the arn value:
An existing RDK rule created with the runtime: python3.11-lib
I use the flag to use the generated RDK lib lambda layer

WHEN

I run the following command:

rdk deploy --functions-only \
  --all --lambda-layers <powertools-lambda-layer-arn> -g
THEN

The resulting lambda only have as lambda layers thie one: .
The RDK lib lambda layer hasn't been added as a layer.

EXPECTED RESULT

The RDK lib lambda layer to be added as a layer.

DIAGNOSTIC AND PROPOSED SOLUTION

The issue come the following line

aws-config-rdk/rdk/rdk.py

Lines 4238 to 4239 in 9b9e990

if self.args.rdklib_layer_arn:
layers.append(self.args.rdklib_layer_arn)

May be it is better to call the __get_lambda_layers method, which will check for the right RDK lib arn to add only once, depending on the presence of the -g flag or not.

This solution comes with the benefits of defining the order of precedence when setting the RDK lin layer arn as follow:

  1. the one specified by the flag -g|--generated-lambda-layer
  2. The one specified by the flag --rdklib-layer-arn
  3. The default one from the non-lib runtimes

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant