Home
Support Forums

How can I run AWS configure in my build script?

I’m having an issue with a 401 error when I try to deploy my site. This is happening because it requires authentication. Typically I would run an aws configure command on the server pass in the information and it would be able to download the private package, however, I’m not sure how I can support this on Netlify. We’re using CodeArtifact for our artifacts.

Site Name: romantic-nobel-3f863c
Build log:

10:06:21 AM: Build ready to start
10:06:22 AM: build-image version: c5b01a919d3e16af69445c5de0cacb49efbb1a23 (focal)
10:06:22 AM: build-image tag: v4.4.0
10:06:22 AM: buildbot version: 32ed0189d752047ee8dfb652c26d682ee00f88d8
10:06:22 AM: Fetching cached dependencies
10:06:23 AM: Starting to download cache of 2.3MB
10:06:23 AM: Finished downloading cache in 159.435329ms
10:06:23 AM: Starting to extract cache
10:06:23 AM: Finished extracting cache in 54.322093ms
10:06:23 AM: Finished fetching cache in 214.590145ms
10:06:23 AM: Starting to prepare the repo for build
10:06:23 AM: Preparing Git Reference refs/heads/master
10:06:24 AM: Parsing package.json dependencies
10:06:25 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'storybook-static' versus 'storybook-static/' in the Netlify UI
10:06:25 AM: Starting build script
10:06:25 AM: Installing dependencies
10:06:25 AM: Python version set to 2.7
10:06:26 AM: Downloading and installing node v16.13.0...
10:06:26 AM: Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
10:06:26 AM: Computing checksum with sha256sum
10:06:26 AM: Checksums matched!
10:06:29 AM: Now using node v16.13.0 (npm v8.1.0)
10:06:29 AM: Started restoring cached build plugins
10:06:29 AM: Finished restoring cached build plugins
10:06:29 AM: Attempting ruby version 2.7.2, read from environment
10:06:31 AM: Using ruby version 2.7.2
10:06:31 AM: Using PHP version 8.0
10:06:31 AM: Started restoring cached yarn cache
10:06:31 AM: Finished restoring cached yarn cache
10:06:31 AM: Installing yarn at version 1.22.10
10:06:31 AM: Installing Yarn!
10:06:31 AM: > Downloading tarball...
10:06:31 AM: [1/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz --> /tmp/yarn.tar.gz.Xagfds7VBQ
10:06:31 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:06:31 AM:                                  Dload  Upload   Total   Spent    Left  Speed
10:06:31 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:06:31 AM: 100    81  100    81    0     0    663      0 --:--:-- --:--:-- --:--:--   663
10:06:31 AM: 100    95  100    95    0     0    261      0 --:--:-- --:--:-- --:--:--   261
10:06:32 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:06:32 AM: 100   626  100   626    0     0   1206      0 --:--:-- --:--:-- --:--:--  5173
10:06:32 AM: 100 1215k  100 1215k    0     0  1820k      0 --:--:-- --:--:-- --:--:-- 1820k
10:06:32 AM: [2/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz.asc --> /tmp/yarn.tar.gz.Xagfds7VBQ.asc
10:06:32 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:06:32 AM:                                  Dload  Upload   Total   Spent    Left  Speed
10:06:32 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:06:32 AM: 100    85  100    85    0     0   1133      0 --:--:-- --:--:-- --:--:--  1133
10:06:32 AM: 100    99  100    99    0     0    933      0 --:--:-- --:--:-- --:--:--   933
10:06:32 AM: 100   630  100   630    0     0   4598      0 --:--:-- --:--:-- --:--:--  4598
10:06:32 AM: 100   832  100   832    0     0   5621      0 --:--:-- --:--:-- --:--:--  5621
10:06:32 AM: > Verifying integrity...
10:06:32 AM: gpg: Signature made Fri 02 Oct 2020 11:17:27 AM UTC
10:06:32 AM: gpg:                using RSA key 6D98490C6F1ACDDD448E45954F77679369475BAA
10:06:32 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>" [unknown]
10:06:32 AM: gpg: WARNING: This key is not certified with a trusted signature!
10:06:32 AM: gpg:          There is no indication that the signature belongs to the owner.
10:06:32 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
10:06:32 AM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
10:06:32 AM: > GPG signature looks good
10:06:32 AM: > Extracting to ~/.yarn...
10:06:32 AM: > Adding to $PATH...
10:06:32 AM: > Successfully installed Yarn 1.22.10! Please open another terminal where the `yarn` command will now be available.
10:06:33 AM: No yarn workspaces detected
10:06:33 AM: Started restoring cached node modules
10:06:33 AM: Finished restoring cached node modules
10:06:33 AM: Installing NPM modules using Yarn version 1.22.10
10:06:34 AM: yarn install v1.22.10
10:06:34 AM: [1/5] Validating package.json...
10:06:34 AM: [2/5] Resolving packages...
10:06:35 AM: [3/5] Fetching packages...
10:06:41 AM: error An unexpected error occurred: "https://madpaws-847799775195.d.codeartifact.ap-southeast-2.amazonaws.com:443/npm/madpaws/@madpaws/tooling-config/-/tooling-config-0.0.24.tgz: Request failed \"401 Unauthorized\"".
10:06:41 AM: info If you think this is a bug, please open a bug report with the information provided in "/opt/build/repo/yarn-error.log".
10:06:41 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
10:07:14 AM: Error during Yarn install
10:07:14 AM: Build was terminated: Build script returned non-zero exit code: 1
10:07:15 AM: Creating deploy upload records
10:07:15 AM: Failing build: Failed to build site
10:07:15 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
10:07:15 AM: Finished processing build request in 52.461801977s

Hi @SamMcM

You might find the following support guides helpful in this instance.