diff --git a/manifest.json b/manifest.json index e72617e05..241f47802 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.325.1" + "${LATEST}": "3.325.3" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/CodeBuild/CHANGELOG.md b/src/Service/CodeBuild/CHANGELOG.md index 6d83cd291..f06b1c155 100644 --- a/src/Service/CodeBuild/CHANGELOG.md +++ b/src/Service/CodeBuild/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - AWS api-change: AWS CodeBuild now supports automatically retrying failed builds +- AWS api-change: AWS CodeBuild now adds additional compute types for reserved capacity fleet. ## 2.5.0 diff --git a/src/Service/CodeBuild/src/Enum/ComputeType.php b/src/Service/CodeBuild/src/Enum/ComputeType.php index dd81dc314..c8bd25723 100644 --- a/src/Service/CodeBuild/src/Enum/ComputeType.php +++ b/src/Service/CodeBuild/src/Enum/ComputeType.php @@ -4,6 +4,7 @@ final class ComputeType { + public const ATTRIBUTE_BASED_COMPUTE = 'ATTRIBUTE_BASED_COMPUTE'; public const BUILD_GENERAL1_2XLARGE = 'BUILD_GENERAL1_2XLARGE'; public const BUILD_GENERAL1_LARGE = 'BUILD_GENERAL1_LARGE'; public const BUILD_GENERAL1_MEDIUM = 'BUILD_GENERAL1_MEDIUM'; @@ -18,6 +19,7 @@ final class ComputeType public static function exists(string $value): bool { return isset([ + self::ATTRIBUTE_BASED_COMPUTE => true, self::BUILD_GENERAL1_2XLARGE => true, self::BUILD_GENERAL1_LARGE => true, self::BUILD_GENERAL1_MEDIUM => true, diff --git a/src/Service/CodeBuild/src/Enum/MachineType.php b/src/Service/CodeBuild/src/Enum/MachineType.php new file mode 100644 index 000000000..a01ef619e --- /dev/null +++ b/src/Service/CodeBuild/src/Enum/MachineType.php @@ -0,0 +1,17 @@ + true, + self::NVME => true, + ][$value]); + } +} diff --git a/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php b/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php index 45a9994cb..482db3f35 100644 --- a/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php +++ b/src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php @@ -9,6 +9,7 @@ use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; @@ -235,6 +236,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -367,6 +378,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, diff --git a/src/Service/CodeBuild/src/Result/StartBuildOutput.php b/src/Service/CodeBuild/src/Result/StartBuildOutput.php index 0ba6e9005..e9c5b05d8 100644 --- a/src/Service/CodeBuild/src/Result/StartBuildOutput.php +++ b/src/Service/CodeBuild/src/Result/StartBuildOutput.php @@ -9,6 +9,7 @@ use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; @@ -185,6 +186,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -317,6 +328,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, diff --git a/src/Service/CodeBuild/src/Result/StopBuildOutput.php b/src/Service/CodeBuild/src/Result/StopBuildOutput.php index 5e293588e..39f8d9e42 100644 --- a/src/Service/CodeBuild/src/Result/StopBuildOutput.php +++ b/src/Service/CodeBuild/src/Result/StopBuildOutput.php @@ -9,6 +9,7 @@ use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; @@ -185,6 +186,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -317,6 +328,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, diff --git a/src/Service/CodeBuild/src/ValueObject/ComputeConfiguration.php b/src/Service/CodeBuild/src/ValueObject/ComputeConfiguration.php new file mode 100644 index 000000000..c19ac3ce5 --- /dev/null +++ b/src/Service/CodeBuild/src/ValueObject/ComputeConfiguration.php @@ -0,0 +1,92 @@ +vCpu = $input['vCpu'] ?? null; + $this->memory = $input['memory'] ?? null; + $this->disk = $input['disk'] ?? null; + $this->machineType = $input['machineType'] ?? null; + } + + /** + * @param array{ + * vCpu?: null|int, + * memory?: null|int, + * disk?: null|int, + * machineType?: null|MachineType::*, + * }|ComputeConfiguration $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getDisk(): ?int + { + return $this->disk; + } + + /** + * @return MachineType::*|null + */ + public function getMachineType(): ?string + { + return $this->machineType; + } + + public function getMemory(): ?int + { + return $this->memory; + } + + public function getVCpu(): ?int + { + return $this->vCpu; + } +} diff --git a/src/Service/CodeBuild/src/ValueObject/ProjectEnvironment.php b/src/Service/CodeBuild/src/ValueObject/ProjectEnvironment.php index 9ae5f8aa7..1faf59e3c 100644 --- a/src/Service/CodeBuild/src/ValueObject/ProjectEnvironment.php +++ b/src/Service/CodeBuild/src/ValueObject/ProjectEnvironment.php @@ -62,48 +62,62 @@ final class ProjectEnvironment /** * Information about the compute resources the build project uses. Available values include: * - * - `BUILD_GENERAL1_SMALL`: Use up to 3 GB memory and 2 vCPUs for builds. - * - `BUILD_GENERAL1_MEDIUM`: Use up to 7 GB memory and 4 vCPUs for builds. - * - `BUILD_GENERAL1_LARGE`: Use up to 16 GB memory and 8 vCPUs for builds, depending on your environment type. - * - `BUILD_GENERAL1_XLARGE`: Use up to 70 GB memory and 36 vCPUs for builds, depending on your environment type. - * - `BUILD_GENERAL1_2XLARGE`: Use up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute + * - `ATTRIBUTE_BASED_COMPUTE`: Specify the amount of vCPUs, memory, disk space, and the type of machine. + * + * > If you use `ATTRIBUTE_BASED_COMPUTE`, you must define your attributes by using `computeConfiguration`. CodeBuild + * > will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved + * > capacity environment types [^1] in the *CodeBuild User Guide*. + * + * - `BUILD_GENERAL1_SMALL`: Use up to 4 GiB memory and 2 vCPUs for builds. + * - `BUILD_GENERAL1_MEDIUM`: Use up to 8 GiB memory and 4 vCPUs for builds. + * - `BUILD_GENERAL1_LARGE`: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type. + * - `BUILD_GENERAL1_XLARGE`: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type. + * - `BUILD_GENERAL1_2XLARGE`: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute * type supports Docker images up to 100 GB uncompressed. - * - `BUILD_LAMBDA_1GB`: Use up to 1 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_1GB`: Use up to 1 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_2GB`: Use up to 2 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_2GB`: Use up to 2 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_4GB`: Use up to 4 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_4GB`: Use up to 4 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_8GB`: Use up to 8 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_8GB`: Use up to 8 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_10GB`: Use up to 10 GB memory for builds. Only available for environment type + * - `BUILD_LAMBDA_10GB`: Use up to 10 GiB memory for builds. Only available for environment type * `LINUX_LAMBDA_CONTAINER` and `ARM_LAMBDA_CONTAINER`. * * If you use `BUILD_GENERAL1_SMALL`: * - * - For environment type `LINUX_CONTAINER`, you can use up to 3 GB memory and 2 vCPUs for builds. - * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core + * - For environment type `LINUX_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs for builds. + * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core * GPU for builds. - * - For environment type `ARM_CONTAINER`, you can use up to 4 GB memory and 2 vCPUs on ARM-based processors for builds. + * - For environment type `ARM_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for + * builds. * * If you use `BUILD_GENERAL1_LARGE`: * - * - For environment type `LINUX_CONTAINER`, you can use up to 15 GB memory and 8 vCPUs for builds. - * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs - * for builds. - * - For environment type `ARM_CONTAINER`, you can use up to 16 GB memory and 8 vCPUs on ARM-based processors for + * - For environment type `LINUX_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs for builds. + * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 + * GPUs for builds. + * - For environment type `ARM_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for * builds. * - * > If you're using compute fleets during project creation, `computeType` will be ignored. + * For more information, see On-demand environment types [^2] in the *CodeBuild User Guide.* * - * For more information, see Build Environment Compute Types [^1] in the *CodeBuild User Guide.* - * - * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + * [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types * * @var ComputeType::* */ private $computeType; + /** + * The compute configuration of the build project. This is only required if `computeType` is set to + * `ATTRIBUTE_BASED_COMPUTE`. + * + * @var ComputeConfiguration|null + */ + private $computeConfiguration; + /** * A ProjectFleet object to use for this build project. * @@ -181,6 +195,7 @@ final class ProjectEnvironment * type: EnvironmentType::*, * image: string, * computeType: ComputeType::*, + * computeConfiguration?: null|ComputeConfiguration|array, * fleet?: null|ProjectFleet|array, * environmentVariables?: null|array, * privilegedMode?: null|bool, @@ -194,6 +209,7 @@ public function __construct(array $input) $this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".')); $this->image = $input['image'] ?? $this->throwException(new InvalidArgument('Missing required field "image".')); $this->computeType = $input['computeType'] ?? $this->throwException(new InvalidArgument('Missing required field "computeType".')); + $this->computeConfiguration = isset($input['computeConfiguration']) ? ComputeConfiguration::create($input['computeConfiguration']) : null; $this->fleet = isset($input['fleet']) ? ProjectFleet::create($input['fleet']) : null; $this->environmentVariables = isset($input['environmentVariables']) ? array_map([EnvironmentVariable::class, 'create'], $input['environmentVariables']) : null; $this->privilegedMode = $input['privilegedMode'] ?? null; @@ -207,6 +223,7 @@ public function __construct(array $input) * type: EnvironmentType::*, * image: string, * computeType: ComputeType::*, + * computeConfiguration?: null|ComputeConfiguration|array, * fleet?: null|ProjectFleet|array, * environmentVariables?: null|array, * privilegedMode?: null|bool, @@ -225,6 +242,11 @@ public function getCertificate(): ?string return $this->certificate; } + public function getComputeConfiguration(): ?ComputeConfiguration + { + return $this->computeConfiguration; + } + /** * @return ComputeType::* */