Poetry can be used with AWS CodeArtifact however it requires a command to be run in advance of any operation that communicates with the package source, for example poetry install
or poetry update
.
poetry config http-basic.myartifactrepo aws $(aws codeartifact get-authorization-token --domain mydomain --query authorizationToken --output text)
This command fetches the token and configures poetry to use it. The token has a 12 hour expiry, so this must be run periodically to refresh the token.
Does poetry expose a hook which can be configured to run this command automatically before communicating with the source?