Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs): Add support for ECS deployment circuit breaker #6132

Merged
merged 5 commits into from
Jan 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public class CreateServerGroupDescription extends AbstractECSDescription {
String taskDefinitionArtifactAccount;
Map<String, String> containerToImageMap;
boolean enableExecuteCommand;
boolean enableDeploymentCircuitBreaker;

/**
* @deprecated this field only allows for one container to be specified. ECS supports the ability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ protected CreateServiceRequest makeServiceRequest(
DeploymentConfiguration deploymentConfiguration =
new DeploymentConfiguration().withMinimumHealthyPercent(100).withMaximumPercent(200);

DeploymentCircuitBreaker deploymentCircuitBreaker =
new DeploymentCircuitBreaker()
.withEnable(description.isEnableDeploymentCircuitBreaker())
.withRollback(false);
deploymentConfiguration.setDeploymentCircuitBreaker(deploymentCircuitBreaker);

CreateServiceRequest request =
new CreateServiceRequest()
.withServiceName(newServerGroupName.getServiceName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
request.launchType == null
request.platformVersion == null
request.enableExecuteCommand == false
request.deploymentConfiguration.deploymentCircuitBreaker.enable == false
}) >> new CreateServiceResult().withService(service)

result.getServerGroupNames().size() == 1
Expand Down Expand Up @@ -246,7 +247,8 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
securityGroupNames: ['helloworld'],
associatePublicIpAddress: true,
serviceDiscoveryAssociations: [serviceRegistry],
enableExecuteCommand: true
enableExecuteCommand: true,
enableDeploymentCircuitBreaker: true
)

def operation = new CreateServerGroupAtomicOperation(description)
Expand Down Expand Up @@ -311,6 +313,7 @@ class CreateServerGroupAtomicOperationSpec extends CommonAtomicOperation {
request.launchType == 'FARGATE'
request.platformVersion == '1.0.0'
request.enableExecuteCommand == true
request.deploymentConfiguration.deploymentCircuitBreaker.enable == true
} as CreateServiceRequest) >> new CreateServiceResult().withService(service)

result.getServerGroupNames().size() == 1
Expand Down