Skip to content

Commit d630721

Browse files
author
Mark Iverson
committed
Two new features (support for cross account ECR access and private Docker registries) plus minor periodic updates
1 parent 3c22e7c commit d630721

26 files changed

+154
-53
lines changed

doc_source/auth-and-access-control-permissions-reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ If you see an expand arrow \(**↗**\) in the upper\-right corner of the table,
3333
| CreateProject | `codebuild:CreateProject` `iam:PassRole` Required to create build projects\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` `arn:aws:iam:account-ID:role/role-name` |
3434
| CreateWebhook | `codebuild:CreateWebhook` Required to create a webhook\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |
3535
| DeleteProject | `codebuild:DeleteProject` Required to delete build projects\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |
36+
| DeleteSourceCredentials | `codebuild:DeleteSourceCredentials` Required to delete a set of `SourceCredentialsInfo` objects that contain information about credentials for a GitHub, GitHub Enterprise, or Bitbucket repository\. | `*` |
3637
| DeleteWebhook | `codebuild:DeleteWebhook` Required to delete a webhook\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |
38+
| ImportSourceCredentials | `codebuild:ImportSourceCredentials` Required to import a set of `SourceCredentialsInfo` objects that contain information about credentials for a GitHub, GitHub Enterprise, or Bitbucket repository\. | `*` |
3739
| ListBuilds | codebuild:ListBuildsRequired to get a list of build IDs\. | `*` |
3840
| ListBuildsForProject | `codebuild:ListBuildsForProject` Required to get a list of build IDs for a build project\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |
3941
| ListCuratedEnvironmentImages | `codebuild:ListCuratedEnvironmentImages` Required to get information about all Docker images that are managed by AWS CodeBuild\. | `*` \(required, but does not refer to an addressable AWS resource\) |
42+
| ListSourceCredentials | `codebuild:ListSourceCredentials` Required to get a list of `SourceCredentialsInfo` objects that contain information about credentials for a GitHub, GitHub Enterprise, or Bitbucket repository\. | `*` |
4043
| ListProjects | `codebuild:ListProjects` Required to get a list of build project names\. | `*` |
4144
| StartBuild | `codebuild:StartBuild` Required to start running builds\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |
4245
| StopBuild | `codebuild:StopBuild` Required to attempt to stop running builds\. | `arn:aws:codebuild:region-ID:account-ID:project/project-name` |

doc_source/build-env-ref-available.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
AWS CodeBuild manages the following Docker images that are available in the AWS CodeBuild and AWS CodePipeline consoles\.
1010

1111
**Note**
12-
If you do not find your image on this page, it most likely contains components that are no longer supported by a vendor\. Images with one or more unsupported components are not available from the AWS CodeBuild console or the AWS CodeBuild SDK\. The images might still be available in the CLI, but they are not supported and are not updated\.
12+
If you do not find your image on this page, it most likely contains components that are no longer supported by a vendor\. Images with one or more unsupported components are not available from the AWS CodeBuild console or the AWS CodeBuild SDK\. The images might still be available in the CLI, but they are not supported or updated\.
1313

1414

1515
****

doc_source/build-env-ref-background-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Background Tasks in Build Environments<a name="build-env-ref-background-tasks"></a>
88

9-
You can run background tasks in build environments\. To do this, in your build spec, use the `nohup` command to run a command as a task in the background, even if the build process exits the shell\. Use the disown command to forcibly stop a running background task\.
9+
You can run background tasks in build environments\. To do this, in your buildspec, use the `nohup` command to run a command as a task in the background, even if the build process exits the shell\. Use the disown command to forcibly stop a running background task\.
1010

1111
**Examples:**
1212
+ Start a background process and wait for it to complete later:

doc_source/build-env-ref-cmd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Shells and Commands in Build Environments<a name="build-env-ref-cmd"></a>
88

99
You provide a set of commands for AWS CodeBuild to run in a build environment during the lifecycle of a build \(for example, installing build dependencies and testing and compiling your source code\)\. There are several ways to specify these commands:
10-
+ Create a build spec file and include it with your source code\. In this file, specify the commands you want to run in each phase of the build lifecycle\. For more information, see the [Build Specification Reference for AWS CodeBuild](build-spec-ref.md)\.
10+
+ Create a build specification file and include it with your source code\. In this file, specify the commands you want to run in each phase of the build lifecycle\. For more information, see the [Build Specification Reference for AWS CodeBuild](build-spec-ref.md)\.
1111
+ Use the AWS CodeBuild console to create a build project\. In **Insert build commands**, for **Build commands**, enter the commands you want to run in the `build` phase\. For more information, see [Create a Build Project \(Console\)](create-project.md#create-project-console)\.
1212
+ Use the AWS CodeBuild console to change the settings of a build project\. In **Insert build commands**, for **Build commands**, enter the commands you want to run in the `build` phase\. For more information, see [Change a Build Project's Settings \(Console\)](change-project.md#change-project-console)\.
1313
+ Use the AWS CLI or AWS SDKs to create a build project or change the settings of a build project\. Reference the source code that contains a build spec file with your commands, or specify a single string that includes the contents of an equivalent build spec file\. For more information, see [Create a Build Project](create-project.md) or [Change a Build Project's Settings](change-project.md)\.

doc_source/build-env-ref-compute-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AWS CodeBuild provides build environments with the following available memory, v
2020
**Note**
2121
For custom build environment images, AWS CodeBuild supports Docker images up to 20 GB uncompressed in Linux and 50 GB uncompressed in Windows, regardless of the compute type\. To check your build image's size, use Docker to run the `docker images REPOSITORY:TAG` command\.
2222

23-
To choose one of these compute types:
23+
To choose a compute type:
2424
+ In the AWS CodeBuild console, in the **Create build project** wizard or **Edit Build Project** page, in **Environment** expand **Additional configuration**, and then choose one of the options from **Compute type**\. For more information, see [Create a Build Project \(Console\)](create-project.md#create-project-console) or [Change a Build Project's Settings \(Console\)](change-project.md#change-project-console)\.
2525
+ For the AWS CLI, run the `create-project` or `update-project` command, specifying the `computeType` value of the `environment` object\. For more information, see [Create a Build Project \(AWS CLI\)](create-project.md#create-project-cli) or [Change a Build Project's Settings \(AWS CLI\)](change-project.md#change-project-cli)\.
2626
+ For the AWS SDKs, call the equivalent of the `CreateProject` or `UpdateProject` operation for your target programming language, specifying the equivalent of `computeType` value of the `environment` object\. For more information, see the [AWS SDKs and Tools Reference](sdk-ref.md)\.

doc_source/build-env-ref-env-vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can also provide build environments with your own environment variables\. Fo
4242
+ [Run a Build](run-build.md)
4343
+ [Build Spec Reference](build-spec-ref.md)
4444

45-
To list all of the available environment variables in a build environment, you can run the `printenv` command \(for Linux\-based build environment\) or `"Get-ChildItem Env:"` \(for Windows\-based build environments\) during a build\. With the exception of those previously listed, environment variables that start with `CODEBUILD_` are for AWS CodeBuild internal use\. They should not be used in your build commands\.
45+
To list all of the available environment variables in a build environment, you can run the `printenv` command \(for Linux\-based build environment\) or `"Get-ChildItem Env:"` \(for Windows\-based build environments\) during a build\. Except for those previously listed, environment variables that start with `CODEBUILD_` are for AWS CodeBuild internal use\. They should not be used in your build commands\.
4646

4747
**Important**
4848
We strongly discourage the use of environment variables to store sensitive values, especially AWS access key IDs and secret access keys\. Environment variables can be displayed in plain text using tools such as the AWS CodeBuild console and the AWS CLI\.

doc_source/build-env-ref.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
When you call AWS CodeBuild to run a build, you must provide information about the build environment\. A *build environment* represents a combination of operating system, programming language runtime, and tools that AWS CodeBuild uses to run a build\. For information about how a build environment works, see [How AWS CodeBuild Works](concepts.md#concepts-how-it-works)\.
1010

11-
A build environment contains a Docker image\. For information, see [Docker Glossary: Image](https://docs.docker.com/glossary/?term=image) on the Docker Docs website\.
11+
A build environment contains a Docker image\. For information, see [the Docker glossary](https://docs.docker.com/glossary/?term=image) on the Docker Docs website\.
1212

13-
When you provide information to AWS CodeBuild about the build environment, you specify the identifier of a Docker image in a supported repository type\. These include the AWS CodeBuild Docker image repository, publicly available images in Docker Hub, and Amazon Elastic Container Registry \(Amazon ECR\) repositories in your AWS account:
13+
When you provide information to AWS CodeBuild about the build environment, you specify the identifier of a Docker image in a supported repository type\. These include the AWS CodeBuild Docker image repository, publicly available images in Docker Hub, and Amazon Elastic Container Registry \(Amazon ECR\) repositories that your AWS account has permissions to access\.
1414
+ We recommend that you use Docker images stored in the AWS CodeBuild Docker image repository, because they are optimized for use with the service\. For more information, see [Docker Images Provided by AWS CodeBuild](build-env-ref-available.md)\.
1515
+ To get the identifier of a publicly available Docker image stored in Docker Hub, see [Searching for Images](https://docs.docker.com/docker-hub/repos/#searching-for-images) on the Docker Docs website\.
1616
+ To learn how to work with Docker images stored in Amazon ECR repositories in your AWS account, see [Amazon ECR Sample](sample-ecr.md)\.

doc_source/build-spec-ref.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ artifacts:
349349
files:
350350
- target/messageUtil-1.0.jar
351351
discard-paths: yes
352-
secondary-artifacts:
353-
artifact1:
354-
files:
355-
- target/messageUtil-1.0.jar
356-
discard-paths: yes
357-
artifact2:
358-
files:
359-
- target/messageUtil-1.0.jar
360-
discard-paths: yes
352+
secondary-artifacts:
353+
artifact1:
354+
files:
355+
- target/messageUtil-1.0.jar
356+
discard-paths: yes
357+
artifact2:
358+
files:
359+
- target/messageUtil-1.0.jar
360+
discard-paths: yes
361361
cache:
362362
paths:
363363
- '/root/.m2/**/*'

doc_source/create-project.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Answer the questions in [Plan a Build](planning.md)\.
5656
For **Environment image**, do one of the following:
5757
+ To use a Docker image managed by AWS CodeBuild, choose **Managed image**, and then make selections from **Operating system**, **Runtime**, and **Runtime version**\.
5858
+ To use another Docker image, choose **Custom image**\. For **Environment type**, choose **Linux** or **Windows**\. For **Custom image type**, choose **Amazon ECR** or **Other location**\. If you choose **Other location**, enter the name and tag of the Docker image in Docker Hub, using the format `docker repository/docker image name`\. If you choose **Amazon ECR**, then use **Amazon ECR repository** and **Amazon ECR image** to choose the Docker image in your AWS account\.
59+
+ To use private Docker image, choose **Custom image**\. For **Environment type**, choose **Linux** or **Windows**\. For **Custom image type**, choose **Other location**, and then enter the Amazon Resource Name \(ARN\) of the credentials for your private Docker image\. The credentials must be created by AWS Secrets Manager\. For more information, see [What Is AWS Secrets Manager?](https://docs.aws.amazon.com/secretsmanager/latest/userguide/)
5960

6061
\(Optional\) Select **Privileged** only if you plan to use this build project to build Docker images, and the build environment image you chose is not provided by AWS CodeBuild with Docker support\. Otherwise, all associated builds that attempt to interact with the Docker daemon fail\. You must also start the Docker daemon so that your builds can interact with it\. One way to do this is to initialize the Docker daemon in the `install` phase of your build spec by running the following build commands\. Do not run these commands if you chose a build environment image provided by AWS CodeBuild with Docker support\.
6162

@@ -268,6 +269,13 @@ For information about using the AWS CLI with AWS CodeBuild, see the [Command Lin
268269
"type": "environmentVariable-type"
269270
}
270271
],
272+
"registryCredential": [
273+
{
274+
"credential": "credential-arn-or-name",
275+
"credentialProvider": "credential-provider"
276+
}
277+
],
278+
"imagePullCredentialsType": "imagePullCredentialsType-value,
271279
"privilegedMode": "privilegedMode"
272280
},
273281
"badgeEnabled": "badgeEnabled"
@@ -394,6 +402,18 @@ If an environment variable with the same name is defined in multiple places, the
394402
The value in the start build operation call takes highest precedence\.
395403
The value in the build project definition takes next precedence\.
396404
The value in the build spec declaration takes lowest precedence\.
405+
+ Use the optional `registryCredential` to specify information about credentials that provide access to a private Docker registry\.
406+
+ *credential\-arn\-or\-name*: Specifies the ARN or name of credentials created using AWS Managed Services \. You can use the name of the credentials only if they exist in your current region
407+
+ *credential\-provider*: the only valid value is `SECRETS_MANAGER`\.
408+
409+
When this is set:
410+
+ `imagePullCredentials` must be set to `SERVICE_ROLE`\.
411+
+ images cannot be curated or an Amazon ECR image\.
412+
+ *imagePullCredentialsType\-value*: Optional value\. The type of credentials AWS CodeBuild uses to pull images in your build\. There are two valid values:
413+
+ `CODEBUILD` specifies that AWS CodeBuild uses its own credentials\. This requires that you modify your Amazon ECR repository policy to trust the AWS CodeBuild service principal\.
414+
+ `SERVICE_ROLE` specifies that AWS CodeBuild uses your build project's service role\.
415+
416+
When you use a cross\-account or private registry image, you must use `SERVICE_ROLE` credentials\. When you use an AWS CodeBuild curated image, you must use `CODEBUILD` credentials\.
397417
+ You must specify *privilegedMode* with a value of `true` only if you plan to use this build project to build Docker images, and the build environment image you specified is not provided by AWS CodeBuild with Docker support\. Otherwise, all associated builds that attempt to interact with the Docker daemon fail\. You must also start the Docker daemon so that your builds can interact with it\. One way to do this is to initialize the Docker daemon in the `install` phase of your build spec by running the following build commands\. Do not run these commands if you specified a build environment image provided by AWS CodeBuild with Docker support\.
398418
399419
```

doc_source/history.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
The following table describes the important changes to the documentation since the last release of AWS CodeBuild\. For notification about updates to this documentation, you can subscribe to an RSS feed\.
1010
+ **Latest API version:** 2016\-10\-06
11-
+ **Latest documentation update:** January 17, 2019
11+
+ **Latest documentation update:** January 24, 2019
1212

1313
| Change | Description | Date |
1414
| --- |--- |--- |
15+
| [Updated topics\.](#history) | AWS CodeBuild now supports using an Amazon ECR image that is in another AWS account\. Several topics have been updated to reflect this change, including [Amazon ECR Sample for AWS CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html), [Create a Build Project](https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html), and [Create an AWS CodeBuild Service Role](https://docs.aws.amazon.com/codebuild/latest/userguide/setting-up.html#setting-up-service-role)\. | January 24, 2019 |
16+
| [Support for private Docker registries\.](#history) | AWS CodeBuild now supports using a Docker image that is stored in a private registry as your runtime environment\. For more information, see [Private Registry with AWS Secrets Manager Sample](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-private-registry.html)\. | January 24, 2019 |
1517
| [Updated topic](#history) | AWS CodeBuild now supports using an access token to connect to GitHub \(with a personal access token\) and Bitbucket \(with an app password\) repositories\. For more information, see [Create a Build Project \(Console\)](https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-console) and [Using Access Tokens with Your Source Provider](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-access-tokens.html)\. | December 6, 2018 |
1618
| [Updated topic](#history) | AWS CodeBuild now supports new build metrics that measure the duration of each phase in a build\. For more information, see [ AWS CodeBuild CloudWatch Metrics](https://docs.aws.amazon.com/codebuild/latest/userguide/monitoring-builds.html#cloudwatch_metrics-codebuild)\. | November 15, 2018 |
1719
| [VPC Endpoint Policy Topic](#history) | Amazon VPC endpoints for AWS CodeBuild now support policies\. For more information, see [ Create a VPC Endpoint Policy for AWS CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/use-vpc-endpoints-with-codebuild.html#creating-vpc-endpoint-policy)\. | November 9, 2018 |

0 commit comments

Comments
 (0)