A poetry plugin to help with AWS CodeArtifact authorization automatically
Project description
Poetry AWS Plugin
This is a poetry plugin to help with AWS CodeArtifact authorization by automatically getting the authorization token.
The plugin will try two methods of authorization, in this order:
- Use AWS credentials to run
codeartifact.GetAuthorizationToken
. - Use AWS credentials to run
sts.AssumeRole
, then use that role to runcodeartifact.GetAuthorizationToken
.
Installation
To install the plugin
poetry self add poetry-aws-plugin
To uninstall the plugin
poetry self remove poetry-aws-plugin
Usage
You must ensure that your AWS credentials are configured and discoverable by boto3
. The boto3
documentation has details on how to configure your credentials and the order in which they searched.
When poetry runs a command that uses CodeArtifact and fails to authorize, the plugin will automatically attempt to get the authorization token and retry the command.
Your AWS credentials must be authorized to do atleast one of the following:
- Run
codeartifact.GetAuthorizationToken
. - Run
sts.AssumeRole
to assume a role with authorization to runcodeartifact.GetAuthorizationToken
.
If you are use IAM roles, set the environment variable POETRY_AWS_PLUGIN_ROLE_ARN
to the role's ARN before running any poetry commands.
For example:
export POETRY_AWS_PLUGIN_ROLE_ARN='arn:aws:codeartifact:<region>:<account-id>:repository/<domain>/<domain-owner>/<repository>'
poetry install
or
echo "export POETRY_AWS_PLUGIN_ROLE_ARN='arn:aws:codeartifact:<region>:<account-id>:repository/<domain>/<domain-owner>/<repository>'" >> ~/.bashrc
source ~/.bashrc
poetry install
You can find more details in AWS's CodeArtifact authentication and tokens documentation and CodeArtifact IAM documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file poetry_aws_plugin-0.1.0.tar.gz
.
File metadata
- Download URL: poetry_aws_plugin-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d56386000fb596ea1bfd6ebe933a7576f4c18dd64c7b3a782fa656cf5d8874 |
|
MD5 | c16286eaf6de7d7cb54d22e861368e2c |
|
BLAKE2b-256 | f918de3666c0f0c6ea891d58c214210fbb0ecf1f3e81cbd02baffa4c921cdf79 |
File details
Details for the file poetry_aws_plugin-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: poetry_aws_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6979fc8a1ee4e209b71eadc11d900caf32923b5f05e28205c52291ec63bae397 |
|
MD5 | 7ec20f02fd7e63f84f9f07b2126a6f78 |
|
BLAKE2b-256 | 04cf27d40554c98f172f8d7d0446bd8dd9659cd1a40ce92ab04f9f3a9a311902 |