Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit f068793

Browse files
committed
Periodic update - May 7, 2019
1 parent 9e3741c commit f068793

25 files changed

+153
-59
lines changed

doc_source/auth-and-access-control-iam-identity-based-access-control.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ The following example policy statement allows a user to get information about al
311311

312312
### Allow CodeBuild Access to AWS Services Required to Create a VPC Network Interface<a name="customer-managed-policies-example-create-vpc-network-interface"></a>
313313

314-
The following example policy statement grants AWS CodeBuild permission to create a network interface in an Amazon VPC:
314+
The following example policy statement grants AWS CodeBuild permission to create a network interface in an Amazon VPC with two subnets:
315315

316316
```
317317
{
@@ -335,11 +335,12 @@ The following example policy statement grants AWS CodeBuild permission to create
335335
"Action": [
336336
"ec2:CreateNetworkInterfacePermission"
337337
],
338-
"Resource": "arn:aws:ec2:{{region}}:{{account-id}}:network-interface/*",
338+
"Resource": "arn:aws:ec2:region:account-id:network-interface/*",
339339
"Condition": {
340340
"StringEquals": {
341341
"ec2:Subnet": [
342-
"arn:aws:ec2:{{region}}:{{account-id}}:subnet/[[subnets]]"
342+
"arn:aws:ec2:region:account-id:subnet/subnet-id-1",
343+
"arn:aws:ec2:region:account-id:subnet/subnet-id-2"
343344
],
344345
"ec2:AuthorizedService": "codebuild.amazonaws.com"
345346
}

doc_source/build-caching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ CodeBuildProject:
8282
Environment:
8383
Type: LINUX_CONTAINER
8484
ComputeType: BUILD_GENERAL1_SMALL
85-
Image: aws/codebuild/standard:1.0
85+
Image: aws/codebuild/standard:2.0
8686
Certificate: bucket/cert.zip
8787
# PrivilegedMode must be true if you specify LOCAL_DOCKER_LAYER_CACHE
8888
PrivilegedMode: true

doc_source/build-env-ref-available.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@ AWS CodeBuild manages the following Docker images that are available in the Code
77

88
| Platform | Programming language or framework | Image identifier | Definition |
99
| --- | --- | --- | --- |
10+
| Ubuntu 18\.04 | \(Standard image\) | aws/codebuild/standard:2\.0 | [ubuntu/standard/2\.0](https://github.com/aws/aws-codebuild-docker-images/tree/master/ubuntu/standard/2.0) |
1011
| Ubuntu 18\.04 | \(Standard image\) | aws/codebuild/standard:1\.0 | [ubuntu/standard/1\.0](https://github.com/aws/aws-codebuild-docker-images/tree/master/ubuntu/standard/1.0) |
1112
| Windows Server Core 2016 | \(Base Image\) | aws/codebuild/windows\-base:1\.0 | N/A |
1213

13-
The standard image of the Ubuntu 18\.04 platform contains the following programming languages:
14+
The standard image of the Ubuntu 18\.04 platform contains the following programming languages\. If you use the Ubuntu Standard image 2\.0, you can specify your runtime in the `runtime-versions` section of your buildspec file\. For more information, see [Specify Runtime Versions in the Buildspec File](build-spec-ref.md#runtime-versions-buildspec-file)\.
1415

1516

1617
****
1718

18-
| Programming language | Runtime version |
19+
| Programming language | Runtime version/versions |
1920
| --- | --- |
2021
| Ruby | 2\.x |
2122
| Python | 3\.x |
2223
| PHP | 7\.x |
23-
| Node | 10\.x |
24-
| Java | 8 |
24+
| Node | 8\.x, 10\.x |
25+
| Java | 8, 11 |
2526
| Golang | 1\.x |
2627
| \.NET Core | 2\.x |
2728
| Docker | 18\.x |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AWS CodeBuild provides several environment variables that you can use in your bu
55
+ `AWS_REGION`: The AWS Region where the build is running \(for example, `us-east-1`\)\. This environment variable is used primarily by the AWS SDKs\.
66
+ `CODEBUILD_BUILD_ARN`: The Amazon Resource Name \(ARN\) of the build \(for example, `arn:aws:codebuild:region-ID:account-ID:build/codebuild-demo-project:b1e6661e-e4f2-4156-9ab9-82a19EXAMPLE`\)\.
77
+ `CODEBUILD_BUILD_ID`: The CodeBuild ID of the build \(for example, `codebuild-demo-project:b1e6661e-e4f2-4156-9ab9-82a19EXAMPLE`\)\.
8-
+ `CODEBUILD_BUILD_IMAGE`: The CodeBuild build image identifier \(for example, `aws/codebuild/standard:1.0`\)\.
8+
+ `CODEBUILD_BUILD_IMAGE`: The CodeBuild build image identifier \(for example, `aws/codebuild/standard:2.0`\)\.
99
+ `CODEBUILD_BUILD_SUCCEEDING`: Whether the current build is succeeding\. Set to `0` if the build is failing, or `1` if the build is succeeding\.
1010
+ `CODEBUILD_INITIATOR`: The entity that started the build\. If CodePipeline started the build, this is the pipeline's name \(for example, `codepipeline/my-demo-pipeline`\)\. If an IAM user started the build, this is the user's name \(for example, `MyUserName`\)\. If the Jenkins plugin for CodeBuild started the build, this is the string `CodeBuild-Jenkins-Plugin`\.
1111
+ `CODEBUILD_KMS_KEY_ID`: The identifier of the AWS KMS key that CodeBuild is using to encrypt the build output artifact \(for example, `arn:aws:kms:region-ID:account-ID:key/key-ID` or `alias/key-alias`\)\.

doc_source/build-spec-ref.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ To override the default build spec file name, location, or both, do one of the f
2727

2828
Build spec files must be expressed in [YAML](http://yaml.org/) format\.
2929

30+
**Important**
31+
If you use the Ubuntu standard image 2\.0 or later, you must specify `runtime-versions` in your buildspec file\. For more information, see [Specify Runtime Versions in the Buildspec File](#runtime-versions-buildspec-file)\.
32+
3033
The build spec has the following syntax:
3134

3235
```
@@ -45,6 +48,9 @@ env:
4548
phases:
4649
install:
4750
run-as: Linux-user-name
51+
runtime-versions:
52+
runtime: version
53+
runtime: version
4854
commands:
4955
- command
5056
- command
@@ -132,8 +138,24 @@ In build spec version 0\.1, CodeBuild runs each command in a separate instance o
132138
+ `run-as`: Optional sequence\. Use in a build phase to specify a Linux user that runs its commands\. If `run-as` is also specified globally for all commands at the top of the buildspec file, then the phase\-level user takes precedence\. For example, if globally `run-as` specifies User\-1, and for the `install` phase only a `run-as` statement specifies User\-2, then all commands in then buildspec file are run as User\-1 *except* commands in the `install` phase, which are run as User\-2\.
133139

134140
The allowed build phase names are:
135-
+ `install`: Optional sequence\. Represents the commands, if any, that CodeBuild runs during installation\. We recommend that you use the `install` phase only for installing packages in the build environment\. For example, you might use this phase to install a code testing framework such as Mocha or RSpec\.
136-
+ `commands`: Required sequence if `install` is specified\. Contains a sequence of scalars, where each scalar represents a single command that CodeBuild runs during installation\. CodeBuild runs each command, one at a time, in the order listed, from beginning to end\.
141+
+ `install`: Optional sequence\. Represents the commands, if any, that CodeBuild runs during installation\. We recommend that you use the `install` phase only for installing packages in the build environment\. For example, you might use this phase to install a code testing framework such as Mocha or RSpec\.<a name="runtime-versions-buildspec-file"></a>
142+
+ <a name="runtime-versions-in-build-spec"></a> `runtime-versions`: Required if using the Ubuntu Standard Image 2\.0\. A runtime version is not supported with a custom image or the Ubuntu Standard Image 1\.0\. If specified, at least one runtime must be included in this section\. Specify a runtime using a major version only, such as "java: openjdk11" or "ruby: 2\.6\." You can specify the runtime using a number or an environment variable\. For example, the following specifies that version 8 of `openjdk`, version 28 of `android`, and a version contained in an environment variable of `ruby` is installed\. For more information, see [Docker Images Provided by CodeBuild](build-env-ref-available.md)\.
143+
**Note**
144+
If you specify a `runtime-versions` section and use an image other than Ubuntu Standard Image 2\.0 or later, the build fails\.
145+
146+
```
147+
phases:
148+
install:
149+
runtime-versions:
150+
java: openjdk8
151+
android: 28
152+
ruby: "$MY_RUBY_VAR"
153+
```
154+
+ Some runtimes must include specific versions of other runtimes\. If a required runtime is not specified, the build fails\. For example, `android` version 28 requires version 8 of `openjdk`\. If `android: 28` is specified, and `openjdk: 8` is not, the build fails\.
155+
+ If two specified runtimes conflict, the build fails\. For example, `android: 8` and `java: openjdk11` conflict, so if both are specified, the build fails\.
156+
+ The following runtimes can be specified\.
157+
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)
158+
+ `commands`: Required sequence unless you specify `runtime-versions`\. Optional if you specify `runtime-versions`\. Contains a sequence of scalars, where each scalar represents a single command that CodeBuild runs during installation\. CodeBuild runs each command, one at a time, in the order listed, from beginning to end\.
137159
+ `pre_build`: Optional sequence\. Represents the commands, if any, that CodeBuild runs before the build\. For example, you might use this phase to sign in to Amazon ECR, or you might install npm dependencies\.
138160
+ `commands`: Required sequence if `pre_build` is specified\. Contains a sequence of scalars, where each scalar represents a single command that CodeBuild runs before the build\. CodeBuild runs each command, one at a time, in the order listed, from beginning to end\.
139161
+ `build`: Optional sequence\. Represents the commands, if any, that CodeBuild runs during the build\. For example, you might use this phase to run Mocha, RSpec, or sbt\.

doc_source/change-project.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ When you use the console to create or update a build project, you can create a C
5858
**Important**
5959
We recommend that you store parameters in Amazon EC2 Systems Manager Parameter Store with parameter names that start with `/CodeBuild/` \(for example, `/CodeBuild/dockerLoginPassword`\)\. You can use the CodeBuild console to create a parameter in Amazon EC2 Systems Manager\. Choose **Create a parameter**, and then follow the instructions\. \(In that dialog box, for **KMS key**, you can optionally specify the ARN of an AWS KMS key in your account\. Amazon EC2 Systems Manager uses this key to encrypt the parameter's value during storage and decrypt during retrieval\.\) If you use the CodeBuild console to create a parameter, the console starts the parameter name with `/CodeBuild/` as it is being stored\. For more information, see [Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) and [Systems Manager Parameter Store Console Walkthrough](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-walk.html#sysman-paramstore-console) in the *Amazon EC2 Systems Manager User Guide*\.
6060
If your build project refers to parameters stored in Amazon EC2 Systems Manager Parameter Store, the build project's service role must allow the `ssm:GetParameters` action\. If you chose **Create a service role in your account** earlier, then CodeBuild includes this action in the default service role for your build project automatically\. However, if you chose **Choose an existing service role from your account**, then you must include this action to your service role separately\.
61-
If your build project refers to parameters stored in Amazon EC2 Systems Manager Parameter Store with parameter names that do not start with `/CodeBuild/`, and you chose **Create a service role in your account**, then you must update that service role to allow access to parameter names that do not start with `/CodeBuild/`\. This is because that service role allows access only to parameter names that start with `/CodeBuild/`\.
61+
If your build project refers to parameters stored in Amazon EC2 Systems Manager Parameter Store with parameter names that do not start with `/CodeBuild/`, and you chose **Create a service role in your account**, then you must update that service role to allow access to parameter names that do not start with `/CodeBuild/`\. This is because that service role allows access only to parameter names that start with `/CodeBuild/`\.
62+
If you choose **Create a service role in your account**, the created service role includes permission to decrypt all parameters under the `/CodeBuild/` namespace in the Amazon EC2 Systems Manager Parameter Store\.
6263
Environment variables you set replace existing environment variables\. For example, if the Docker image already contains an environment variable named `MY_VAR` with a value of `my_value`, and you set an environment variable named `MY_VAR` with a value of `other_value`, then `my_value` is replaced by `other_value`\. Similarly, if the Docker image already contains an environment variable named `PATH` with a value of `/usr/local/sbin:/usr/local/bin`, and you set an environment variable named `PATH` with a value of `$PATH:/usr/share/ant/bin`, then `/usr/local/sbin:/usr/local/bin` is replaced by the literal value `$PATH:/usr/share/ant/bin`\.
6364
Do not set any environment variable with a name that begins with `CODEBUILD_`\. This prefix is reserved for internal use\.
6465
If an environment variable with the same name is defined in multiple places, its value is determined as follows:

doc_source/create-project.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ IMAGE\_TAG
100100
We recommend that you store parameters in Amazon EC2 Systems Manager Parameter Store with parameter names that start with `/CodeBuild/` \(for example, `/CodeBuild/dockerLoginPassword`\)\. You can use the CodeBuild console to create a parameter in Amazon EC2 Systems Manager\. Choose **Create parameter**, and then follow the instructions in the dialog box\. \(In that dialog box, for **KMS key**, you can optionally specify the ARN of an AWS KMS key in your account\. Amazon EC2 Systems Manager uses this key to encrypt the parameter's value during storage and decrypt during retrieval\.\) If you use the CodeBuild console to create a parameter, the console starts the parameter name with `/CodeBuild/` as it is being stored\. For more information, see [Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) and [Systems Manager Parameter Store Console Walkthrough](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-walk.html#sysman-paramstore-console) in the *Amazon EC2 Systems Manager User Guide*\.
101101
If your build project refers to parameters stored in Amazon EC2 Systems Manager Parameter Store, the build project's service role must allow the `ssm:GetParameters` action\. If you chose **New service role** earlier, then CodeBuild includes this action in the default service role for your build project automatically\. However, if you chose **Existing service role**, then you must include this action to your service role separately\.
102102
If your build project refers to parameters stored in Amazon EC2 Systems Manager Parameter Store with parameter names that do not start with `/CodeBuild/`, and you chose **New service role**, then you must update that service role to allow access to parameter names that do not start with `/CodeBuild/`\. This is because that service role allows access only to parameter names that start with `/CodeBuild/`\.
103+
If you choose **Create a service role in your account**, the created service role includes permission to decrypt all parameters under the `/CodeBuild/` namespace in the Amazon EC2 Systems Manager Parameter Store\.
103104
Environment variables you set replace existing environment variables\. For example, if the Docker image already contains an environment variable named `MY_VAR` with a value of `my_value`, and you set an environment variable named `MY_VAR` with a value of `other_value`, then `my_value` is replaced by `other_value`\. Similarly, if the Docker image already contains an environment variable named `PATH` with a value of `/usr/local/sbin:/usr/local/bin`, and you set an environment variable named `PATH` with a value of `$PATH:/usr/share/ant/bin`, then `/usr/local/sbin:/usr/local/bin` is replaced by the literal value `$PATH:/usr/share/ant/bin`\.
104105
Do not set any environment variable with a name that begins with `CODEBUILD_`\. This prefix is reserved for internal use\.
105106
If an environment variable with the same name is defined in multiple places, the value is determined as follows:
@@ -413,7 +414,7 @@ If you are using a region other than us\-east\-1, be sure to use it when you run
413414
If you are using a region other than us\-east\-1, be sure to use it when you run the command\.
414415
+ For the required `environment` object, information about this project's build environment settings\. These settings include:
415416
+ *environment\-type*: Required value\. The type of build environment\. Valid values are `LINUX_CONTAINER` and `WINDOWS_CONTAINER`\.
416-
+ *image*: Required value\. The Docker image identifier used by this build environment\. Typically, this identifier is expressed as *image\-name*:*tag*\. For example, in the Docker repository that CodeBuild uses to manage its Docker images, this could be `aws/codebuild/standard:1.0`\. In Docker Hub, `maven:3.3.9-jdk-8`\. In Amazon ECR, `account-id.dkr.ecr.region-id.amazonaws.com/your-Amazon-ECR-repo-name:tag`\. For more information, see [Docker Images Provided by CodeBuild](build-env-ref-available.md)\.
417+
+ *image*: Required value\. The Docker image identifier used by this build environment\. Typically, this identifier is expressed as *image\-name*:*tag*\. For example, in the Docker repository that CodeBuild uses to manage its Docker images, this could be `aws/codebuild/standard:2.0`\. In Docker Hub, `maven:3.3.9-jdk-8`\. In Amazon ECR, `account-id.dkr.ecr.region-id.amazonaws.com/your-Amazon-ECR-repo-name:tag`\. For more information, see [Docker Images Provided by CodeBuild](build-env-ref-available.md)\.
417418
+ *computeType*: Required value\. A category corresponding to the number of CPU cores and memory used by this build environment\. Allowed values include `BUILD_GENERAL1_SMALL`, `BUILD_GENERAL1_MEDIUM`, and `BUILD_GENERAL1_LARGE`\.
418419
+ *certificate*: Optional value\. The ARN of the S3 bucket, path prefix and object key that contains the PEM\-encoded certificate\. The object key can be either just the \.pem file or a \.zip file containing the pem\-encoded certificate\. For example, if your Amazon S3 bucket name is my\-bucket, your path prefix is cert, and your object key name is certificate\.pem, then acceptable formats for your *certificate* are my\-bucket/cert/certificate\.pem or arn:aws:s3:::my\-bucket/cert/certificate\.pem\.
419420
+ For the optional `environmentVariables` array, information about any environment variables you want to specify for this build environment\. Each environment variable is expressed as an object that contains a `name`, `value`, and `type` of *environmentVariable\-name*, *environmentVariable\-value*, and *environmentVariable\-type*\.

0 commit comments

Comments
 (0)