Skip to main content

Parse an arn in multiple components.

Project description

coveo-arnparse

Simple dataclass and parser around Amazon Resource Names (ARNs).

Ref: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

Usage

Parse from a string

>>> from coveo_arnparse import arnparse
>>> arn = arnparse("arn:aws:sns:us-east-1:123456789012:my_topic")
>>> repr(arn)
Arn(partition='aws', service='sns', region='us-east-1', account='123456789012', resource='my_topic')
>>> str(arn)
"arn:aws:sns:us-east-1:123456789012:my_topic"
>>> arn.resource_type
''
>>> arn.resource_id
''

When a : or a / is in the resource, you can also obtain either parts:

>>> from coveo_arnparse import arnparse
>>> arn = arnparse("arn:aws:ssm:us-east-1:123456789012:parameter/path/key")
>>> arn.resource_type
'parameter'
>>> arn.resource_id
'path/key'
>>> arn.resource
'parameter/path/key'

Create an instance directly

>>> from coveo_arnparse import Arn
>>> Arn(service="s3", resource="my_bucket/path/file.jpg")
Arn(partition='aws', service='s3', region='', account='', resource='my_bucket/path/file.jpg')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coveo_arnparse-2.0.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coveo_arnparse-2.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file coveo_arnparse-2.0.1.tar.gz.

File metadata

  • Download URL: coveo_arnparse-2.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coveo_arnparse-2.0.1.tar.gz
Algorithm Hash digest
SHA256 030de577aa95427639c6136804e18c060fd135ab5036f654fe2af25b6ce350b6
MD5 0d9415a00eea29c1406688a1954669ea
BLAKE2b-256 d55b2198ab71151506bbd79865f2be2a9e0704b2179c8d4e01592f1b1edd288f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coveo_arnparse-2.0.1.tar.gz:

Publisher: coveo-arnparse.yml on coveooss/coveo-python-oss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coveo_arnparse-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: coveo_arnparse-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coveo_arnparse-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bce51ffa814cde1ab63e808bb3bb3046f74cdef73432c77405bb4fb58de68f0
MD5 7579f4879f99e20cba8c51f32be3d796
BLAKE2b-256 87dc9195c5af5d2ad3c8cd63f94e7b927617f6c8e67da8d27d941b6c47797078

See more details on using hashes here.

Provenance

The following attestation bundles were made for coveo_arnparse-2.0.1-py3-none-any.whl:

Publisher: coveo-arnparse.yml on coveooss/coveo-python-oss

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page