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

fix: #242 ensuring alias is set or raise error. #465

Merged
merged 7 commits into from
Aug 12, 2022
Merged

fix: #242 ensuring alias is set or raise error. #465

merged 7 commits into from
Aug 12, 2022

Conversation

javydekoning
Copy link
Contributor

Issue #, if available:
#242

Description of changes:

  • Ensuring an error is raised if the account alias is non-unique.
  • Update the readme.md to reflect that.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Test execution (SHOULD error):

2022-04-03 13:17:47,547 \| ERROR \| configure_account_alias \| The account alias security already exists. The account alias must be unique across all Amazon Web Services products. Refer to https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html#AboutAccountAlias \| (configure_account_alias.py:26)
--
[ERROR] EntityAlreadyExistsException: An error occurred (EntityAlreadyExists) when calling the CreateAccountAlias operation: The account alias security already exists.Traceback (most recent call last):  File "/var/task/configure_account_alias.py", line 42, in lambda_handler    create_account_alias(event, role.client("iam"))  File "/var/task/configure_account_alias.py", line 30, in create_account_alias    raise error  File "/var/task/configure_account_alias.py", line 24, in create_account_alias    iam_client.create_account_alias(AccountAlias=account.get("alias"))  File "/var/task/botocore/client.py", line 401, in _api_call    return self._make_api_call(operation_name, kwargs)  File "/var/task/aws_xray_sdk/ext/botocore/patch.py", line 38, in _xray_traced_botocore    return xray_recorder.record_subsegment(  File "/var/task/aws_xray_sdk/core/recorder.py", line 435, in record_subsegment    return_value = wrapped(*args, **kwargs)  File "/var/task/botocore/client.py", line 731, in _make_api_call    raise error_class(parsed_response, operation_name)

StewartW
StewartW previously approved these changes Apr 7, 2022
@StewartW
Copy link
Contributor

StewartW commented Apr 7, 2022

@javydekoning Can you add a test for this exception too please

@javydekoning
Copy link
Contributor Author

@StewartW yes, I've added a test. Thanks for reviewing!

StewartW
StewartW previously approved these changes Apr 7, 2022
@sbkok sbkok added this to the v3.2.0 milestone May 20, 2022
Copy link
Collaborator

@sbkok sbkok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@hgrgic hgrgic self-requested a review August 11, 2022 13:31
@sbkok sbkok merged commit 063bd19 into awslabs:master Aug 12, 2022
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

Successfully merging this pull request may close these issues.

3 participants