# MinimumHealthyHostsPerZone

Minimum number of healthy hosts per availability zone for a server deployment.

Obtainable from: MinimumHealthyHostsPerZone.count, MinimumHealthyHostsPerZone.percentage

- Source: [`aws-codedeploy/lib/host-health-config.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codedeploy/lib/host-health-config.ts#L42)
- Type last changed: v2.149.0 · 12 Jul 2024

## Example

TypeScript:

```ts
const deploymentConfig = new codedeploy.ServerDeploymentConfig(this, 'DeploymentConfiguration', {
  minimumHealthyHosts: codedeploy.MinimumHealthyHosts.count(2),
  zonalConfig: {
    monitorDuration: Duration.minutes(30),
    firstZoneMonitorDuration: Duration.minutes(60),
    minimumHealthyHostsPerZone: codedeploy.MinimumHealthyHostsPerZone.count(1),
  },
});
```

Python:

```python
deployment_config = codedeploy.ServerDeploymentConfig(self, "DeploymentConfiguration",
    minimum_healthy_hosts=codedeploy.MinimumHealthyHosts.count(2),
    zonal_config=codedeploy.ZonalConfig(
        monitor_duration=Duration.minutes(30),
        first_zone_monitor_duration=Duration.minutes(60),
        minimum_healthy_hosts_per_zone=codedeploy.MinimumHealthyHostsPerZone.count(1)
    )
)
```

Java:

```java
ServerDeploymentConfig deploymentConfig = ServerDeploymentConfig.Builder.create(this, "DeploymentConfiguration")
        .minimumHealthyHosts(MinimumHealthyHosts.count(2))
        .zonalConfig(ZonalConfig.builder()
                .monitorDuration(Duration.minutes(30))
                .firstZoneMonitorDuration(Duration.minutes(60))
                .minimumHealthyHostsPerZone(MinimumHealthyHostsPerZone.count(1))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var deploymentConfig = new ServerDeploymentConfig(this, "DeploymentConfiguration", new ServerDeploymentConfigProps {
    MinimumHealthyHosts = MinimumHealthyHosts.Count(2),
    ZonalConfig = new ZonalConfig {
        MonitorDuration = Duration.Minutes(30),
        FirstZoneMonitorDuration = Duration.Minutes(60),
        MinimumHealthyHostsPerZone = MinimumHealthyHostsPerZone.Count(1)
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
deploymentConfig := codedeploy.NewServerDeploymentConfig(this, jsii.String("DeploymentConfiguration"), &ServerDeploymentConfigProps{
	MinimumHealthyHosts: codedeploy.MinimumHealthyHosts_Count(jsii.Number(2)),
	ZonalConfig: &ZonalConfig{
		MonitorDuration: awscdk.Duration_Minutes(jsii.Number(30)),
		FirstZoneMonitorDuration: awscdk.Duration_*Minutes(jsii.Number(60)),
		MinimumHealthyHostsPerZone: codedeploy.MinimumHealthyHostsPerZone_Count(jsii.Number(1)),
	},
})
```

## Methods

- `count(value: number): MinimumHealthyHostsPerZone // chainable` (static) — The minimum healthy hosts threshold expressed as an absolute number.

- `percentage(value: number): MinimumHealthyHostsPerZone // chainable` (static) — The minimum healthy hosts threshold expressed as a percentage of the fleet.
