aws / aws/aws-cli

Add extra-index-url support for CodeArtifact login with --tool pip

Open
#5,409 32 comments 68 reactions 0 assignees View on GitHub
codeartifact login customization feature-request p2 ready-for-review
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

**Is your feature request related to a problem? Please describe.**
Running `aws codeartifact login --tool pip ...` overrides the default index url (pypi.org), which becomes an issue if CodeArtifact becomes out of sync (a separate issue)

**Describe the solution you'd like**
Add an `--extra-index-url` flag to put the CodeArtifact URL in (only necessary for `--tool pip`)

Should be as easy as changing `global.index-url` to `global.extra-index-url` if the flag is passed: https://github.com/aws/aws-cli/blob/develop/awscli/customizations/codeartifact/login.py#L157

**Describe alternatives you've considered**
Currently setting the url "manually":
```bash
CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token --domain ... --domain-owner ... --query authorizationToken --output text)
pip config set global.extra-index-url https://aws:$CODEARTIFACT_TOKEN@...-....d.codeartifact.us-east-1.amazonaws.com/pypi/.../simple/
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.