From 3470b240256af2be641998fc68f28fbaf1e86ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 11:58:20 +0200 Subject: [PATCH 01/16] add codeartifact docs --- .vscode/settings.json | 1 + .../coverage/coverage_codeartifact/index.md | 2 +- .../en/user-guide/aws/codeartifact/index.md | 246 ++++++++++++++++++ 3 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 content/en/user-guide/aws/codeartifact/index.md diff --git a/.vscode/settings.json b/.vscode/settings.json index 114284e3ac..5691b09b86 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "awslocal", + "codeartifact", "quickstart" ] } \ No newline at end of file diff --git a/content/en/references/coverage/coverage_codeartifact/index.md b/content/en/references/coverage/coverage_codeartifact/index.md index 827d551979..f7c5f88ce1 100644 --- a/content/en/references/coverage/coverage_codeartifact/index.md +++ b/content/en/references/coverage/coverage_codeartifact/index.md @@ -1,5 +1,5 @@ --- -title: "codeartifact" +title: "CodeArtifact" linkTitle: "codeartifact" description: > Implementation details for API codeartifact diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md new file mode 100644 index 0000000000..448bfbc2d9 --- /dev/null +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -0,0 +1,246 @@ +--- +title: CodeArtifact +linkTitle: CodeArtifact +description: > + Get started with CodeArtifact on LocalStack +tags: ["Pro image"] +--- + +## Introduction + +CodeArtifact is a fully managed artifact repository service that makes it easy to securely store, publish, and share software packages used in your development process. + +On AWS, CodeArtifact supports common package formats such as Maven, npm, Python (pip), and NuGet. You can configure it to work with public repositories or use it to store your private packages. + +LocalStack provides mocking support for several CodeArtifact API operations. +You can find supported operations on the [API coverage page]({{< ref "coverage_codeartifact" >}}). + +## Getting Started + +This guide will help you create a domain, repository, and manage package publishing workflows using the `awslocal` CLI. + +Basic knowledge of the AWS CLI and the [`awslocal`](https://github.com/localstack/awscli-local) wrapper is expected. + +Start LocalStack using your preferred method. + +### Domains + +Domains are the top-level containers for repositories in CodeArtifact. + +Create a domain with the [CreateDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_CreateDomain.html) operation: + +{{< command >}} +$ awslocal codeartifact create-domain --domain demo-domain +{{< /command >}} + +The following output is displayed: +```json +{ + "domain": { + "name": "demo-domain", + "owner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:domain/demo-domain", + "status": "Active", + "createdTime": "2025-05-20T11:30:52.073202+02:00", + "repositoryCount": 0, + "assetSizeBytes": 0 + } +} +``` + +You can use [DescribeDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeDomain.html), [ListDomains](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListDomains.html), and [DeleteDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteDomain.html) for domain management. + +{{< command >}} +$ awslocal codeartifact describe-domain --domain demo-domain +{{< /command >}} + +The following output is displayed: +```json +{ + "domain": { + "name": "demo-domain", + "owner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:domain/demo-domain", + "status": "Active", + "createdTime": "2025-05-20T11:30:52.073202+02:00", + "repositoryCount": 0, + "assetSizeBytes": 0 + } +} +``` + +{{< command >}} +$ awslocal codeartifact list-domains +{{< /command >}} + +The following output is displayed: +```json +{ + "domains": [ + { + "name": "demo-domain", + "owner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:domain/demo-domain", + "status": "Active", + "createdTime": "2025-05-20T11:30:52.073202+02:00" + } + ] +} +``` + +{{< command >}} +$ awslocal codeartifact delete-domain --domain demo-domain +{{< /command >}} + +The following output is displayed: +```json +{ + "domain": { + "name": "demo-domain", + "owner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:domain/demo-domain", + "status": "Deleted", + "createdTime": "2025-05-20T11:30:52.073202+02:00", + "repositoryCount": 0, + "assetSizeBytes": 0 + } +} +``` + +### Repositories + +Repositories store packages and are associated with a domain. + +Create a repository using [CreateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_CreateRepository.html): + +{{< command >}} +$ awslocal codeartifact create-repository --domain demo-domain \ + --repository demo-repo +{{< /command >}} + +The following output is displayed: +```json +{ + "repository": { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "upstreams": [], + "externalConnections": [], + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } +} +``` + +Use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html) to view a specific repository. + +{{< command >}} +$ awslocal codeartifact describe-repository --domain demo-domain --repository demo-repo +{{< /command >}} + +The following output is displayed: +```json +{ + "repository": { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "upstreams": [], + "externalConnections": [], + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } +} +``` + +Use [ListRepositories](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html) to view all of the repositories. + +{{< command >}} +$ awslocal codeartifact list-repositories +{{< /command >}} + +The following output is displayed: +```json +{ + "repositories": [ + { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } + ] +} +``` + +Otherwise, list repositories in a specific domain using [ListRepositoriesInDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositoriesInDomain.html): + +{{< command >}} +$ awslocal codeartifact list-repositories-in-domain --domain demo-domain +{{< /command >}} + +The following output is displayed: +```json +{ + "repositories": [ + { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } + ] +} +``` + +Update a repository using [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html): + +{{< command >}} +$ awslocal codeartifact update-repository --domain demo-domain --repository demo-repo --description "My demo repository" +{{< /command >}} + +The following output is displayed: +```json +{ + "repository": { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "description": "My demo repository", + "upstreams": [], + "externalConnections": [], + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } +} +``` + +Delete a repository using [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html): + +{{< command >}} +$ awslocal codeartifact delete-repository --domain demo-domain --repository demo-repo +{{< /command >}} + +The following output is displayed: +```json +{ + "repository": { + "name": "demo-repo", + "administratorAccount": "000000000000", + "domainName": "demo-domain", + "domainOwner": "000000000000", + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", + "upstreams": [], + "externalConnections": [], + "createdTime": "2025-05-20T11:34:27.712367+02:00" + } +} +``` From 389c640055889880ecfd68899ea53dedc02664aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 14:15:36 +0200 Subject: [PATCH 02/16] wip --- .../en/user-guide/aws/codeartifact/index.md | 74 +++++++++++-------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 448bfbc2d9..8b81047f1a 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -48,7 +48,7 @@ The following output is displayed: } ``` -You can use [DescribeDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeDomain.html), [ListDomains](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListDomains.html), and [DeleteDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteDomain.html) for domain management. +You can use [DescribeDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeDomain.html), [UpdateDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateDomain.html), and [DeleteDomain](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteDomain.html) for domain management. {{< command >}} $ awslocal codeartifact describe-domain --domain demo-domain @@ -69,6 +69,8 @@ The following output is displayed: } ``` +You can list all domains using [ListDomains](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListDomains.html). + {{< command >}} $ awslocal codeartifact list-domains {{< /command >}} @@ -88,25 +90,6 @@ The following output is displayed: } ``` -{{< command >}} -$ awslocal codeartifact delete-domain --domain demo-domain -{{< /command >}} - -The following output is displayed: -```json -{ - "domain": { - "name": "demo-domain", - "owner": "000000000000", - "arn": "arn:aws:codeartifact:eu-central-1:000000000000:domain/demo-domain", - "status": "Deleted", - "createdTime": "2025-05-20T11:30:52.073202+02:00", - "repositoryCount": 0, - "assetSizeBytes": 0 - } -} -``` - ### Repositories Repositories store packages and are associated with a domain. @@ -134,7 +117,7 @@ The following output is displayed: } ``` -Use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html) to view a specific repository. +You can use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html), [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html), and [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html) to manage repositories. {{< command >}} $ awslocal codeartifact describe-repository --domain demo-domain --repository demo-repo @@ -200,10 +183,16 @@ The following output is displayed: } ``` -Update a repository using [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html): +You can use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html), [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html), and [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html) to manage repositories. + + +### External connections and upstream repositories + +Repositories can be associated with external connections using [AssociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssociateExternalConnection.html) and [DisassociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisassociateExternalConnection.html). {{< command >}} -$ awslocal codeartifact update-repository --domain demo-domain --repository demo-repo --description "My demo repository" +$ awslocal codeartifact associate-external-connection --domain demo-domain --repository demo-repo \ + --external-connection "public:npmjs" {{< /command >}} The following output is displayed: @@ -215,32 +204,53 @@ The following output is displayed: "domainName": "demo-domain", "domainOwner": "000000000000", "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", - "description": "My demo repository", "upstreams": [], - "externalConnections": [], - "createdTime": "2025-05-20T11:34:27.712367+02:00" + "externalConnections": [ + { + "externalConnectionName": "public:npmjs", + "packageFormat": "npm", + "status": "AVAILABLE" + } + ], + "createdTime": "2025-05-20T14:03:27.539994+02:00" } } ``` -Delete a repository using [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html): +Alternatively, repositories can be configured with upstream repositories using the `upstreams` property of [CreateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_CreateRepository.html) and [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html). {{< command >}} -$ awslocal codeartifact delete-repository --domain demo-domain --repository demo-repo +$ awslocal codeartifact create-repository --domain demo-domain \ + --repository demo-repo2 \ + --upstreams repositoryName=demo-repo {{< /command >}} The following output is displayed: ```json { "repository": { - "name": "demo-repo", + "name": "demo-repo2", "administratorAccount": "000000000000", "domainName": "demo-domain", "domainOwner": "000000000000", - "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo", - "upstreams": [], + "arn": "arn:aws:codeartifact:eu-central-1:000000000000:repository/demo-domain/demo-repo2", + "upstreams": [ + { + "repositoryName": "demo-repo" + } + ], "externalConnections": [], - "createdTime": "2025-05-20T11:34:27.712367+02:00" + "createdTime": "2025-05-20T14:07:56.741333+02:00" } } ``` + +Please note, a repository can have one or more upstream repositories, or an external connection. + +## Limitations + +LocalStack doesn't support the following features yet: + +- Domain and repository permission policies +- Packages and package groups handlers +- Retrieving repository endpoints From 33aee916226fd067b184697bc2be94f4714c5297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 14:21:43 +0200 Subject: [PATCH 03/16] remove duplicated paragraph --- content/en/user-guide/aws/codeartifact/index.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 8b81047f1a..228ea1dc28 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -183,9 +183,6 @@ The following output is displayed: } ``` -You can use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html), [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html), and [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html) to manage repositories. - - ### External connections and upstream repositories Repositories can be associated with external connections using [AssociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssociateExternalConnection.html) and [DisassociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisassociateExternalConnection.html). From 879ac86fd16943c1551082c9944c6c3a028360dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 14:23:24 +0200 Subject: [PATCH 04/16] style changes --- content/en/user-guide/aws/codeartifact/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 228ea1dc28..db7d8889e0 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -34,6 +34,7 @@ $ awslocal codeartifact create-domain --domain demo-domain {{< /command >}} The following output is displayed: + ```json { "domain": { @@ -55,6 +56,7 @@ $ awslocal codeartifact describe-domain --domain demo-domain {{< /command >}} The following output is displayed: + ```json { "domain": { @@ -76,6 +78,7 @@ $ awslocal codeartifact list-domains {{< /command >}} The following output is displayed: + ```json { "domains": [ @@ -102,6 +105,7 @@ $ awslocal codeartifact create-repository --domain demo-domain \ {{< /command >}} The following output is displayed: + ```json { "repository": { @@ -124,6 +128,7 @@ $ awslocal codeartifact describe-repository --domain demo-domain --repository de {{< /command >}} The following output is displayed: + ```json { "repository": { @@ -146,6 +151,7 @@ $ awslocal codeartifact list-repositories {{< /command >}} The following output is displayed: + ```json { "repositories": [ @@ -168,6 +174,7 @@ $ awslocal codeartifact list-repositories-in-domain --domain demo-domain {{< /command >}} The following output is displayed: + ```json { "repositories": [ @@ -193,6 +200,7 @@ $ awslocal codeartifact associate-external-connection --domain demo-domain --rep {{< /command >}} The following output is displayed: + ```json { "repository": { @@ -223,6 +231,7 @@ $ awslocal codeartifact create-repository --domain demo-domain \ {{< /command >}} The following output is displayed: + ```json { "repository": { From f1548a0b792e7cf190d5db3bdb8168755064c414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 14:44:41 +0200 Subject: [PATCH 05/16] fix style --- content/en/user-guide/aws/codeartifact/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index db7d8889e0..728a9fa70c 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -10,7 +10,8 @@ tags: ["Pro image"] CodeArtifact is a fully managed artifact repository service that makes it easy to securely store, publish, and share software packages used in your development process. -On AWS, CodeArtifact supports common package formats such as Maven, npm, Python (pip), and NuGet. You can configure it to work with public repositories or use it to store your private packages. +On AWS, CodeArtifact supports common package formats such as Maven, npm, Python (pip), and NuGet. +You can configure it to work with public repositories or use it to store your private packages. LocalStack provides mocking support for several CodeArtifact API operations. You can find supported operations on the [API coverage page]({{< ref "coverage_codeartifact" >}}). From cba4861ae016a43ecfb723f6a0c15bdcaaa7d090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 15:00:55 +0200 Subject: [PATCH 06/16] style changes --- content/en/user-guide/aws/codeartifact/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 728a9fa70c..a5458317cb 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -191,7 +191,7 @@ The following output is displayed: } ``` -### External connections and upstream repositories +### External Connections and Upstream Repositories Repositories can be associated with external connections using [AssociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssociateExternalConnection.html) and [DisassociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisassociateExternalConnection.html). @@ -252,9 +252,11 @@ The following output is displayed: } ``` +{{< callout "note">}} Please note, a repository can have one or more upstream repositories, or an external connection. +{{< /callout >}} -## Limitations +## Current Limitations LocalStack doesn't support the following features yet: From a061132375950f425fdedb113d43d5cc57adbe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Tue, 20 May 2025 15:38:21 +0200 Subject: [PATCH 07/16] break some command examples for clarity --- content/en/user-guide/aws/codeartifact/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index a5458317cb..7d845fd162 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -125,7 +125,8 @@ The following output is displayed: You can use [DescribeRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DescribeRepository.html), [UpdateRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_UpdateRepository.html), and [DeleteRepository](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DeleteRepository.html) to manage repositories. {{< command >}} -$ awslocal codeartifact describe-repository --domain demo-domain --repository demo-repo +$ awslocal codeartifact describe-repository --domain demo-domain \ + --repository demo-repo {{< /command >}} The following output is displayed: @@ -196,7 +197,8 @@ The following output is displayed: Repositories can be associated with external connections using [AssociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssociateExternalConnection.html) and [DisassociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisassociateExternalConnection.html). {{< command >}} -$ awslocal codeartifact associate-external-connection --domain demo-domain --repository demo-repo \ +$ awslocal codeartifact associate-external-connection --domain demo-domain \ + --repository demo-repo \ --external-connection "public:npmjs" {{< /command >}} From eeff4d9f87ac70720d62bc47fa925822badead03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Mon, 26 May 2025 15:23:54 +0200 Subject: [PATCH 08/16] Update content/en/user-guide/aws/codeartifact/index.md Co-authored-by: Viren Nadkarni --- content/en/user-guide/aws/codeartifact/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 7d845fd162..6ed821af51 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -5,7 +5,9 @@ description: > Get started with CodeArtifact on LocalStack tags: ["Pro image"] --- - +{{< callout >}} +CodeArtifact is under active development and available in LocalStack as a preview feature. +{{< /callout >}} ## Introduction CodeArtifact is a fully managed artifact repository service that makes it easy to securely store, publish, and share software packages used in your development process. From 136ad720d8a884b136a8360c7d7979957ad3a16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 13 Jun 2025 10:30:49 +0200 Subject: [PATCH 09/16] Add "Using CodeArtifact with npm" --- .../en/user-guide/aws/codeartifact/index.md | 82 ++++++++++++++++++- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 6ed821af51..12aca7b45f 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -260,10 +260,86 @@ The following output is displayed: Please note, a repository can have one or more upstream repositories, or an external connection. {{< /callout >}} +## Using CodeArtifact with npm + +### Configuring npm with the login command + +Use the `awslocal codeartifact login` command to fetch credentials for use with npm. + +{{< command >}} +$ awslocal codeartifact login --tool npm --domain demo-domain --repository demo-repo +{{< /command >}} + +This command makes the following changes to your `~/.npmrc` file: + +- Adds an authorization token after fetching it from CodeArtifact using your AWS credentials. +- Sets the npm registry to the repository specified by the `--repository` option. +- **For npm 6 and lower:** Adds `"always-auth=true"` so the authorization token is sent for every npm command. + +The default authorization period after calling login is 12 hours, and login must be called to periodically refresh the token. +For more information about the authorization token created with the login command, see [Tokens created with the login command](https://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html#auth-token-login). + +### Configuring npm manually + +You can configure npm with your CodeArtifact repository without the `awslocal codeartifact login` command by manually updating the npm configuration. + +#### To configure npm without using the login command + +1. In a command line, fetch a CodeArtifact authorization token and store it in an environment variable. + npm will use this token to authenticate with your CodeArtifact repository. + +{{< command >}} +$ export CODEARTIFACT_AUTH_TOKEN=$(awslocal codeartifact get-authorization-token --domain demo-domain --query authorizationToken --output text) +{{< /command >}} + +2. Get your CodeArtifact repository's endpoint by running the following command. + Your repository endpoint is used to point npm to your repository to install or publish packages. + +{{< command >}} +$ awslocal codeartifact get-repository-endpoint --domain demo-domain --repository demo-repo --format npm +{{< /command >}} + +The following URL is an example repository endpoint. + +```text +http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/ +``` + +3. Use the `npm config set` command to set the registry to your CodeArtifact repository. + Replace the URL with the repository endpoint URL from the previous step. + +{{< command >}} +$ npm config set registry http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/ +{{< /command >}} + +4. Use the `npm config set` command to add your authorization token to your npm configuration. + +{{< command >}} +$ npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:_authToken=${CODEARTIFACT_AUTH_TOKEN} +{{< /command >}} + +**For npm 6 or lower:** To make npm always pass the auth token to CodeArtifact, even for GET requests, set the always-auth configuration variable with npm config set. + +{{< command >}} +$ npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:always-auth=true +{{< /command >}} + +#### Example npm configuration file (`.npmrc`) + +The following is an example `.npmrc` file after following the preceding instructions to set the CodeArtifact registry endpoint, add an authentication token, and configure `always-auth`. + +```text +registry=http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/ +//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:_authToken=eyJ2ZX... +//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:always-auth=true +``` + ## Current Limitations LocalStack doesn't support the following features yet: -- Domain and repository permission policies -- Packages and package groups handlers -- Retrieving repository endpoints +- Domain owners are ignored +- Copying package versions is not supported yet +- Domain and repository permission policies are not supported yet +- Package groups are not supported yet +- Only supports the `npm` format From c8dd09656a7778f42d6dc1295bcfad345a449adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 09:44:29 +0200 Subject: [PATCH 10/16] Update content/en/user-guide/aws/codeartifact/index.md Co-authored-by: Viren Nadkarni --- content/en/user-guide/aws/codeartifact/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 12aca7b45f..42bacec58e 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -12,7 +12,7 @@ CodeArtifact is under active development and available in LocalStack as a previe CodeArtifact is a fully managed artifact repository service that makes it easy to securely store, publish, and share software packages used in your development process. -On AWS, CodeArtifact supports common package formats such as Maven, npm, Python (pip), and NuGet. +On AWS, CodeArtifact supports popular package formats such as Maven, npm, Python (pip), NuGet, etc. You can configure it to work with public repositories or use it to store your private packages. LocalStack provides mocking support for several CodeArtifact API operations. From e93ceb1638b6515aa8149d15e91f232b7dbd39db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 09:44:51 +0200 Subject: [PATCH 11/16] Update content/en/user-guide/aws/codeartifact/index.md Co-authored-by: Viren Nadkarni --- content/en/user-guide/aws/codeartifact/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 42bacec58e..abb87fc63a 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -17,6 +17,7 @@ You can configure it to work with public repositories or use it to store your pr LocalStack provides mocking support for several CodeArtifact API operations. You can find supported operations on the [API coverage page]({{< ref "coverage_codeartifact" >}}). +It also has full support to create and use NPM repositories. ## Getting Started From 76a50d90f2326f6177bf6c362ea32824ad72ca0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 09:45:08 +0200 Subject: [PATCH 12/16] Update content/en/user-guide/aws/codeartifact/index.md Co-authored-by: Viren Nadkarni --- content/en/user-guide/aws/codeartifact/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index abb87fc63a..d384ac7bdf 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -337,7 +337,7 @@ registry=http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.l ## Current Limitations -LocalStack doesn't support the following features yet: +LocalStack does not support the following features yet: - Domain owners are ignored - Copying package versions is not supported yet From f2c19669f0a1d99f3d599d336ce18bf4c00851ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 10:03:50 +0200 Subject: [PATCH 13/16] add codeartifact to licensing --- content/en/references/licensing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/references/licensing.md b/content/en/references/licensing.md index 776c14d668..49516a5c9b 100644 --- a/content/en/references/licensing.md +++ b/content/en/references/licensing.md @@ -109,6 +109,7 @@ To learn more about how a service behaves in LocalStack, refer to that individua | [](https://docs.localstack.cloud/user-guide/aws/qldb/)[Amazon Quantum Ledger Database (QLDB)](https://docs.localstack.cloud/user-guide/aws/qldb/) | ❌ | ❌ | ✅ | | Developer Tools | | | | | [](https://docs.localstack.cloud/references/coverage/coverage_codecommit/)[AWS CodeCommit](https://docs.localstack.cloud/references/coverage/coverage_codecommit/) | ❌ | ✅ | ✅ | +| AWS CodeArtifact | ❌ | ✅ | ✅ | | AWS CodeBuild | ❌ | ✅ | ✅ | | AWS CodeConnections | ❌ | ✅ | ✅ | | [](https://docs.localstack.cloud/user-guide/aws/fis/)[AWS Fault Injection Service](https://docs.localstack.cloud/user-guide/aws/fis/) | ❌ | ❌ | ✅ | From cc7a61a8fc55967cf79e1a7334b47238eadfc41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 10:17:50 +0200 Subject: [PATCH 14/16] remove callout --- content/en/user-guide/aws/codeartifact/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index d384ac7bdf..42099d13f9 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -5,9 +5,7 @@ description: > Get started with CodeArtifact on LocalStack tags: ["Pro image"] --- -{{< callout >}} -CodeArtifact is under active development and available in LocalStack as a preview feature. -{{< /callout >}} + ## Introduction CodeArtifact is a fully managed artifact repository service that makes it easy to securely store, publish, and share software packages used in your development process. From e9278a9bed3d1d0810a0560bd780ef37c930b1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Fri, 27 Jun 2025 10:21:23 +0200 Subject: [PATCH 15/16] explain external connections and upstream repositories --- content/en/user-guide/aws/codeartifact/index.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/content/en/user-guide/aws/codeartifact/index.md b/content/en/user-guide/aws/codeartifact/index.md index 42099d13f9..a0c2c46d4d 100644 --- a/content/en/user-guide/aws/codeartifact/index.md +++ b/content/en/user-guide/aws/codeartifact/index.md @@ -193,7 +193,14 @@ The following output is displayed: } ``` -### External Connections and Upstream Repositories +### Upstream Repositories and External Connections + +A repository can have other CodeArtifact repositories as upstream repositories. +This enables a package manager client to access the packages that are contained in more than one repository using a single repository endpoint. + +Furthermore, you can add a external connection between a CodeArtifact repository and an external, public repository such as [https://npmjs.com](https://npmjs.com). +Then, when you request a package from the CodeArtifact repository that's not already present in the repository, the package can be fetched from the external connection. +This makes it possible to consume open-source dependencies used by your application. Repositories can be associated with external connections using [AssociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssociateExternalConnection.html) and [DisassociateExternalConnection](https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DisassociateExternalConnection.html). From 8eae0e1cb4f6335b92cc58e59689b2add8f2836f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Mon, 30 Jun 2025 10:32:15 +0200 Subject: [PATCH 16/16] fix unrelated file --- content/en/user-guide/lambda-tools/hot-reloading/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/user-guide/lambda-tools/hot-reloading/index.md b/content/en/user-guide/lambda-tools/hot-reloading/index.md index f746517cf3..53f9eba31c 100644 --- a/content/en/user-guide/lambda-tools/hot-reloading/index.md +++ b/content/en/user-guide/lambda-tools/hot-reloading/index.md @@ -41,7 +41,8 @@ If using Docker Desktop on macOS, you might need to allow [file sharing](https:/ MacOS may prompt you to grant Docker access to your target folders. **WSL2-compatible paths required with Rancher Desktop on Windows:** -Make sure your Lambda handler paths are specified using WSL2-compatible paths. For example, instead of using a Windows-style path such as: +Make sure your Lambda handler paths are specified using WSL2-compatible paths. +For example, instead of using a Windows-style path such as: ```bash C:\Users\myuser\projects\lambda\handler.py