Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

Conversation

ryanjfrizzell
Copy link

  • support AWS paths in role names
  • adjust RegEx to allow for this
  • minor docs updates for new home
  • minor version bump

small example of this working

from collections import namedtuple
import re

ROLE_ARN_REGEXP = re.compile(r"^arn:aws:iam::([0-9]{12}):role/([\w+=,.@-]+.*$)")
ParseResult = namedtuple("ArnParts", ["aws_account_id", "aws_role"])
normal = 'arn:aws:iam::584999999999:role/superNeatRole'
slashes = 'arn:aws:iam::584999999999:role/some/other/role/withSlashes'
def parse_arn(role_arn):
    return ParseResult(*ROLE_ARN_REGEXP.match(role_arn).groups())
print(type(ROLE_ARN_REGEXP))

print("###Normal")
normal_res = parse_arn(normal)
print(normal_res)

print("####Slashes")
slashes_res = parse_arn(slashes)
print(slashes_res)

output:

###Normal
ArnParts(aws_account_id='584999999999', aws_role='superNeatRole')
####Slashes
ArnParts(aws_account_id='584999999999', aws_role='some/other/role/withSlashes')

* support AWS paths in role names
* update documentation for new home
* minor version bump
@ryanjfrizzell ryanjfrizzell force-pushed the rf/feature/roles-and-docs branch from 0579a52 to 73a7dbb Compare March 4, 2021 21:35
Copy link

@ionosphere80 ionosphere80 left a comment

Choose a reason for hiding this comment

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

LGTM.

@ryanjfrizzell ryanjfrizzell merged commit b06b528 into main Mar 4, 2021
@ryanjfrizzell ryanjfrizzell deleted the rf/feature/roles-and-docs branch March 4, 2021 21:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants