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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
* ID: DesiredCount
* Description: The desired number of ECS tasks to run for the service.
* Type: Int
* **Minimum Healthy Percent**
* ID: MinHealthyPercent
* Description: The minimum number of tasks, specified as a percentage of the Amazon ECS service's 'Desired Task Count' value, that must continue to run and remain healthy during a deployment.
* Type: Int
* **Container Port**
* ID: Port
* Description: The port the container is listening for requests on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
* ID: DesiredCount
* Description: The desired number of ECS tasks to run for the service.
* Type: Int
* **Minimum Healthy Percent**
* ID: MinHealthyPercent
* Description: The minimum number of tasks, specified as a percentage of the Amazon ECS service's 'Desired Task Count' value, that must continue to run and remain healthy during a deployment.
* Type: Int
* **Application IAM Role**
* ID: ApplicationIAMRole
* Description: The Identity and Access Management (IAM) role that provides AWS credentials to the application to access AWS services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public partial class Configuration
/// </summary>
public double DesiredCount { get; set; }

/// <summary>
/// The minimum number of tasks, specified as a percentage of the Amazon ECS service's <see cref="DesiredCount"/> value,
/// that must continue to run and remain healthy during a deployment.
/// </summary>
public double MinHealthyPercent { get; set; }

/// <summary>
/// The name of the ECS service running in the cluster.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ private void ConfigureECSClusterAndService(IRecipeProps<Configuration> recipeCon
Cluster = EcsCluster,
TaskDefinition = AppTaskDefinition,
DesiredCount = settings.DesiredCount,
MinHealthyPercent = settings.MinHealthyPercent,
ServiceName = settings.ECSServiceName,
AssignPublicIp = settings.Vpc.IsDefault,
SecurityGroups = EcsServiceSecurityGroups.ToArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public partial class Configuration
/// </summary>
public double DesiredCount { get; set; }

/// <summary>
/// The minimum number of tasks, specified as a percentage of the Amazon ECS service's <see cref="DesiredCount"/> value,
/// that must continue to run and remain healthy during a deployment.
/// </summary>
public double MinHealthyPercent { get; set; }

/// <summary>
/// The Identity and Access Management Role that provides AWS credentials to the application to access AWS services.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ private void ConfigureService(Configuration settings)
Cluster = EcsCluster,
TaskDefinition = AppTaskDefinition,
AssignPublicIp = settings.Vpc.IsDefault,
DesiredCount = settings.DesiredCount
DesiredCount = settings.DesiredCount,
MinHealthyPercent = settings.MinHealthyPercent
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,25 @@
}
]
},
{
"Id": "MinHealthyPercent",
"Name": "Minimum Healthy Percent",
"Category": "Compute",
"Description": "The minimum number of tasks, specified as a percentage of the Amazon ECS service's 'Desired Task Count' value, that must continue to run and remain healthy during a deployment.",
"Type": "Int",
"DefaultValue": 100,
"AdvancedSetting": true,
"Updatable": true,
"Validators": [
{
"ValidatorType": "Range",
"Configuration": {
"Min": 0,
"Max": 100
}
}
]
},
{
"Id": "Port",
"Name": "Container Port",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,25 @@
}
]
},
{
"Id": "MinHealthyPercent",
"Name": "Minimum Healthy Percent",
"Category": "Compute",
"Description": "The minimum number of tasks, specified as a percentage of the Amazon ECS service's 'Desired Task Count' value, that must continue to run and remain healthy during a deployment.",
"Type": "Int",
"DefaultValue": 100,
"AdvancedSetting": true,
"Updatable": true,
"Validators": [
{
"ValidatorType": "Range",
"Configuration": {
"Min": 0,
"Max": 100
}
}
]
},
{
"Id": "ApplicationIAMRole",
"Name": "Application IAM Role",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,25 @@ await _serviceCollection.RunDeployToolAsync(deployArgs,
// Arrange input for deploy
interactiveService.StdInWriter.Write(Environment.NewLine); // Select default recommendation
interactiveService.StdInWriter.WriteLine("more"); // Select 'more'
interactiveService.StdInWriter.WriteLine("13"); // Select 'Environment Architecture'
interactiveService.StdInWriter.WriteLine("14"); // Select 'Environment Architecture'
interactiveService.StdInWriter.WriteLine("1"); // Select 'X86_64'
interactiveService.StdInWriter.WriteLine("13"); // Select 'Environment Architecture' again for Code Coverage
interactiveService.StdInWriter.WriteLine("14"); // Select 'Environment Architecture' again for Code Coverage
interactiveService.StdInWriter.WriteLine("1"); // Select 'X86_64'
interactiveService.StdInWriter.WriteLine("8"); // Select 'Task CPU'
interactiveService.StdInWriter.WriteLine("9"); // Select 'Task CPU'
interactiveService.StdInWriter.WriteLine("2"); // Select '512 (.5 vCPU)'
interactiveService.StdInWriter.Flush();
});

var consoleOutput = interactiveService.StdOutReader.ReadAllLines();

// Assert 'Environment Architecture' is set to 'X86_64'
var environmentArchitecture = Assert.IsType<string>(consoleOutput.LastOrDefault(x => x.StartsWith("13. Environment Architecture:")));
var environmentArchitecture = Assert.IsType<string>(consoleOutput.LastOrDefault(x => x.StartsWith("14. Environment Architecture:")));
var environmentArchitectureSplit = environmentArchitecture.Split(':').ToList().Select(x => x.Trim()).ToList();
Assert.Equal(2, environmentArchitectureSplit.Count);
Assert.Equal("X86_64", environmentArchitectureSplit[1]);

// Assert 'Task CPU' is set to '512'
var taskCpu = Assert.IsType<string>(consoleOutput.LastOrDefault(x => x.StartsWith("8 . Task CPU:")));
var taskCpu = Assert.IsType<string>(consoleOutput.LastOrDefault(x => x.StartsWith("9 . Task CPU:")));
var taskCpuSplit = taskCpu.Split(':').ToList().Select(x => x.Trim()).ToList();
Assert.Equal(2, taskCpuSplit.Count);
Assert.Equal("512", taskCpuSplit[1]);
Expand Down
Loading