Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/Service/CodeBuild/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/Service/CodeBuild/src/Enum/ComputeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
17 changes: 17 additions & 0 deletions src/Service/CodeBuild/src/Enum/MachineType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AsyncAws\CodeBuild\Enum;

final class MachineType
{
public const GENERAL = 'GENERAL';
public const NVME = 'NVME';

public static function exists(string $value): bool
{
return isset([
self::GENERAL => true,
self::NVME => true,
][$value]);
}
}
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/BatchGetBuildsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/StartBuildOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/Service/CodeBuild/src/Result/StopBuildOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down
92 changes: 92 additions & 0 deletions src/Service/CodeBuild/src/ValueObject/ComputeConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php

namespace AsyncAws\CodeBuild\ValueObject;

use AsyncAws\CodeBuild\Enum\MachineType;

/**
* Contains compute attributes. These attributes only need be specified when your project's or fleet's `computeType` is
* set to `ATTRIBUTE_BASED_COMPUTE`.
*/
final class ComputeConfiguration
{
/**
* The number of vCPUs of the instance type included in your fleet.
*
* @var int|null
*/
private $vCpu;

/**
* The amount of memory of the instance type included in your fleet.
*
* @var int|null
*/
private $memory;

/**
* The amount of disk space of the instance type included in your fleet.
*
* @var int|null
*/
private $disk;

/**
* The machine type of the instance type included in your fleet.
*
* @var MachineType::*|null
*/
private $machineType;

/**
* @param array{
* vCpu?: null|int,
* memory?: null|int,
* disk?: null|int,
* machineType?: null|MachineType::*,
* } $input
*/
public function __construct(array $input)
{
$this->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;
}
}
64 changes: 43 additions & 21 deletions src/Service/CodeBuild/src/ValueObject/ProjectEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -181,6 +195,7 @@ final class ProjectEnvironment
* type: EnvironmentType::*,
* image: string,
* computeType: ComputeType::*,
* computeConfiguration?: null|ComputeConfiguration|array,
* fleet?: null|ProjectFleet|array,
* environmentVariables?: null|array<EnvironmentVariable|array>,
* privilegedMode?: null|bool,
Expand All @@ -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;
Expand All @@ -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<EnvironmentVariable|array>,
* privilegedMode?: null|bool,
Expand All @@ -225,6 +242,11 @@ public function getCertificate(): ?string
return $this->certificate;
}

public function getComputeConfiguration(): ?ComputeConfiguration
{
return $this->computeConfiguration;
}

/**
* @return ComputeType::*
*/
Expand Down
Loading