aws / aws/aws-cdk

aws-codeartifact: CodeArtifact from lookup to get auth token and url

Open
#27,511 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-codeartifact effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the feature

Ability to get CodeArtifact using a `fromLookup` function like [`Vpc.fromLookup`](https://github.com/aws/aws-cdk/blob/d8965fc57712e1cbc8eae3f0586c94b64a8a2b02/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts#L1264) and others.

### Use Case

Currently the [docs exmaple](https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_lambda_python_alpha/README.html#custom-bundling-with-code-artifact) to get a CodeArtifact AuthToken is encouraging the use of `aws-cli` as an external process call. It is cleaner to use current CDK context credentials.

This could be used for any bundling Construct like `PythonFunction` that may need access to a private CodeArtifact repository to fetch packages.

### Proposed Solution

I propose to implement this in the same way that other `fromLookup` resources are implemented currently.

### Other Information

If you think this solution is fine. I can code it and create a pull request.

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.100.0

### Environment details (OS name and version, etc.)

All supported OS

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked Vpc.fromLookup implementation in packages/aws-cdk-lib/aws-ec2/lib/vpc.ts and the CodeArtifact bundling example in the AWS Lambda Python README. Determine the lookup inputs and returned authentication token and URL needed for private repositories. Done means a CDK-based alternative to the documented aws-cli call is available for bundling constructs such as PythonFunction.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.