Configure a private registry credential for self-hosted runners - Amazon CodeBuild
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Configure a private registry credential for self-hosted runners

Use the following instructions to configure a registry credential for a self-hosted runner.

Note

Note that these credentials will only be used if the images are overridden with those from private registries.

Amazon Management Console
  1. Open the Amazon CodeBuild console at https://console.amazonaws.cn/codesuite/codebuild/home.

  2. Create a build project or select an existing project. For information, see Create a build project (console) and Change a build project's settings (console).

  3. In Environment, choose Additional configuration.

  4. In Additional configuration, enter the name or ARN of the secret from Amazon Secrets Manager for Registry credential - optional.

    The registry credential configuration.
Amazon CLI
  1. If you'd like to create a new project, run the create-project command.

    aws codebuild create-project \ --name project-name \ --source type=source-type,location=source-location \ --environment "type=environment-type,image=image,computeType=compute-type,registryCredential={credentialProvider=SECRETS_MANAGER,credential=secret-name-or-arn},imagePullCredentialsType=CODEBUILD|SERVICE_ROLE" \ --artifacts type=artifacts-type \ --service-role arn:aws:iam::account-ID:role/service-role/service-role-name
  2. If you'd like to update an existing project, run the update-project command.

    aws codebuild update-project \ --name project-name \ --environment "type=environment-type,image=image,computeType=compute-type,registryCredential={credentialProvider=SECRETS_MANAGER,credential=secret-name-or-arn}"