Skip to content

Commit

Permalink
fix: Fix redeployment failure while using ConsoleAppEcsFargateService…
Browse files Browse the repository at this point in the history
… recipe
  • Loading branch information
96malhar committed Feb 25, 2022
1 parent 8c55225 commit f40933f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,33 @@ namespace ConsoleAppEcsFargateService.Configurations
{
public partial class AutoScalingConfiguration
{
const int defaultCooldown = 300;

public bool Enabled { get; set; }

public int MinCapacity { get; set; }
public int MinCapacity { get; set; } = 1;

public int MaxCapacity { get; set; }
public int MaxCapacity { get; set; } = 3;

public enum ScalingTypeEnum { Cpu, Memory }

public ScalingTypeEnum? ScalingType { get; set; }



public double CpuTypeTargetUtilizationPercent { get; set; }
public double CpuTypeTargetUtilizationPercent { get; set; } = 70;

public int CpuTypeScaleInCooldownSeconds { get; set; }
public int CpuTypeScaleInCooldownSeconds { get; set; } = defaultCooldown;

public int CpuTypeScaleOutCooldownSeconds { get; set; }
public int CpuTypeScaleOutCooldownSeconds { get; set; } = defaultCooldown;



public int MemoryTypeTargetUtilizationPercent { get; set; }
public int MemoryTypeTargetUtilizationPercent { get; set; } = 70;

public int MemoryTypeScaleInCooldownSeconds { get; set; }
public int MemoryTypeScaleInCooldownSeconds { get; set; } = defaultCooldown;

public int MemoryTypeScaleOutCooldownSeconds { get; set; }
public int MemoryTypeScaleOutCooldownSeconds { get; set; } = defaultCooldown;

/// A parameterless constructor is needed for <see cref="Microsoft.Extensions.Configuration.ConfigurationBuilder"/>
/// or the classes will fail to initialize.
Expand Down
9 changes: 9 additions & 0 deletions test/AWS.Deploy.CLI.IntegrationTests/ConsoleAppTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ public async Task DefaultConfigurations(params string[] components)
var listStdOut = _interactiveService.StdOutReader.ReadAllLines().Select(x => x.Split()[0]).ToList();
Assert.Contains(listStdOut, (deployment) => _stackName.Equals(deployment));

// Arrange input for re-deployment
await _interactiveService.StdInWriter.WriteAsync(Environment.NewLine); // Select default option settings
await _interactiveService.StdInWriter.FlushAsync();

// Perform re-deployment
deployArgs = new[] { "deploy", "--project-path", _testAppManager.GetProjectPath(Path.Combine(components)), "--application-name", _stackName, "--diagnostics" };
Assert.Equal(CommandReturnCodes.SUCCESS, await _app.Run(deployArgs));
Assert.Equal(StackStatus.UPDATE_COMPLETE, await _cloudFormationHelper.GetStackStatus(_stackName));

// Arrange input for delete
await _interactiveService.StdInWriter.WriteAsync("y"); // Confirm delete
await _interactiveService.StdInWriter.FlushAsync();
Expand Down

0 comments on commit f40933f

Please sign in to comment.