Skip to content

Commit

Permalink
Revert "Increase Boto assumeRole duration to 6 hours (#814)" (#817)
Browse files Browse the repository at this point in the history
This reverts commit 866db5a.
  • Loading branch information
omkhegde authored Sep 2, 2021
1 parent f53256c commit 2f1269c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/rpdk/core/boto_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_temporary_credentials(session, key_names=BOTO_CRED_KEYS, role_arn=None):
)
try:
response = sts_client.assume_role(
RoleArn=role_arn, RoleSessionName=session_name, DurationSeconds=21600
RoleArn=role_arn, RoleSessionName=session_name, DurationSeconds=900
)
except ClientError:
# pylint: disable=W1201
Expand All @@ -64,7 +64,7 @@ def get_temporary_credentials(session, key_names=BOTO_CRED_KEYS, role_arn=None):
creds = (frozen.access_key, frozen.secret_key, frozen.token)
else:
try:
response = sts_client.get_session_token(DurationSeconds=21600)
response = sts_client.get_session_token(DurationSeconds=900)
except ClientError as e:
LOG.debug(
"Getting session token resulted in unknown ClientError", exc_info=e
Expand Down
8 changes: 4 additions & 4 deletions tests/test_boto_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_get_temporary_credentials_needs_token():
endpoint_url="https://sts.us-east-2.amazonaws.com",
region_name="us-east-2",
)
client.get_session_token.assert_called_once_with(DurationSeconds=21600)
client.get_session_token.assert_called_once_with(DurationSeconds=900)

assert len(creds) == 3
assert tuple(creds.keys()) == LOWER_CAMEL_CRED_KEYS
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_get_temporary_credentials_invalid_credentials():
endpoint_url="https://sts.us-east-2.amazonaws.com",
region_name="us-east-2",
)
client.get_session_token.assert_called_once_with(DurationSeconds=21600)
client.get_session_token.assert_called_once_with(DurationSeconds=900)


def test_get_temporary_credentials_assume_role_fails():
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_get_temporary_credentials_assume_role_fails():
region_name="us-east-2",
)
client.assume_role.assert_called_once_with(
RoleArn=EXPECTED_ROLE, RoleSessionName=ANY, DurationSeconds=21600
RoleArn=EXPECTED_ROLE, RoleSessionName=ANY, DurationSeconds=900
)


Expand Down Expand Up @@ -192,7 +192,7 @@ def test_get_temporary_credentials_assume_role():
region_name="cn-north-1",
)
client.assume_role.assert_called_once_with(
RoleArn=EXPECTED_ROLE, RoleSessionName=ANY, DurationSeconds=21600
RoleArn=EXPECTED_ROLE, RoleSessionName=ANY, DurationSeconds=900
)

assert len(creds) == 3
Expand Down

0 comments on commit 2f1269c

Please sign in to comment.