Skip to content

Fix: Ensure service-linked role names match AWS and prevent duplicate… #11731

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

Closed
wants to merge 1 commit into from

Conversation

Alansfit
Copy link

Fix: Ensure service-linked role names match AWS and prevent duplicates (#5249)

Motivation

This PR addresses issue #5249 by ensuring that service-linked role names match AWS's naming convention and preventing the creation of duplicate roles.

Changes

  • Updated the create_service_linked_role method to set the role name to AWSServiceRoleFor{aws_service_name.split('.')[0].capitalize()}.
  • Added a check to prevent the creation of duplicate roles by raising a CommonServiceException if a role with the same name already exists.

@pinzon pinzon added the semver: patch Non-breaking changes which can be included in patch releases label Oct 30, 2024
Copy link
Member

@pinzon pinzon left a comment

Choose a reason for hiding this comment

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

This is really good. It Could you add an integration test to avoid regressions in the future?

  • we should have a test to confirm the name generation structure
  • assert that the correct exception is returned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants