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-3.0.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-3.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coveo_arnparse-3.0.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-3.0.tar.gz
Algorithm Hash digest
SHA256 931892badd4d3848b743d86992f675816b57d4195a8693971df0f06648eb9db9
MD5 de578711b2b3f302ece1edf53521eb15
BLAKE2b-256 960b1a90b8b73adbb6f5628f76bd8d5b2c654ea831841046ad96d803db2cab12

See more details on using hashes here.

Provenance

The following attestation bundles were made for coveo_arnparse-3.0.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-3.0-py3-none-any.whl.

File metadata

  • Download URL: coveo_arnparse-3.0-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-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d54b79a232c1b1fcdd367d39dbfa23e658ef9d2efc67e5e77a6ab9eea369f5dd
MD5 74c29c2fa23b114f9d1d38e93773d069
BLAKE2b-256 0f0dd0970adb3cfa0040e91babf163b1b0c8e9aef3cd34b459ec64267aea327f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coveo_arnparse-3.0-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