Skip to content

Commit

Permalink
boto3 session issue layers & subs install (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaudharysaket authored Jun 7, 2024
1 parent 4062c63 commit b43f6a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions newrelic_lambda_cli/cli/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def register(group):
def install(ctx, **kwargs):
"""Install New Relic AWS Lambda Layers"""
input = LayerInstall(session=None, verbose=ctx.obj["VERBOSE"], **kwargs)

input = input._replace(
session=boto3.Session(
profile_name=input.aws_profile, region_name=input.aws_region
)
)
if input.aws_permissions_check:
permissions.ensure_layer_install_permissions(input)

Expand Down Expand Up @@ -181,7 +185,11 @@ def install(ctx, **kwargs):
def uninstall(ctx, **kwargs):
"""Uninstall New Relic AWS Lambda Layers"""
input = LayerUninstall(session=None, verbose=ctx.obj["VERBOSE"], **kwargs)

input = input._replace(
session=boto3.Session(
profile_name=input.aws_profile, region_name=input.aws_region
)
)
if input.aws_permissions_check:
permissions.ensure_layer_uninstall_permissions(input)

Expand Down
12 changes: 10 additions & 2 deletions newrelic_lambda_cli/cli/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def register(group):
def install(**kwargs):
"""Install New Relic AWS Lambda Log Subscriptions"""
input = SubscriptionInstall(session=None, **kwargs)

input = input._replace(
session=boto3.Session(
profile_name=input.aws_profile, region_name=input.aws_region
)
)
if input.aws_permissions_check:
permissions.ensure_subscription_install_permissions(input)

Expand Down Expand Up @@ -121,7 +125,11 @@ def install(**kwargs):
def uninstall(**kwargs):
"""Uninstall New Relic AWS Lambda Log Subscriptions"""
input = SubscriptionUninstall(session=None, **kwargs)

input = input._replace(
session=boto3.Session(
profile_name=input.aws_profile, region_name=input.aws_region
)
)
if input.aws_permissions_check:
permissions.ensure_subscription_uninstall_permissions(input)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="newrelic-lambda-cli",
version="0.9.1",
version="0.9.2",
python_requires=">=3.3",
description="A CLI to install the New Relic AWS Lambda integration and layers.",
long_description=README,
Expand Down

0 comments on commit b43f6a1

Please sign in to comment.