Skip to content

Commit 575854d

Browse files
CodeArtifact: Add ports to example endpoints (#124)
1 parent 16eecd6 commit 575854d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/content/docs/aws/services/codeartifact.mdx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ For more information about the authorization token created with the login comman
271271

272272
You can configure npm with your CodeArtifact repository without the `awslocal codeartifact login` command by manually updating the npm configuration.
273273

274-
#### To configure npm without using the login command
275-
276274
1. In a command line, fetch a CodeArtifact authorization token and store it in an environment variable.
277275
npm will use this token to authenticate with your CodeArtifact repository.
278276

@@ -284,44 +282,44 @@ You can configure npm with your CodeArtifact repository without the `awslocal co
284282
Your repository endpoint is used to point npm to your repository to install or publish packages.
285283

286284
```bash
287-
awslocal codeartifact get-repository-endpoint --domain demo-domain --repository demo-repo --format npm
285+
awslocal codeartifact get-repository-endpoint --domain demo-domain --repository demo-repo --format npm --output text
288286
```
289287

290288
The following URL is an example repository endpoint.
291289

292290
```text
293-
http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/
291+
http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/npm/demo-repo/
294292
```
295293

296294
3. Use the `npm config set` command to set the registry to your CodeArtifact repository.
297295
Replace the URL with the repository endpoint URL from the previous step.
298296

299297
```bash
300-
npm config set registry http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/
298+
npm config set registry http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/npm/demo-repo/
301299
```
302300

303301
4. Use the `npm config set` command to add your authorization token to your npm configuration.
304302

305303
```bash
306-
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
304+
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
307305
```
308306

309307
:::note
310308
**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.
311309

312310
```bash
313-
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:always-auth=true
311+
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:always-auth=true
314312
```
315313
:::
316314

317-
#### Example npm configuration file (`.npmrc`)
315+
### Example npm configuration file
318316

319317
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`.
320318

321319
```text
322-
registry=http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/
323-
//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:_authToken=eyJ2ZX...
324-
//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:always-auth=true
320+
registry=http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/npm/demo-repo/
321+
//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:_authToken=eyJ2ZX...
322+
//demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:always-auth=true
325323
```
326324

327325
## Current Limitations

0 commit comments

Comments
 (0)