Skip to main content

arn

A Python library for parsing AWS ARNs.

Installation

To install, just run

pip install arn

or add the library to your setup.py / requirements.txt.

Usage

Given an ARN for a particular AWS resource, parse it with the appropriate class:

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.id == "abc123"

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

arn-0.1.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file arn-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: arn-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for arn-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6028b6accd2a240f1870abdf884b738a86a6ff25f40c9560841f30ebdddc59
MD5 d7137db2e609bfd001d7e3c7b1a1aa58
BLAKE2b-256 e0fa0642d983561d060eb394a6beae3eb4da19642e51b89055c67a3a824b7f18

See more details on using hashes here.

Supported by

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