Created
August 20, 2020 15:32
-
-
Save francoiscampbell/489f626f663952806d029df2ea85a4ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arn.elbv2 import TargetGroupArn | |
target_group_arn_str = ( | |
"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/foo-bar/abc123" | |
) | |
target_group_arn = TargetGroupArn(target_group_arn_str) | |
# use the ARN instance's __str__ to format the ARN back into a string | |
assert str(target_group_arn) == target_group_arn_str | |
# common attributes | |
assert target_group_arn.partition == "aws" | |
assert target_group_arn.service == "elasticloadbalancing" | |
assert target_group_arn.region == "us-east-1" | |
assert target_group_arn.account == "123456789012" | |
# attributes specific to the type of AWS resource | |
assert target_group_arn.name == "foo-bar" | |
assert target_group_arn.internal_id == "abc123" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment