From a2286afbde689bdbfc3bb51aee55eb9d520e36d4 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:46:33 -0700 Subject: [PATCH 01/22] Update generated code (#1786) update generated code --- CHANGELOG.md | 4 ++ composer.json | 2 +- src/CodeBuildClient.php | 1 + src/Input/StartBuildInput.php | 26 +++++++++ src/Result/BatchGetBuildsOutput.php | 12 ++++ src/Result/StartBuildOutput.php | 12 ++++ src/Result/StopBuildOutput.php | 12 ++++ src/ValueObject/AutoRetryConfig.php | 89 +++++++++++++++++++++++++++++ src/ValueObject/Build.php | 15 +++++ 9 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 src/ValueObject/AutoRetryConfig.php diff --git a/CHANGELOG.md b/CHANGELOG.md index fb174de..6d83cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds + ## 2.5.0 ### Added diff --git a/composer.json b/composer.json index 4577409..91ac15e 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } } } diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 27bce9f..2b1f60f 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -101,6 +101,7 @@ public function batchGetBuilds($input): BatchGetBuildsOutput * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * }|StartBuildInput $input * diff --git a/src/Input/StartBuildInput.php b/src/Input/StartBuildInput.php index 72877a9..f3e524f 100644 --- a/src/Input/StartBuildInput.php +++ b/src/Input/StartBuildInput.php @@ -335,6 +335,14 @@ final class StartBuildInput extends Input */ private $fleetOverride; + /** + * The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set + * to 2, CodeBuild will call the `RetryBuild` API to automatically retry your build for up to 2 additional times. + * + * @var int|null + */ + private $autoRetryLimitOverride; + /** * @param array{ * projectName?: string, @@ -369,6 +377,7 @@ final class StartBuildInput extends Input * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * } $input */ @@ -406,6 +415,7 @@ public function __construct(array $input = []) $this->imagePullCredentialsTypeOverride = $input['imagePullCredentialsTypeOverride'] ?? null; $this->debugSessionEnabled = $input['debugSessionEnabled'] ?? null; $this->fleetOverride = isset($input['fleetOverride']) ? ProjectFleet::create($input['fleetOverride']) : null; + $this->autoRetryLimitOverride = $input['autoRetryLimitOverride'] ?? null; parent::__construct($input); } @@ -443,6 +453,7 @@ public function __construct(array $input = []) * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * }|StartBuildInput $input */ @@ -456,6 +467,11 @@ public function getArtifactsOverride(): ?ProjectArtifacts return $this->artifactsOverride; } + public function getAutoRetryLimitOverride(): ?int + { + return $this->autoRetryLimitOverride; + } + public function getBuildStatusConfigOverride(): ?BuildStatusConfig { return $this->buildStatusConfigOverride; @@ -668,6 +684,13 @@ public function setArtifactsOverride(?ProjectArtifacts $value): self return $this; } + public function setAutoRetryLimitOverride(?int $value): self + { + $this->autoRetryLimitOverride = $value; + + return $this; + } + public function setBuildStatusConfigOverride(?BuildStatusConfig $value): self { $this->buildStatusConfigOverride = $value; @@ -1041,6 +1064,9 @@ private function requestBody(): array if (null !== $v = $this->fleetOverride) { $payload['fleetOverride'] = $v->requestBody(); } + if (null !== $v = $this->autoRetryLimitOverride) { + $payload['autoRetryLimitOverride'] = $v; + } return $payload; } diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index d51c873..45a9994 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/src/Result/BatchGetBuildsOutput.php @@ -3,6 +3,7 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; @@ -72,6 +73,16 @@ protected function populateResult(Response $response): void $this->buildsNotFound = empty($data['buildsNotFound']) ? [] : $this->populateResultBuildIds($data['buildsNotFound']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -107,6 +118,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } diff --git a/src/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index 9d69a77..0ba6e90 100644 --- a/src/Result/StartBuildOutput.php +++ b/src/Result/StartBuildOutput.php @@ -3,6 +3,7 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; @@ -51,6 +52,16 @@ protected function populateResult(Response $response): void $this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } diff --git a/src/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index 4ce4531..5e29358 100644 --- a/src/Result/StopBuildOutput.php +++ b/src/Result/StopBuildOutput.php @@ -3,6 +3,7 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; @@ -51,6 +52,16 @@ protected function populateResult(Response $response): void $this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } diff --git a/src/ValueObject/AutoRetryConfig.php b/src/ValueObject/AutoRetryConfig.php new file mode 100644 index 0000000..060a640 --- /dev/null +++ b/src/ValueObject/AutoRetryConfig.php @@ -0,0 +1,89 @@ +autoRetryLimit = $input['autoRetryLimit'] ?? null; + $this->autoRetryNumber = $input['autoRetryNumber'] ?? null; + $this->nextAutoRetry = $input['nextAutoRetry'] ?? null; + $this->previousAutoRetry = $input['previousAutoRetry'] ?? null; + } + + /** + * @param array{ + * autoRetryLimit?: null|int, + * autoRetryNumber?: null|int, + * nextAutoRetry?: null|string, + * previousAutoRetry?: null|string, + * }|AutoRetryConfig $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getAutoRetryLimit(): ?int + { + return $this->autoRetryLimit; + } + + public function getAutoRetryNumber(): ?int + { + return $this->autoRetryNumber; + } + + public function getNextAutoRetry(): ?string + { + return $this->nextAutoRetry; + } + + public function getPreviousAutoRetry(): ?string + { + return $this->previousAutoRetry; + } +} diff --git a/src/ValueObject/Build.php b/src/ValueObject/Build.php index a3aadb4..3a1150b 100644 --- a/src/ValueObject/Build.php +++ b/src/ValueObject/Build.php @@ -282,6 +282,13 @@ final class Build */ private $buildBatchArn; + /** + * Information about the auto-retry configuration for the build. + * + * @var AutoRetryConfig|null + */ + private $autoRetryConfig; + /** * @param array{ * id?: null|string, @@ -316,6 +323,7 @@ final class Build * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * } $input */ public function __construct(array $input) @@ -352,6 +360,7 @@ public function __construct(array $input) $this->fileSystemLocations = isset($input['fileSystemLocations']) ? array_map([ProjectFileSystemLocation::class, 'create'], $input['fileSystemLocations']) : null; $this->debugSession = isset($input['debugSession']) ? DebugSession::create($input['debugSession']) : null; $this->buildBatchArn = $input['buildBatchArn'] ?? null; + $this->autoRetryConfig = isset($input['autoRetryConfig']) ? AutoRetryConfig::create($input['autoRetryConfig']) : null; } /** @@ -388,6 +397,7 @@ public function __construct(array $input) * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * }|Build $input */ public static function create($input): self @@ -405,6 +415,11 @@ public function getArtifacts(): ?BuildArtifacts return $this->artifacts; } + public function getAutoRetryConfig(): ?AutoRetryConfig + { + return $this->autoRetryConfig; + } + public function getBuildBatchArn(): ?string { return $this->buildBatchArn; From 15f37036e77a89136043d4445bfe209bfde8e665 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:55:59 -0800 Subject: [PATCH 02/22] Update generated code (#1789) update generated code --- CHANGELOG.md | 1 + src/Enum/ComputeType.php | 2 + src/Enum/MachineType.php | 17 +++++ src/Result/BatchGetBuildsOutput.php | 12 ++++ src/Result/StartBuildOutput.php | 12 ++++ src/Result/StopBuildOutput.php | 12 ++++ src/ValueObject/ComputeConfiguration.php | 92 ++++++++++++++++++++++++ src/ValueObject/ProjectEnvironment.php | 64 +++++++++++------ 8 files changed, 191 insertions(+), 21 deletions(-) create mode 100644 src/Enum/MachineType.php create mode 100644 src/ValueObject/ComputeConfiguration.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d83cd2..f06b1c1 100644 --- a/CHANGELOG.md +++ b/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/Enum/ComputeType.php b/src/Enum/ComputeType.php index dd81dc3..c8bd257 100644 --- a/src/Enum/ComputeType.php +++ b/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/Enum/MachineType.php b/src/Enum/MachineType.php new file mode 100644 index 0000000..a01ef61 --- /dev/null +++ b/src/Enum/MachineType.php @@ -0,0 +1,17 @@ + true, + self::NVME => true, + ][$value]); + } +} diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index 45a9994..482db3f 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/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/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index 0ba6e90..e9c5b05 100644 --- a/src/Result/StartBuildOutput.php +++ b/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/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index 5e29358..39f8d9e 100644 --- a/src/Result/StopBuildOutput.php +++ b/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/ValueObject/ComputeConfiguration.php b/src/ValueObject/ComputeConfiguration.php new file mode 100644 index 0000000..c19ac3c --- /dev/null +++ b/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/ValueObject/ProjectEnvironment.php b/src/ValueObject/ProjectEnvironment.php index 9ae5f8a..1faf59e 100644 --- a/src/ValueObject/ProjectEnvironment.php +++ b/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::* */ From 43c63f1d94165fdb56caddf1bcdb7fda22e97ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 11 Nov 2024 11:35:53 +0100 Subject: [PATCH 03/22] Upgrade github actions (#1792) --- .github/workflows/checks.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c767322..b9c47e8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 346792d..9ed2af1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize tests run: make initialize From 9cd0c1b7c5b05b5d46fec2f7a2f71e3d3b74e6e3 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 13 Nov 2024 00:23:55 -0800 Subject: [PATCH 04/22] Update generated code (#1798) update generated code --- CHANGELOG.md | 1 + src/Enum/EnvironmentType.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f06b1c1..295a8fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - 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. +- AWS api-change: AWS CodeBuild now supports non-containerized Linux and Windows builds on Reserved Capacity. ## 2.5.0 diff --git a/src/Enum/EnvironmentType.php b/src/Enum/EnvironmentType.php index 137412a..64b3884 100644 --- a/src/Enum/EnvironmentType.php +++ b/src/Enum/EnvironmentType.php @@ -5,24 +5,30 @@ final class EnvironmentType { public const ARM_CONTAINER = 'ARM_CONTAINER'; + public const ARM_EC2 = 'ARM_EC2'; public const ARM_LAMBDA_CONTAINER = 'ARM_LAMBDA_CONTAINER'; public const LINUX_CONTAINER = 'LINUX_CONTAINER'; + public const LINUX_EC2 = 'LINUX_EC2'; public const LINUX_GPU_CONTAINER = 'LINUX_GPU_CONTAINER'; public const LINUX_LAMBDA_CONTAINER = 'LINUX_LAMBDA_CONTAINER'; public const MAC_ARM = 'MAC_ARM'; public const WINDOWS_CONTAINER = 'WINDOWS_CONTAINER'; + public const WINDOWS_EC2 = 'WINDOWS_EC2'; public const WINDOWS_SERVER_2019_CONTAINER = 'WINDOWS_SERVER_2019_CONTAINER'; public static function exists(string $value): bool { return isset([ self::ARM_CONTAINER => true, + self::ARM_EC2 => true, self::ARM_LAMBDA_CONTAINER => true, self::LINUX_CONTAINER => true, + self::LINUX_EC2 => true, self::LINUX_GPU_CONTAINER => true, self::LINUX_LAMBDA_CONTAINER => true, self::MAC_ARM => true, self::WINDOWS_CONTAINER => true, + self::WINDOWS_EC2 => true, self::WINDOWS_SERVER_2019_CONTAINER => true, ][$value]); } From 1bc276ef42e0ca9514bcb0a98ea692ccd3ef496d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 24 Nov 2024 12:42:17 +0100 Subject: [PATCH 05/22] prepare next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 295a8fe..9039b89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.6.0 + ### Added - AWS api-change: AWS CodeBuild now supports automatically retrying failed builds From 7fd9a52209609742df3c24c70e91cf908afbe157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 24 Nov 2024 18:57:34 +0100 Subject: [PATCH 06/22] Add support for php 8.5 (#1808) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed2af1..0778da5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Set up PHP From d7a136533e4f2beb9b5f31ce79bb401b89235d9e Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Sat, 14 Dec 2024 01:40:41 -0800 Subject: [PATCH 07/22] Update generated code (#1817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/CodeBuildClient.php | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9039b89..ce7c3dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Added `us-iso-east-1` and `us-iso-west-1` regions. + ## 2.6.0 ### Added diff --git a/composer.json b/composer.json index 91ac15e..a096ffd 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } } } diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 2b1f60f..580f77e 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -208,6 +208,14 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'codebuild', 'signVersions' => ['v4'], ]; + case 'us-iso-east-1': + case 'us-iso-west-1': + return [ + 'endpoint' => "https://codebuild.$region.c2s.ic.gov", + 'signRegion' => $region, + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; } return [ From 9ab6211807a91d2552a3bfe4f49a22b4a3287059 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Thu, 9 Jan 2025 23:40:59 -0800 Subject: [PATCH 08/22] Update generated code (#1827) update generated code --- CHANGELOG.md | 4 ++++ src/Input/StartBuildInput.php | 3 ++- src/ValueObject/ProjectSource.php | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7c3dc..e9c6768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - AWS api-change: Added `us-iso-east-1` and `us-iso-west-1` regions. +### Changed + +- AWS enhancement: Documentation updates. + ## 2.6.0 ### Added diff --git a/src/Input/StartBuildInput.php b/src/Input/StartBuildInput.php index f3e524f..f968899 100644 --- a/src/Input/StartBuildInput.php +++ b/src/Input/StartBuildInput.php @@ -177,7 +177,8 @@ final class StartBuildInput extends Input /** * Set to true to report to your source provider the status of a build's start and completion. If you use this option - * with a source provider other than GitHub, GitHub Enterprise, or Bitbucket, an `invalidInputException` is thrown. + * with a source provider other than GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket, an + * `invalidInputException` is thrown. * * To be able to report the build status to the source provider, the user associated with the source provider must have * write access to the repo. If the user does not have write access, the build status cannot be updated. For more diff --git a/src/ValueObject/ProjectSource.php b/src/ValueObject/ProjectSource.php index fd10871..0be67d1 100644 --- a/src/ValueObject/ProjectSource.php +++ b/src/ValueObject/ProjectSource.php @@ -111,8 +111,8 @@ final class ProjectSource /** * Set to true to report the status of a build's start and finish to your source provider. This option is valid only - * when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket. If this is set and - * you use a different source provider, an `invalidInputException` is thrown. + * when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, GitLab, GitLab Self Managed, or + * Bitbucket. If this is set and you use a different source provider, an `invalidInputException` is thrown. * * To be able to report the build status to the source provider, the user associated with the source provider must have * write access to the repo. If the user does not have write access, the build status cannot be updated. For more From 23e1c7b5449a0740283e350e3822ec7cf909dbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Wed, 15 Jan 2025 10:28:33 +0100 Subject: [PATCH 09/22] prepare next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c6768..7c53a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.7.0 + ### Added - AWS api-change: Added `us-iso-east-1` and `us-iso-west-1` regions. From 31efecc85bd140e63d0de45736714f83233fd729 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 5 Feb 2025 02:54:55 -0800 Subject: [PATCH 10/22] Update generated code (#1841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/CodeBuildClient.php | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c53a96..c6a2d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions + ## 2.7.0 ### Added diff --git a/composer.json b/composer.json index a096ffd..3b79616 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 580f77e..8d193ff 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -216,6 +216,14 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'codebuild', 'signVersions' => ['v4'], ]; + case 'us-isof-east-1': + case 'us-isof-south-1': + return [ + 'endpoint' => "https://codebuild.$region.csp.hci.ic.gov", + 'signRegion' => $region, + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; } return [ From 72c417e958877711cef14fc6e4bb4f173d8d4752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Wed, 5 Mar 2025 21:41:02 +0100 Subject: [PATCH 11/22] Prepare release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6a2d8f..2537834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.8.0 + ### Added - AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions From e7c26b17853eba49e5dc99e5ecfdd57788a24358 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Fri, 14 Mar 2025 01:54:00 -0700 Subject: [PATCH 12/22] Update generated code (#1856) update generated code --- CHANGELOG.md | 4 ++++ src/ValueObject/ProjectEnvironment.php | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2537834..499f40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- AWS enhancement: Documentation updates. + ## 2.8.0 ### Added diff --git a/src/ValueObject/ProjectEnvironment.php b/src/ValueObject/ProjectEnvironment.php index 1faf59e..497dd1d 100644 --- a/src/ValueObject/ProjectEnvironment.php +++ b/src/ValueObject/ProjectEnvironment.php @@ -15,22 +15,6 @@ final class ProjectEnvironment /** * The type of build environment to use for related builds. * - * - The environment type `ARM_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US West - * (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). - * - The environment type `LINUX_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US West - * (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), - * Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia). - * - The environment type `LINUX_GPU_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US - * West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific - * (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China (Beijing), and China (Ningxia). - * - * - The environment types `ARM_LAMBDA_CONTAINER` and `LINUX_LAMBDA_CONTAINER` are available only in regions US East (N. - * Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific - * (Sydney), Asia Pacific (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo). - * - * - The environment types `WINDOWS_CONTAINER` and `WINDOWS_SERVER_2019_CONTAINER` are available only in regions US East - * (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland). - * * > If you're using compute fleets during project creation, `type` will be ignored. * * For more information, see Build environment compute types [^1] in the *CodeBuild user guide*. From b83df4f61251b1a44b717a3358080440d1a6de55 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Sat, 29 Mar 2025 01:16:15 -0700 Subject: [PATCH 13/22] Update generated code (#1867) update generated code --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/Result/BatchGetBuildsOutput.php | 1 + src/Result/StartBuildOutput.php | 1 + src/Result/StopBuildOutput.php | 1 + src/ValueObject/ProjectCache.php | 21 +++++++++++++++++++++ 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 499f40e..83c7c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: This release adds support for cacheNamespace in ProjectCache + ### Changed - AWS enhancement: Documentation updates. diff --git a/composer.json b/composer.json index 3b79616..418bb15 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "2.9-dev" } } } diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index 482db3f..e0f51b3 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/src/Result/BatchGetBuildsOutput.php @@ -353,6 +353,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } diff --git a/src/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index e9c5b05..233d94c 100644 --- a/src/Result/StartBuildOutput.php +++ b/src/Result/StartBuildOutput.php @@ -303,6 +303,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } diff --git a/src/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index 39f8d9e..945e924 100644 --- a/src/Result/StopBuildOutput.php +++ b/src/Result/StopBuildOutput.php @@ -303,6 +303,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } diff --git a/src/ValueObject/ProjectCache.php b/src/ValueObject/ProjectCache.php index bfd29f4..ca64325 100644 --- a/src/ValueObject/ProjectCache.php +++ b/src/ValueObject/ProjectCache.php @@ -68,11 +68,22 @@ final class ProjectCache */ private $modes; + /** + * Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. For more + * information, see Cache sharing between projects [^1] in the *CodeBuild User Guide*. + * + * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing + * + * @var string|null + */ + private $cacheNamespace; + /** * @param array{ * type: CacheType::*, * location?: null|string, * modes?: null|array, + * cacheNamespace?: null|string, * } $input */ public function __construct(array $input) @@ -80,6 +91,7 @@ public function __construct(array $input) $this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".')); $this->location = $input['location'] ?? null; $this->modes = $input['modes'] ?? null; + $this->cacheNamespace = $input['cacheNamespace'] ?? null; } /** @@ -87,6 +99,7 @@ public function __construct(array $input) * type: CacheType::*, * location?: null|string, * modes?: null|array, + * cacheNamespace?: null|string, * }|ProjectCache $input */ public static function create($input): self @@ -94,6 +107,11 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + public function getCacheNamespace(): ?string + { + return $this->cacheNamespace; + } + public function getLocation(): ?string { return $this->location; @@ -140,6 +158,9 @@ public function requestBody(): array $payload['modes'][$index] = $listValue; } } + if (null !== $v = $this->cacheNamespace) { + $payload['cacheNamespace'] = $v; + } return $payload; } From 72e838f3f2c3b703f1302141db7b92271df053e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 31 Mar 2025 09:35:56 +0200 Subject: [PATCH 14/22] prepare next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83c7c08..1a5ea74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.9.0 + ### Added - AWS api-change: This release adds support for cacheNamespace in ProjectCache From 795eab8d9215acb802db207901ea3511d77b3546 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 2 Apr 2025 23:53:14 -0700 Subject: [PATCH 15/22] Update generated code (#1870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Update src/Service/CodeBuild/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 5 +++++ composer.json | 2 +- src/CodeBuildClient.php | 7 +++++++ src/Enum/EnvironmentType.php | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a5ea74..a902a92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## NOT RELEASED +### Added + +- AWS api-change: This release adds support for environment type WINDOWS_SERVER_2022_CONTAINER in ProjectEnvironment +- AWS api-change: Added `us-isob-east-1` region. + ## 2.9.0 ### Added diff --git a/composer.json b/composer.json index 418bb15..2187c09 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.9-dev" + "dev-master": "2.10-dev" } } } diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 8d193ff..61fcca5 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -224,6 +224,13 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'codebuild', 'signVersions' => ['v4'], ]; + case 'us-isob-east-1': + return [ + 'endpoint' => 'https://codebuild.us-isob-east-1.sc2s.sgov.gov', + 'signRegion' => 'us-isob-east-1', + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; } return [ diff --git a/src/Enum/EnvironmentType.php b/src/Enum/EnvironmentType.php index 64b3884..f1145dd 100644 --- a/src/Enum/EnvironmentType.php +++ b/src/Enum/EnvironmentType.php @@ -15,6 +15,7 @@ final class EnvironmentType public const WINDOWS_CONTAINER = 'WINDOWS_CONTAINER'; public const WINDOWS_EC2 = 'WINDOWS_EC2'; public const WINDOWS_SERVER_2019_CONTAINER = 'WINDOWS_SERVER_2019_CONTAINER'; + public const WINDOWS_SERVER_2022_CONTAINER = 'WINDOWS_SERVER_2022_CONTAINER'; public static function exists(string $value): bool { @@ -30,6 +31,7 @@ public static function exists(string $value): bool self::WINDOWS_CONTAINER => true, self::WINDOWS_EC2 => true, self::WINDOWS_SERVER_2019_CONTAINER => true, + self::WINDOWS_SERVER_2022_CONTAINER => true, ][$value]); } } From 566d3887c8256b15c3626e052220194dd42ec0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Fri, 11 Apr 2025 11:10:18 +0200 Subject: [PATCH 16/22] Sort exceptions alphabetically (#1875) --- CHANGELOG.md | 4 ++++ src/CodeBuildClient.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a902a92..ba158e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - AWS api-change: This release adds support for environment type WINDOWS_SERVER_2022_CONTAINER in ProjectEnvironment - AWS api-change: Added `us-isob-east-1` region. +### Changed + +- Sort exception alphabetically. + ## 2.9.0 ### Added diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 61fcca5..a36ad99 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -105,17 +105,17 @@ public function batchGetBuilds($input): BatchGetBuildsOutput * '@region'?: string|null, * }|StartBuildInput $input * + * @throws AccountLimitExceededException * @throws InvalidInputException * @throws ResourceNotFoundException - * @throws AccountLimitExceededException */ public function startBuild($input): StartBuildOutput { $input = StartBuildInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'StartBuild', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'AccountLimitExceededException' => AccountLimitExceededException::class, 'InvalidInputException' => InvalidInputException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'AccountLimitExceededException' => AccountLimitExceededException::class, ]])); return new StartBuildOutput($response); From 19400932c46963cf1b7d7275e17a823ef42acdd8 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:13:30 -0700 Subject: [PATCH 17/22] Update generated code (#1884) update generated code --- CHANGELOG.md | 1 + src/Enum/ComputeType.php | 2 ++ src/Result/BatchGetBuildsOutput.php | 1 + src/Result/StartBuildOutput.php | 1 + src/Result/StopBuildOutput.php | 1 + src/ValueObject/ComputeConfiguration.php | 17 ++++++++++++++++- 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba158e7..66e6aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - AWS api-change: This release adds support for environment type WINDOWS_SERVER_2022_CONTAINER in ProjectEnvironment - AWS api-change: Added `us-isob-east-1` region. +- AWS api-change: Add support for custom instance type for reserved capacity fleets ### Changed diff --git a/src/Enum/ComputeType.php b/src/Enum/ComputeType.php index c8bd257..322ce20 100644 --- a/src/Enum/ComputeType.php +++ b/src/Enum/ComputeType.php @@ -15,6 +15,7 @@ final class ComputeType public const BUILD_LAMBDA_2GB = 'BUILD_LAMBDA_2GB'; public const BUILD_LAMBDA_4GB = 'BUILD_LAMBDA_4GB'; public const BUILD_LAMBDA_8GB = 'BUILD_LAMBDA_8GB'; + public const CUSTOM_INSTANCE_TYPE = 'CUSTOM_INSTANCE_TYPE'; public static function exists(string $value): bool { @@ -30,6 +31,7 @@ public static function exists(string $value): bool self::BUILD_LAMBDA_2GB => true, self::BUILD_LAMBDA_4GB => true, self::BUILD_LAMBDA_8GB => true, + self::CUSTOM_INSTANCE_TYPE => true, ][$value]); } } diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index e0f51b3..8e581ee 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/src/Result/BatchGetBuildsOutput.php @@ -243,6 +243,7 @@ private function populateResultComputeConfiguration(array $json): ComputeConfigu 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, ]); } diff --git a/src/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index 233d94c..3d8068d 100644 --- a/src/Result/StartBuildOutput.php +++ b/src/Result/StartBuildOutput.php @@ -193,6 +193,7 @@ private function populateResultComputeConfiguration(array $json): ComputeConfigu 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, ]); } diff --git a/src/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index 945e924..bf9944e 100644 --- a/src/Result/StopBuildOutput.php +++ b/src/Result/StopBuildOutput.php @@ -193,6 +193,7 @@ private function populateResultComputeConfiguration(array $json): ComputeConfigu 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, ]); } diff --git a/src/ValueObject/ComputeConfiguration.php b/src/ValueObject/ComputeConfiguration.php index c19ac3c..44ae546 100644 --- a/src/ValueObject/ComputeConfiguration.php +++ b/src/ValueObject/ComputeConfiguration.php @@ -6,7 +6,7 @@ /** * Contains compute attributes. These attributes only need be specified when your project's or fleet's `computeType` is - * set to `ATTRIBUTE_BASED_COMPUTE`. + * set to `ATTRIBUTE_BASED_COMPUTE` or `CUSTOM_INSTANCE_TYPE`. */ final class ComputeConfiguration { @@ -38,12 +38,20 @@ final class ComputeConfiguration */ private $machineType; + /** + * The EC2 instance type to be launched in your fleet. + * + * @var string|null + */ + private $instanceType; + /** * @param array{ * vCpu?: null|int, * memory?: null|int, * disk?: null|int, * machineType?: null|MachineType::*, + * instanceType?: null|string, * } $input */ public function __construct(array $input) @@ -52,6 +60,7 @@ public function __construct(array $input) $this->memory = $input['memory'] ?? null; $this->disk = $input['disk'] ?? null; $this->machineType = $input['machineType'] ?? null; + $this->instanceType = $input['instanceType'] ?? null; } /** @@ -60,6 +69,7 @@ public function __construct(array $input) * memory?: null|int, * disk?: null|int, * machineType?: null|MachineType::*, + * instanceType?: null|string, * }|ComputeConfiguration $input */ public static function create($input): self @@ -72,6 +82,11 @@ public function getDisk(): ?int return $this->disk; } + public function getInstanceType(): ?string + { + return $this->instanceType; + } + /** * @return MachineType::*|null */ From c19dc9c9edb46874635ba279568b7a5f72f07312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 12 May 2025 11:35:01 +0200 Subject: [PATCH 18/22] Prepeare release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e6aa3..25a6557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.10.0 + ### Added - AWS api-change: This release adds support for environment type WINDOWS_SERVER_2022_CONTAINER in ProjectEnvironment From 2872f2073348ffa36cab75e6c8f5b71c68643737 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Thu, 15 May 2025 23:46:50 -0700 Subject: [PATCH 19/22] Update generated code (#1893) update generated code --- CHANGELOG.md | 4 ++ composer.json | 2 +- src/Result/BatchGetBuildsOutput.php | 20 ++++++ src/Result/StartBuildOutput.php | 20 ++++++ src/Result/StopBuildOutput.php | 20 ++++++ src/ValueObject/DockerServer.php | 97 ++++++++++++++++++++++++++ src/ValueObject/DockerServerStatus.php | 56 +++++++++++++++ src/ValueObject/ProjectEnvironment.php | 15 ++++ 8 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 src/ValueObject/DockerServer.php create mode 100644 src/ValueObject/DockerServerStatus.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 25a6557..dbb3e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: AWS CodeBuild now supports Docker Server capability + ## 2.10.0 ### Added diff --git a/composer.json b/composer.json index 2187c09..b654fb3 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.10-dev" + "dev-master": "2.11-dev" } } } diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index 8e581ee..b0b8945 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/src/Result/BatchGetBuildsOutput.php @@ -11,6 +11,8 @@ use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -255,6 +257,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -387,6 +406,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index 3d8068d..c8cf505 100644 --- a/src/Result/StartBuildOutput.php +++ b/src/Result/StartBuildOutput.php @@ -11,6 +11,8 @@ use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -205,6 +207,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -337,6 +356,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index bf9944e..4630884 100644 --- a/src/Result/StopBuildOutput.php +++ b/src/Result/StopBuildOutput.php @@ -11,6 +11,8 @@ use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -205,6 +207,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -337,6 +356,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/ValueObject/DockerServer.php b/src/ValueObject/DockerServer.php new file mode 100644 index 0000000..a6830a0 --- /dev/null +++ b/src/ValueObject/DockerServer.php @@ -0,0 +1,97 @@ + Security groups configured for Docker servers should allow ingress network traffic from the VPC configured in the + * > project. They should allow ingress on port 9876. + * + * @var string[]|null + */ + private $securityGroupIds; + + /** + * A DockerServerStatus object to use for this docker server. + * + * @var DockerServerStatus|null + */ + private $status; + + /** + * @param array{ + * computeType: ComputeType::*, + * securityGroupIds?: null|string[], + * status?: null|DockerServerStatus|array, + * } $input + */ + public function __construct(array $input) + { + $this->computeType = $input['computeType'] ?? $this->throwException(new InvalidArgument('Missing required field "computeType".')); + $this->securityGroupIds = $input['securityGroupIds'] ?? null; + $this->status = isset($input['status']) ? DockerServerStatus::create($input['status']) : null; + } + + /** + * @param array{ + * computeType: ComputeType::*, + * securityGroupIds?: null|string[], + * status?: null|DockerServerStatus|array, + * }|DockerServer $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + /** + * @return ComputeType::* + */ + public function getComputeType(): string + { + return $this->computeType; + } + + /** + * @return string[] + */ + public function getSecurityGroupIds(): array + { + return $this->securityGroupIds ?? []; + } + + public function getStatus(): ?DockerServerStatus + { + return $this->status; + } + + /** + * @return never + */ + private function throwException(\Throwable $exception) + { + throw $exception; + } +} diff --git a/src/ValueObject/DockerServerStatus.php b/src/ValueObject/DockerServerStatus.php new file mode 100644 index 0000000..32590fc --- /dev/null +++ b/src/ValueObject/DockerServerStatus.php @@ -0,0 +1,56 @@ +status = $input['status'] ?? null; + $this->message = $input['message'] ?? null; + } + + /** + * @param array{ + * status?: null|string, + * message?: null|string, + * }|DockerServerStatus $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getMessage(): ?string + { + return $this->message; + } + + public function getStatus(): ?string + { + return $this->status; + } +} diff --git a/src/ValueObject/ProjectEnvironment.php b/src/ValueObject/ProjectEnvironment.php index 497dd1d..4f64be6 100644 --- a/src/ValueObject/ProjectEnvironment.php +++ b/src/ValueObject/ProjectEnvironment.php @@ -174,6 +174,13 @@ final class ProjectEnvironment */ private $imagePullCredentialsType; + /** + * A DockerServer object to use for this build project. + * + * @var DockerServer|null + */ + private $dockerServer; + /** * @param array{ * type: EnvironmentType::*, @@ -186,6 +193,7 @@ final class ProjectEnvironment * certificate?: null|string, * registryCredential?: null|RegistryCredential|array, * imagePullCredentialsType?: null|ImagePullCredentialsType::*, + * dockerServer?: null|DockerServer|array, * } $input */ public function __construct(array $input) @@ -200,6 +208,7 @@ public function __construct(array $input) $this->certificate = $input['certificate'] ?? null; $this->registryCredential = isset($input['registryCredential']) ? RegistryCredential::create($input['registryCredential']) : null; $this->imagePullCredentialsType = $input['imagePullCredentialsType'] ?? null; + $this->dockerServer = isset($input['dockerServer']) ? DockerServer::create($input['dockerServer']) : null; } /** @@ -214,6 +223,7 @@ public function __construct(array $input) * certificate?: null|string, * registryCredential?: null|RegistryCredential|array, * imagePullCredentialsType?: null|ImagePullCredentialsType::*, + * dockerServer?: null|DockerServer|array, * }|ProjectEnvironment $input */ public static function create($input): self @@ -239,6 +249,11 @@ public function getComputeType(): string return $this->computeType; } + public function getDockerServer(): ?DockerServer + { + return $this->dockerServer; + } + /** * @return EnvironmentVariable[] */ From f3127b04ba3497ac821ed02e6b27da0373190b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 3 Jun 2025 10:22:28 +0200 Subject: [PATCH 20/22] prepare next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb3e02..525c25a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.11.0 + ### Added - AWS api-change: AWS CodeBuild now supports Docker Server capability From 4a8c95c97a0d5ca08940f3a990f78f9bfa31b7dc Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Fri, 8 Aug 2025 00:24:47 -0700 Subject: [PATCH 21/22] Update generated code (#1930) update generated code --- CHANGELOG.md | 4 ++++ src/Input/StartBuildInput.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 525c25a..107a2f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- AWS enhancement: Documentation updates. + ## 2.11.0 ### Added diff --git a/src/Input/StartBuildInput.php b/src/Input/StartBuildInput.php index f968899..db4b389 100644 --- a/src/Input/StartBuildInput.php +++ b/src/Input/StartBuildInput.php @@ -158,9 +158,11 @@ final class StartBuildInput extends Input * > Since this property allows you to change the build commands that will run in the container, you should note that an * > IAM principal with the ability to call this API and set this parameter can override the default settings. Moreover, * > we encourage that you use a trustworthy buildspec location like a file in your source repository or a Amazon S3 - * > bucket. + * > bucket. Alternatively, you can restrict overrides to the buildspec by using a condition key: Prevent unauthorized + * > modifications to project buildspec [^2]. * * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage + * [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/action-context-keys.html#action-context-keys-example-overridebuildspec.html * * @var string|null */ From 9c22c65296e0b0ad27441c3bef200c8ede443895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 11 Aug 2025 12:03:27 +0200 Subject: [PATCH 22/22] prepare next release (#1932) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 107a2f3..86ab357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 2.11.1 + ### Changed - AWS enhancement: Documentation updates.