@@ -62,48 +62,62 @@ final class ProjectEnvironment
6262 /**
6363 * Information about the compute resources the build project uses. Available values include:
6464 *
65- * - `BUILD_GENERAL1_SMALL`: Use up to 3 GB memory and 2 vCPUs for builds.
66- * - `BUILD_GENERAL1_MEDIUM`: Use up to 7 GB memory and 4 vCPUs for builds.
67- * - `BUILD_GENERAL1_LARGE`: Use up to 16 GB memory and 8 vCPUs for builds, depending on your environment type.
68- * - `BUILD_GENERAL1_XLARGE`: Use up to 70 GB memory and 36 vCPUs for builds, depending on your environment type.
69- * - `BUILD_GENERAL1_2XLARGE`: Use up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute
65+ * - `ATTRIBUTE_BASED_COMPUTE`: Specify the amount of vCPUs, memory, disk space, and the type of machine.
66+ *
67+ * > If you use `ATTRIBUTE_BASED_COMPUTE`, you must define your attributes by using `computeConfiguration`. CodeBuild
68+ * > will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved
69+ * > capacity environment types [^1] in the *CodeBuild User Guide*.
70+ *
71+ * - `BUILD_GENERAL1_SMALL`: Use up to 4 GiB memory and 2 vCPUs for builds.
72+ * - `BUILD_GENERAL1_MEDIUM`: Use up to 8 GiB memory and 4 vCPUs for builds.
73+ * - `BUILD_GENERAL1_LARGE`: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type.
74+ * - `BUILD_GENERAL1_XLARGE`: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type.
75+ * - `BUILD_GENERAL1_2XLARGE`: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute
7076 * type supports Docker images up to 100 GB uncompressed.
71- * - `BUILD_LAMBDA_1GB`: Use up to 1 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
77+ * - `BUILD_LAMBDA_1GB`: Use up to 1 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7278 * and `ARM_LAMBDA_CONTAINER`.
73- * - `BUILD_LAMBDA_2GB`: Use up to 2 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
79+ * - `BUILD_LAMBDA_2GB`: Use up to 2 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7480 * and `ARM_LAMBDA_CONTAINER`.
75- * - `BUILD_LAMBDA_4GB`: Use up to 4 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
81+ * - `BUILD_LAMBDA_4GB`: Use up to 4 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7682 * and `ARM_LAMBDA_CONTAINER`.
77- * - `BUILD_LAMBDA_8GB`: Use up to 8 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
83+ * - `BUILD_LAMBDA_8GB`: Use up to 8 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7884 * and `ARM_LAMBDA_CONTAINER`.
79- * - `BUILD_LAMBDA_10GB`: Use up to 10 GB memory for builds. Only available for environment type
85+ * - `BUILD_LAMBDA_10GB`: Use up to 10 GiB memory for builds. Only available for environment type
8086 * `LINUX_LAMBDA_CONTAINER` and `ARM_LAMBDA_CONTAINER`.
8187 *
8288 * If you use `BUILD_GENERAL1_SMALL`:
8389 *
84- * - For environment type `LINUX_CONTAINER`, you can use up to 3 GB memory and 2 vCPUs for builds.
85- * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core
90+ * - For environment type `LINUX_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs for builds.
91+ * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core
8692 * GPU for builds.
87- * - For environment type `ARM_CONTAINER`, you can use up to 4 GB memory and 2 vCPUs on ARM-based processors for builds.
93+ * - For environment type `ARM_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for
94+ * builds.
8895 *
8996 * If you use `BUILD_GENERAL1_LARGE`:
9097 *
91- * - For environment type `LINUX_CONTAINER`, you can use up to 15 GB memory and 8 vCPUs for builds.
92- * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs
93- * for builds.
94- * - For environment type `ARM_CONTAINER`, you can use up to 16 GB memory and 8 vCPUs on ARM-based processors for
98+ * - For environment type `LINUX_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs for builds.
99+ * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100
100+ * GPUs for builds.
101+ * - For environment type `ARM_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for
95102 * builds.
96103 *
97- * > If you're using compute fleets during project creation, `computeType` will be ignored.
104+ * For more information, see On-demand environment types [^2] in the *CodeBuild User Guide.*
98105 *
99- * For more information, see Build Environment Compute Types [^1] in the *CodeBuild User Guide.*
100- *
101- * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html
106+ * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types
107+ * [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
102108 *
103109 * @var ComputeType::*
104110 */
105111 private $ computeType ;
106112
113+ /**
114+ * The compute configuration of the build project. This is only required if `computeType` is set to
115+ * `ATTRIBUTE_BASED_COMPUTE`.
116+ *
117+ * @var ComputeConfiguration|null
118+ */
119+ private $ computeConfiguration ;
120+
107121 /**
108122 * A ProjectFleet object to use for this build project.
109123 *
@@ -181,6 +195,7 @@ final class ProjectEnvironment
181195 * type: EnvironmentType::*,
182196 * image: string,
183197 * computeType: ComputeType::*,
198+ * computeConfiguration?: null|ComputeConfiguration|array,
184199 * fleet?: null|ProjectFleet|array,
185200 * environmentVariables?: null|array<EnvironmentVariable|array>,
186201 * privilegedMode?: null|bool,
@@ -194,6 +209,7 @@ public function __construct(array $input)
194209 $ this ->type = $ input ['type ' ] ?? $ this ->throwException (new InvalidArgument ('Missing required field "type". ' ));
195210 $ this ->image = $ input ['image ' ] ?? $ this ->throwException (new InvalidArgument ('Missing required field "image". ' ));
196211 $ this ->computeType = $ input ['computeType ' ] ?? $ this ->throwException (new InvalidArgument ('Missing required field "computeType". ' ));
212+ $ this ->computeConfiguration = isset ($ input ['computeConfiguration ' ]) ? ComputeConfiguration::create ($ input ['computeConfiguration ' ]) : null ;
197213 $ this ->fleet = isset ($ input ['fleet ' ]) ? ProjectFleet::create ($ input ['fleet ' ]) : null ;
198214 $ this ->environmentVariables = isset ($ input ['environmentVariables ' ]) ? array_map ([EnvironmentVariable::class, 'create ' ], $ input ['environmentVariables ' ]) : null ;
199215 $ this ->privilegedMode = $ input ['privilegedMode ' ] ?? null ;
@@ -207,6 +223,7 @@ public function __construct(array $input)
207223 * type: EnvironmentType::*,
208224 * image: string,
209225 * computeType: ComputeType::*,
226+ * computeConfiguration?: null|ComputeConfiguration|array,
210227 * fleet?: null|ProjectFleet|array,
211228 * environmentVariables?: null|array<EnvironmentVariable|array>,
212229 * privilegedMode?: null|bool,
@@ -225,6 +242,11 @@ public function getCertificate(): ?string
225242 return $ this ->certificate ;
226243 }
227244
245+ public function getComputeConfiguration (): ?ComputeConfiguration
246+ {
247+ return $ this ->computeConfiguration ;
248+ }
249+
228250 /**
229251 * @return ComputeType::*
230252 */
0 commit comments