diff --git a/coveo-arnparse/coveo_arnparse/__init__.py b/coveo-arnparse/coveo_arnparse/__init__.py index 19eeae21..9e907fcf 100644 --- a/coveo-arnparse/coveo_arnparse/__init__.py +++ b/coveo-arnparse/coveo_arnparse/__init__.py @@ -41,14 +41,14 @@ class Arn: def resource_type(self) -> str: """ Some services provide 2 components in the resource, split on `:` or `/`. - Return the suffix, or an empty string otherwise. + Return the prefix, or an empty string otherwise. E.g.: - - "arn:aws:ssm:::parameter/some-param-folder/some-param -> some-param-folder/some-param - - "arn:aws:s3:::my-bucket/folder/file.jpg -> folder/file.jpg - - "arn:aws:cloudwatch:::alarm:some-alarm -> some-alarm - - "arn:aws:ec2:::vpc/vpc-12345 -> vpc-12345 - - 'arn:aws:sns:::my_sns_topic -> "" + - arn:aws:ssm:::parameter/some-param-folder/some-param -> parameter + - arn:aws:s3:::my-bucket/folder/file.jpg -> my-bucket + - arn:aws:cloudwatch:::alarm:some-alarm -> alarm + - arn:aws:ec2:::vpc/vpc-12345 -> vpc + - arn:aws:sns:::my_sns_topic -> "" """ return _split_resource_type_and_id(self.resource)[0] @@ -56,14 +56,14 @@ def resource_type(self) -> str: def resource_id(self) -> str: """ Some services provide 2 components in the resource, split on `:` or `/`. - Return the prefix, or an empty string otherwise. + Return the suffix, or an empty string otherwise. E.g.: - - arn:aws:ssm:::parameter/some-param-folder/some-param -> parameter - - arn:aws:s3:::my-bucket/folder/file.jpg -> my-bucket - - arn:aws:cloudwatch:::alarm:some-alarm -> alarm - - arn:aws:ec2:::vpc/vpc-12345 -> vpc - - arn:aws:sns:::my_sns_topic -> "" + - "arn:aws:ssm:::parameter/some-param-folder/some-param -> some-param-folder/some-param + - "arn:aws:s3:::my-bucket/folder/file.jpg -> folder/file.jpg + - "arn:aws:cloudwatch:::alarm:some-alarm -> some-alarm + - "arn:aws:ec2:::vpc/vpc-12345 -> vpc-12345 + - 'arn:aws:sns:::my_sns_topic -> "" """ return _split_resource_type_and_id(self.resource)[1]