# CfnServiceProps

Properties for defining a `CfnService`.

Used as props by: [CfnService](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.html)

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';

declare const hookDetails: any;
const cfnServiceProps: ecs.CfnServiceProps = {
  availabilityZoneRebalancing: 'availabilityZoneRebalancing',
  capacityProviderStrategy: [{
    base: 123,
    capacityProvider: 'capacityProvider',
    weight: 123,
  }],
  cluster: 'cluster',
  deploymentConfiguration: {
    alarms: {
      alarmNames: ['alarmNames'],
      enable: false,
      rollback: false,
    },
    bakeTimeInMinutes: 123,
    canaryConfiguration: {
      canaryBakeTimeInMinutes: 123,
      canaryPercent: 123,
    },
    deploymentCircuitBreaker: {
      enable: false,
      rollback: false,

      // the properties below are optional
      resetOnHealthyTask: false,
      thresholdConfiguration: {
        type: 'type',
        value: 123,
      },
    },
    earlySuccessCriteria: {
      enable: false,
      healthyPercent: 123,
      sourceServiceRevisionCleanup: 'sourceServiceRevisionCleanup',
    },
    lifecycleHooks: [{
      lifecycleStages: ['lifecycleStages'],

      // the properties below are optional
      hookDetails: hookDetails,
      hookTargetArn: 'hookTargetArn',
      roleArn: 'roleArn',
      targetType: 'targetType',
      timeoutConfiguration: {
        action: 'action',
        timeoutInMinutes: 123,
      },
    }],
    linearConfiguration: {
      stepBakeTimeInMinutes: 123,
      stepPercent: 123,
    },
    maximumPercent: 123,
    minimumHealthyPercent: 123,
    strategy: 'strategy',
  },
  deploymentController: {
    type: 'type',
  },
  desiredCount: 123,
  enableEcsManagedTags: false,
  enableExecuteCommand: false,
  forceNewDeployment: {
    enableForceNewDeployment: false,

    // the properties below are optional
    forceNewDeploymentNonce: 'forceNewDeploymentNonce',
  },
  gatewayConnectors: [{
    portName: 'portName',

    // the properties below are optional
    deregistrationDelay: {
      timeoutSeconds: 123,
    },
    filters: {
      accessTypes: ['accessTypes'],
    },
    healthCheck: {
      healthCheckIntervalSeconds: 123,
      healthCheckPath: 'healthCheckPath',
      healthCheckPort: 123,
      healthCheckProtocol: 'healthCheckProtocol',
      healthCheckTimeoutSeconds: 123,
      healthyThresholdCount: 123,
      matcher: {
        grpcCode: 'grpcCode',
        httpCode: 'httpCode',
      },
      unhealthyThresholdCount: 123,
    },
  }],
  healthCheckGracePeriodSeconds: 123,
  launchType: 'launchType',
  loadBalancers: [{
    advancedConfiguration: {
      alternateTargetGroupArn: 'alternateTargetGroupArn',

      // the properties below are optional
      productionListenerRule: 'productionListenerRule',
      roleArn: 'roleArn',
      testListenerRule: 'testListenerRule',
    },
    containerName: 'containerName',
    containerPort: 123,
    loadBalancerName: 'loadBalancerName',
    targetGroupArn: 'targetGroupArn',
  }],
  monitoring: {
    metricConfigurations: [{
      metricNames: ['metricNames'],
      resolutionSeconds: 123,
    }],
  },
  networkConfiguration: {
    awsvpcConfiguration: {
      assignPublicIp: 'assignPublicIp',
      securityGroups: ['securityGroups'],
      subnets: ['subnets'],
    },
  },
  placementConstraints: [{
    type: 'type',

    // the properties below are optional
    expression: 'expression',
  }],
  placementStrategies: [{
    type: 'type',

    // the properties below are optional
    field: 'field',
  }],
  platformVersion: 'platformVersion',
  propagateTags: 'propagateTags',
  role: 'role',
  schedulingStrategy: 'schedulingStrategy',
  serviceConnectConfiguration: {
    enabled: false,

    // the properties below are optional
    accessLogConfiguration: {
      format: 'format',

      // the properties below are optional
      includeQueryParameters: 'includeQueryParameters',
    },
    containerConfigurations: [{
      logLevel: 'logLevel',
    }],
    logConfiguration: {
      logDriver: 'logDriver',
      options: {
        optionsKey: 'options',
      },
      secretOptions: [{
        name: 'name',
        valueFrom: 'valueFrom',
      }],
    },
    namespace: 'namespace',
    services: [{
      portName: 'portName',

      // the properties below are optional
      clientAliases: [{
        port: 123,

        // the properties below are optional
        dnsName: 'dnsName',
        testTrafficRules: {
          header: {
            name: 'name',

            // the properties below are optional
            value: {
              exact: 'exact',
            },
          },
        },
      }],
      discoveryName: 'discoveryName',
      ingressPortOverride: 123,
      timeout: {
        idleTimeoutSeconds: 123,
        perRequestTimeoutSeconds: 123,
      },
      tls: {
        issuerCertificateAuthority: {
          awsPcaAuthorityArn: 'awsPcaAuthorityArn',
        },

        // the properties below are optional
        kmsKey: 'kmsKey',
        roleArn: 'roleArn',
      },
    }],
  },
  serviceName: 'serviceName',
  serviceRegistries: [{
    containerName: 'containerName',
    containerPort: 123,
    port: 123,
    registryArn: 'registryArn',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  taskDefinition: 'taskDefinition',
  volumeConfigurations: [{
    name: 'name',

    // the properties below are optional
    managedEbsVolume: {
      roleArn: 'roleArn',

      // the properties below are optional
      encrypted: false,
      filesystemType: 'filesystemType',
      iops: 123,
      kmsKeyId: 'kmsKeyId',
      sizeInGiB: 123,
      snapshotId: 'snapshotId',
      tagSpecifications: [{
        resourceType: 'resourceType',

        // the properties below are optional
        propagateTags: 'propagateTags',
        tags: [{
          key: 'key',
          value: 'value',
        }],
      }],
      throughput: 123,
      volumeInitializationRate: 123,
      volumeType: 'volumeType',
    },
  }],
  vpcLatticeConfigurations: [{
    portName: 'portName',
    roleArn: 'roleArn',
    targetGroupArn: 'targetGroupArn',

    // the properties below are optional
    advancedConfiguration: {
      alternateTargetGroupArn: 'alternateTargetGroupArn',
      productionListenerRule: 'productionListenerRule',
      testListenerRule: 'testListenerRule',
    },
  }],
};
```

Python:

```python
from aws_cdk import CfnTag, CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs

# hook_details: Any

cfn_service_props = ecs.CfnServiceProps(
    availability_zone_rebalancing="availabilityZoneRebalancing",
    capacity_provider_strategy=[ecs.CfnService.CapacityProviderStrategyItemProperty(
        base=123,
        capacity_provider="capacityProvider",
        weight=123
    )],
    cluster="cluster",
    deployment_configuration=ecs.CfnService.DeploymentConfigurationProperty(
        alarms=ecs.CfnService.DeploymentAlarmsProperty(
            alarm_names=["alarmNames"],
            enable=False,
            rollback=False
        ),
        bake_time_in_minutes=123,
        canary_configuration=ecs.CfnService.CanaryConfigurationProperty(
            canary_bake_time_in_minutes=123,
            canary_percent=123
        ),
        deployment_circuit_breaker=ecs.CfnService.DeploymentCircuitBreakerProperty(
            enable=False,
            rollback=False,

            # the properties below are optional
            reset_on_healthy_task=False,
            threshold_configuration=ecs.CfnService.ThresholdConfigurationProperty(
                type="type",
                value=123
            )
        ),
        early_success_criteria=ecs.CfnService.DeploymentEarlySuccessCriteriaProperty(
            enable=False,
            healthy_percent=123,
            source_service_revision_cleanup="sourceServiceRevisionCleanup"
        ),
        lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
            lifecycle_stages=["lifecycleStages"],

            # the properties below are optional
            hook_details=hook_details,
            hook_target_arn="hookTargetArn",
            role_arn="roleArn",
            target_type="targetType",
            timeout_configuration=ecs.CfnService.HookTimeoutConfigProperty(
                action="action",
                timeout_in_minutes=123
            )
        )],
        linear_configuration=ecs.CfnService.LinearConfigurationProperty(
            step_bake_time_in_minutes=123,
            step_percent=123
        ),
        maximum_percent=123,
        minimum_healthy_percent=123,
        strategy="strategy"
    ),
    deployment_controller=ecs.CfnService.DeploymentControllerProperty(
        type="type"
    ),
    desired_count=123,
    enable_ecs_managed_tags=False,
    enable_execute_command=False,
    force_new_deployment=ecs.CfnService.ForceNewDeploymentProperty(
        enable_force_new_deployment=False,

        # the properties below are optional
        force_new_deployment_nonce="forceNewDeploymentNonce"
    ),
    gateway_connectors=[ecs.CfnService.GatewayConnectorProperty(
        port_name="portName",

        # the properties below are optional
        deregistration_delay=ecs.CfnService.GatewayConnectorDeregistrationDelayProperty(
            timeout_seconds=123
        ),
        filters=ecs.CfnService.GatewayConnectorFiltersProperty(
            access_types=["accessTypes"]
        ),
        health_check=ecs.CfnService.GatewayConnectorHealthCheckProperty(
            health_check_interval_seconds=123,
            health_check_path="healthCheckPath",
            health_check_port=123,
            health_check_protocol="healthCheckProtocol",
            health_check_timeout_seconds=123,
            healthy_threshold_count=123,
            matcher=ecs.CfnService.GatewayConnectorHealthCheckMatcherProperty(
                grpc_code="grpcCode",
                http_code="httpCode"
            ),
            unhealthy_threshold_count=123
        )
    )],
    health_check_grace_period_seconds=123,
    launch_type="launchType",
    load_balancers=[ecs.CfnService.LoadBalancerProperty(
        advanced_configuration=ecs.CfnService.AdvancedConfigurationProperty(
            alternate_target_group_arn="alternateTargetGroupArn",

            # the properties below are optional
            production_listener_rule="productionListenerRule",
            role_arn="roleArn",
            test_listener_rule="testListenerRule"
        ),
        container_name="containerName",
        container_port=123,
        load_balancer_name="loadBalancerName",
        target_group_arn="targetGroupArn"
    )],
    monitoring=ecs.CfnService.MonitoringConfigurationProperty(
        metric_configurations=[ecs.CfnService.MetricConfigurationProperty(
            metric_names=["metricNames"],
            resolution_seconds=123
        )]
    ),
    network_configuration=ecs.CfnService.NetworkConfigurationProperty(
        awsvpc_configuration=ecs.CfnService.AwsVpcConfigurationProperty(
            assign_public_ip="assignPublicIp",
            security_groups=["securityGroups"],
            subnets=["subnets"]
        )
    ),
    placement_constraints=[ecs.CfnService.PlacementConstraintProperty(
        type="type",

        # the properties below are optional
        expression="expression"
    )],
    placement_strategies=[ecs.CfnService.PlacementStrategyProperty(
        type="type",

        # the properties below are optional
        field="field"
    )],
    platform_version="platformVersion",
    propagate_tags="propagateTags",
    role="role",
    scheduling_strategy="schedulingStrategy",
    service_connect_configuration=ecs.CfnService.ServiceConnectConfigurationProperty(
        enabled=False,

        # the properties below are optional
        access_log_configuration=ecs.CfnService.ServiceConnectAccessLogConfigurationProperty(
            format="format",

            # the properties below are optional
            include_query_parameters="includeQueryParameters"
        ),
        container_configurations=[ecs.CfnService.ServiceConnectContainerConfigurationProperty(
            log_level="logLevel"
        )],
        log_configuration=ecs.CfnService.LogConfigurationProperty(
            log_driver="logDriver",
            options={
                "options_key": "options"
            },
            secret_options=[ecs.CfnService.SecretProperty(
                name="name",
                value_from="valueFrom"
            )]
        ),
        namespace="namespace",
        services=[ecs.CfnService.ServiceConnectServiceProperty(
            port_name="portName",

            # the properties below are optional
            client_aliases=[ecs.CfnService.ServiceConnectClientAliasProperty(
                port=123,

                # the properties below are optional
                dns_name="dnsName",
                test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
                    header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
                        name="name",

                        # the properties below are optional
                        value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
                            exact="exact"
                        )
                    )
                )
            )],
            discovery_name="discoveryName",
            ingress_port_override=123,
            timeout=ecs.CfnService.TimeoutConfigurationProperty(
                idle_timeout_seconds=123,
                per_request_timeout_seconds=123
            ),
            tls=ecs.CfnService.ServiceConnectTlsConfigurationProperty(
                issuer_certificate_authority=ecs.CfnService.ServiceConnectTlsCertificateAuthorityProperty(
                    aws_pca_authority_arn="awsPcaAuthorityArn"
                ),

                # the properties below are optional
                kms_key="kmsKey",
                role_arn="roleArn"
            )
        )]
    ),
    service_name="serviceName",
    service_registries=[ecs.CfnService.ServiceRegistryProperty(
        container_name="containerName",
        container_port=123,
        port=123,
        registry_arn="registryArn"
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    task_definition="taskDefinition",
    volume_configurations=[ecs.CfnService.ServiceVolumeConfigurationProperty(
        name="name",

        # the properties below are optional
        managed_ebs_volume=ecs.CfnService.ServiceManagedEBSVolumeConfigurationProperty(
            role_arn="roleArn",

            # the properties below are optional
            encrypted=False,
            filesystem_type="filesystemType",
            iops=123,
            kms_key_id="kmsKeyId",
            size_in_gi_b=123,
            snapshot_id="snapshotId",
            tag_specifications=[ecs.CfnService.EBSTagSpecificationProperty(
                resource_type="resourceType",

                # the properties below are optional
                propagate_tags="propagateTags",
                tags=[CfnTag(
                    key="key",
                    value="value"
                )]
            )],
            throughput=123,
            volume_initialization_rate=123,
            volume_type="volumeType"
        )
    )],
    vpc_lattice_configurations=[ecs.CfnService.VpcLatticeConfigurationProperty(
        port_name="portName",
        role_arn="roleArn",
        target_group_arn="targetGroupArn",

        # the properties below are optional
        advanced_configuration=ecs.CfnService.VpcLatticeAdvancedConfigurationProperty(
            alternate_target_group_arn="alternateTargetGroupArn",
            production_listener_rule="productionListenerRule",
            test_listener_rule="testListenerRule"
        )
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;

Object hookDetails;

CfnServiceProps cfnServiceProps = CfnServiceProps.builder()
        .availabilityZoneRebalancing("availabilityZoneRebalancing")
        .capacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
                .base(123)
                .capacityProvider("capacityProvider")
                .weight(123)
                .build()))
        .cluster("cluster")
        .deploymentConfiguration(DeploymentConfigurationProperty.builder()
                .alarms(DeploymentAlarmsProperty.builder()
                        .alarmNames(List.of("alarmNames"))
                        .enable(false)
                        .rollback(false)
                        .build())
                .bakeTimeInMinutes(123)
                .canaryConfiguration(CanaryConfigurationProperty.builder()
                        .canaryBakeTimeInMinutes(123)
                        .canaryPercent(123)
                        .build())
                .deploymentCircuitBreaker(DeploymentCircuitBreakerProperty.builder()
                        .enable(false)
                        .rollback(false)

                        // the properties below are optional
                        .resetOnHealthyTask(false)
                        .thresholdConfiguration(ThresholdConfigurationProperty.builder()
                                .type("type")
                                .value(123)
                                .build())
                        .build())
                .earlySuccessCriteria(DeploymentEarlySuccessCriteriaProperty.builder()
                        .enable(false)
                        .healthyPercent(123)
                        .sourceServiceRevisionCleanup("sourceServiceRevisionCleanup")
                        .build())
                .lifecycleHooks(List.of(DeploymentLifecycleHookProperty.builder()
                        .lifecycleStages(List.of("lifecycleStages"))

                        // the properties below are optional
                        .hookDetails(hookDetails)
                        .hookTargetArn("hookTargetArn")
                        .roleArn("roleArn")
                        .targetType("targetType")
                        .timeoutConfiguration(HookTimeoutConfigProperty.builder()
                                .action("action")
                                .timeoutInMinutes(123)
                                .build())
                        .build()))
                .linearConfiguration(LinearConfigurationProperty.builder()
                        .stepBakeTimeInMinutes(123)
                        .stepPercent(123)
                        .build())
                .maximumPercent(123)
                .minimumHealthyPercent(123)
                .strategy("strategy")
                .build())
        .deploymentController(DeploymentControllerProperty.builder()
                .type("type")
                .build())
        .desiredCount(123)
        .enableEcsManagedTags(false)
        .enableExecuteCommand(false)
        .forceNewDeployment(ForceNewDeploymentProperty.builder()
                .enableForceNewDeployment(false)

                // the properties below are optional
                .forceNewDeploymentNonce("forceNewDeploymentNonce")
                .build())
        .gatewayConnectors(List.of(GatewayConnectorProperty.builder()
                .portName("portName")

                // the properties below are optional
                .deregistrationDelay(GatewayConnectorDeregistrationDelayProperty.builder()
                        .timeoutSeconds(123)
                        .build())
                .filters(GatewayConnectorFiltersProperty.builder()
                        .accessTypes(List.of("accessTypes"))
                        .build())
                .healthCheck(GatewayConnectorHealthCheckProperty.builder()
                        .healthCheckIntervalSeconds(123)
                        .healthCheckPath("healthCheckPath")
                        .healthCheckPort(123)
                        .healthCheckProtocol("healthCheckProtocol")
                        .healthCheckTimeoutSeconds(123)
                        .healthyThresholdCount(123)
                        .matcher(GatewayConnectorHealthCheckMatcherProperty.builder()
                                .grpcCode("grpcCode")
                                .httpCode("httpCode")
                                .build())
                        .unhealthyThresholdCount(123)
                        .build())
                .build()))
        .healthCheckGracePeriodSeconds(123)
        .launchType("launchType")
        .loadBalancers(List.of(LoadBalancerProperty.builder()
                .advancedConfiguration(AdvancedConfigurationProperty.builder()
                        .alternateTargetGroupArn("alternateTargetGroupArn")

                        // the properties below are optional
                        .productionListenerRule("productionListenerRule")
                        .roleArn("roleArn")
                        .testListenerRule("testListenerRule")
                        .build())
                .containerName("containerName")
                .containerPort(123)
                .loadBalancerName("loadBalancerName")
                .targetGroupArn("targetGroupArn")
                .build()))
        .monitoring(MonitoringConfigurationProperty.builder()
                .metricConfigurations(List.of(MetricConfigurationProperty.builder()
                        .metricNames(List.of("metricNames"))
                        .resolutionSeconds(123)
                        .build()))
                .build())
        .networkConfiguration(NetworkConfigurationProperty.builder()
                .awsvpcConfiguration(AwsVpcConfigurationProperty.builder()
                        .assignPublicIp("assignPublicIp")
                        .securityGroups(List.of("securityGroups"))
                        .subnets(List.of("subnets"))
                        .build())
                .build())
        .placementConstraints(List.of(PlacementConstraintProperty.builder()
                .type("type")

                // the properties below are optional
                .expression("expression")
                .build()))
        .placementStrategies(List.of(PlacementStrategyProperty.builder()
                .type("type")

                // the properties below are optional
                .field("field")
                .build()))
        .platformVersion("platformVersion")
        .propagateTags("propagateTags")
        .role("role")
        .schedulingStrategy("schedulingStrategy")
        .serviceConnectConfiguration(ServiceConnectConfigurationProperty.builder()
                .enabled(false)

                // the properties below are optional
                .accessLogConfiguration(ServiceConnectAccessLogConfigurationProperty.builder()
                        .format("format")

                        // the properties below are optional
                        .includeQueryParameters("includeQueryParameters")
                        .build())
                .containerConfigurations(List.of(ServiceConnectContainerConfigurationProperty.builder()
                        .logLevel("logLevel")
                        .build()))
                .logConfiguration(LogConfigurationProperty.builder()
                        .logDriver("logDriver")
                        .options(Map.of(
                                "optionsKey", "options"))
                        .secretOptions(List.of(SecretProperty.builder()
                                .name("name")
                                .valueFrom("valueFrom")
                                .build()))
                        .build())
                .namespace("namespace")
                .services(List.of(ServiceConnectServiceProperty.builder()
                        .portName("portName")

                        // the properties below are optional
                        .clientAliases(List.of(ServiceConnectClientAliasProperty.builder()
                                .port(123)

                                // the properties below are optional
                                .dnsName("dnsName")
                                .testTrafficRules(ServiceConnectTestTrafficRulesProperty.builder()
                                        .header(ServiceConnectTestTrafficRulesHeaderProperty.builder()
                                                .name("name")

                                                // the properties below are optional
                                                .value(ServiceConnectTestTrafficRulesHeaderValueProperty.builder()
                                                        .exact("exact")
                                                        .build())
                                                .build())
                                        .build())
                                .build()))
                        .discoveryName("discoveryName")
                        .ingressPortOverride(123)
                        .timeout(TimeoutConfigurationProperty.builder()
                                .idleTimeoutSeconds(123)
                                .perRequestTimeoutSeconds(123)
                                .build())
                        .tls(ServiceConnectTlsConfigurationProperty.builder()
                                .issuerCertificateAuthority(ServiceConnectTlsCertificateAuthorityProperty.builder()
                                        .awsPcaAuthorityArn("awsPcaAuthorityArn")
                                        .build())

                                // the properties below are optional
                                .kmsKey("kmsKey")
                                .roleArn("roleArn")
                                .build())
                        .build()))
                .build())
        .serviceName("serviceName")
        .serviceRegistries(List.of(ServiceRegistryProperty.builder()
                .containerName("containerName")
                .containerPort(123)
                .port(123)
                .registryArn("registryArn")
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .taskDefinition("taskDefinition")
        .volumeConfigurations(List.of(ServiceVolumeConfigurationProperty.builder()
                .name("name")

                // the properties below are optional
                .managedEbsVolume(ServiceManagedEBSVolumeConfigurationProperty.builder()
                        .roleArn("roleArn")

                        // the properties below are optional
                        .encrypted(false)
                        .filesystemType("filesystemType")
                        .iops(123)
                        .kmsKeyId("kmsKeyId")
                        .sizeInGiB(123)
                        .snapshotId("snapshotId")
                        .tagSpecifications(List.of(EBSTagSpecificationProperty.builder()
                                .resourceType("resourceType")

                                // the properties below are optional
                                .propagateTags("propagateTags")
                                .tags(List.of(CfnTag.builder()
                                        .key("key")
                                        .value("value")
                                        .build()))
                                .build()))
                        .throughput(123)
                        .volumeInitializationRate(123)
                        .volumeType("volumeType")
                        .build())
                .build()))
        .vpcLatticeConfigurations(List.of(VpcLatticeConfigurationProperty.builder()
                .portName("portName")
                .roleArn("roleArn")
                .targetGroupArn("targetGroupArn")

                // the properties below are optional
                .advancedConfiguration(VpcLatticeAdvancedConfigurationProperty.builder()
                        .alternateTargetGroupArn("alternateTargetGroupArn")
                        .productionListenerRule("productionListenerRule")
                        .testListenerRule("testListenerRule")
                        .build())
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;

var hookDetails;

var cfnServiceProps = new CfnServiceProps {
    AvailabilityZoneRebalancing = "availabilityZoneRebalancing",
    CapacityProviderStrategy = new [] { new CapacityProviderStrategyItemProperty {
        Base = 123,
        CapacityProvider = "capacityProvider",
        Weight = 123
    } },
    Cluster = "cluster",
    DeploymentConfiguration = new DeploymentConfigurationProperty {
        Alarms = new DeploymentAlarmsProperty {
            AlarmNames = new [] { "alarmNames" },
            Enable = false,
            Rollback = false
        },
        BakeTimeInMinutes = 123,
        CanaryConfiguration = new CanaryConfigurationProperty {
            CanaryBakeTimeInMinutes = 123,
            CanaryPercent = 123
        },
        DeploymentCircuitBreaker = new DeploymentCircuitBreakerProperty {
            Enable = false,
            Rollback = false,

            // the properties below are optional
            ResetOnHealthyTask = false,
            ThresholdConfiguration = new ThresholdConfigurationProperty {
                Type = "type",
                Value = 123
            }
        },
        EarlySuccessCriteria = new DeploymentEarlySuccessCriteriaProperty {
            Enable = false,
            HealthyPercent = 123,
            SourceServiceRevisionCleanup = "sourceServiceRevisionCleanup"
        },
        LifecycleHooks = new [] { new DeploymentLifecycleHookProperty {
            LifecycleStages = new [] { "lifecycleStages" },

            // the properties below are optional
            HookDetails = hookDetails,
            HookTargetArn = "hookTargetArn",
            RoleArn = "roleArn",
            TargetType = "targetType",
            TimeoutConfiguration = new HookTimeoutConfigProperty {
                Action = "action",
                TimeoutInMinutes = 123
            }
        } },
        LinearConfiguration = new LinearConfigurationProperty {
            StepBakeTimeInMinutes = 123,
            StepPercent = 123
        },
        MaximumPercent = 123,
        MinimumHealthyPercent = 123,
        Strategy = "strategy"
    },
    DeploymentController = new DeploymentControllerProperty {
        Type = "type"
    },
    DesiredCount = 123,
    EnableEcsManagedTags = false,
    EnableExecuteCommand = false,
    ForceNewDeployment = new ForceNewDeploymentProperty {
        EnableForceNewDeployment = false,

        // the properties below are optional
        ForceNewDeploymentNonce = "forceNewDeploymentNonce"
    },
    GatewayConnectors = new [] { new GatewayConnectorProperty {
        PortName = "portName",

        // the properties below are optional
        DeregistrationDelay = new GatewayConnectorDeregistrationDelayProperty {
            TimeoutSeconds = 123
        },
        Filters = new GatewayConnectorFiltersProperty {
            AccessTypes = new [] { "accessTypes" }
        },
        HealthCheck = new GatewayConnectorHealthCheckProperty {
            HealthCheckIntervalSeconds = 123,
            HealthCheckPath = "healthCheckPath",
            HealthCheckPort = 123,
            HealthCheckProtocol = "healthCheckProtocol",
            HealthCheckTimeoutSeconds = 123,
            HealthyThresholdCount = 123,
            Matcher = new GatewayConnectorHealthCheckMatcherProperty {
                GrpcCode = "grpcCode",
                HttpCode = "httpCode"
            },
            UnhealthyThresholdCount = 123
        }
    } },
    HealthCheckGracePeriodSeconds = 123,
    LaunchType = "launchType",
    LoadBalancers = new [] { new LoadBalancerProperty {
        AdvancedConfiguration = new AdvancedConfigurationProperty {
            AlternateTargetGroupArn = "alternateTargetGroupArn",

            // the properties below are optional
            ProductionListenerRule = "productionListenerRule",
            RoleArn = "roleArn",
            TestListenerRule = "testListenerRule"
        },
        ContainerName = "containerName",
        ContainerPort = 123,
        LoadBalancerName = "loadBalancerName",
        TargetGroupArn = "targetGroupArn"
    } },
    Monitoring = new MonitoringConfigurationProperty {
        MetricConfigurations = new [] { new MetricConfigurationProperty {
            MetricNames = new [] { "metricNames" },
            ResolutionSeconds = 123
        } }
    },
    NetworkConfiguration = new NetworkConfigurationProperty {
        AwsvpcConfiguration = new AwsVpcConfigurationProperty {
            AssignPublicIp = "assignPublicIp",
            SecurityGroups = new [] { "securityGroups" },
            Subnets = new [] { "subnets" }
        }
    },
    PlacementConstraints = new [] { new PlacementConstraintProperty {
        Type = "type",

        // the properties below are optional
        Expression = "expression"
    } },
    PlacementStrategies = new [] { new PlacementStrategyProperty {
        Type = "type",

        // the properties below are optional
        Field = "field"
    } },
    PlatformVersion = "platformVersion",
    PropagateTags = "propagateTags",
    Role = "role",
    SchedulingStrategy = "schedulingStrategy",
    ServiceConnectConfiguration = new ServiceConnectConfigurationProperty {
        Enabled = false,

        // the properties below are optional
        AccessLogConfiguration = new ServiceConnectAccessLogConfigurationProperty {
            Format = "format",

            // the properties below are optional
            IncludeQueryParameters = "includeQueryParameters"
        },
        ContainerConfigurations = new [] { new ServiceConnectContainerConfigurationProperty {
            LogLevel = "logLevel"
        } },
        LogConfiguration = new LogConfigurationProperty {
            LogDriver = "logDriver",
            Options = new Dictionary<string, string> {
                { "optionsKey", "options" }
            },
            SecretOptions = new [] { new SecretProperty {
                Name = "name",
                ValueFrom = "valueFrom"
            } }
        },
        Namespace = "namespace",
        Services = new [] { new ServiceConnectServiceProperty {
            PortName = "portName",

            // the properties below are optional
            ClientAliases = new [] { new ServiceConnectClientAliasProperty {
                Port = 123,

                // the properties below are optional
                DnsName = "dnsName",
                TestTrafficRules = new ServiceConnectTestTrafficRulesProperty {
                    Header = new ServiceConnectTestTrafficRulesHeaderProperty {
                        Name = "name",

                        // the properties below are optional
                        Value = new ServiceConnectTestTrafficRulesHeaderValueProperty {
                            Exact = "exact"
                        }
                    }
                }
            } },
            DiscoveryName = "discoveryName",
            IngressPortOverride = 123,
            Timeout = new TimeoutConfigurationProperty {
                IdleTimeoutSeconds = 123,
                PerRequestTimeoutSeconds = 123
            },
            Tls = new ServiceConnectTlsConfigurationProperty {
                IssuerCertificateAuthority = new ServiceConnectTlsCertificateAuthorityProperty {
                    AwsPcaAuthorityArn = "awsPcaAuthorityArn"
                },

                // the properties below are optional
                KmsKey = "kmsKey",
                RoleArn = "roleArn"
            }
        } }
    },
    ServiceName = "serviceName",
    ServiceRegistries = new [] { new ServiceRegistryProperty {
        ContainerName = "containerName",
        ContainerPort = 123,
        Port = 123,
        RegistryArn = "registryArn"
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    TaskDefinition = "taskDefinition",
    VolumeConfigurations = new [] { new ServiceVolumeConfigurationProperty {
        Name = "name",

        // the properties below are optional
        ManagedEbsVolume = new ServiceManagedEBSVolumeConfigurationProperty {
            RoleArn = "roleArn",

            // the properties below are optional
            Encrypted = false,
            FilesystemType = "filesystemType",
            Iops = 123,
            KmsKeyId = "kmsKeyId",
            SizeInGiB = 123,
            SnapshotId = "snapshotId",
            TagSpecifications = new [] { new EBSTagSpecificationProperty {
                ResourceType = "resourceType",

                // the properties below are optional
                PropagateTags = "propagateTags",
                Tags = new [] { new CfnTag {
                    Key = "key",
                    Value = "value"
                } }
            } },
            Throughput = 123,
            VolumeInitializationRate = 123,
            VolumeType = "volumeType"
        }
    } },
    VpcLatticeConfigurations = new [] { new VpcLatticeConfigurationProperty {
        PortName = "portName",
        RoleArn = "roleArn",
        TargetGroupArn = "targetGroupArn",

        // the properties below are optional
        AdvancedConfiguration = new VpcLatticeAdvancedConfigurationProperty {
            AlternateTargetGroupArn = "alternateTargetGroupArn",
            ProductionListenerRule = "productionListenerRule",
            TestListenerRule = "testListenerRule"
        }
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var hookDetails interface{}

cfnServiceProps := &CfnServiceProps{
	AvailabilityZoneRebalancing: jsii.String("availabilityZoneRebalancing"),
	CapacityProviderStrategy: []interface{}{
		&CapacityProviderStrategyItemProperty{
			Base: jsii.Number(123),
			CapacityProvider: jsii.String("capacityProvider"),
			Weight: jsii.Number(123),
		},
	},
	Cluster: jsii.String("cluster"),
	DeploymentConfiguration: &DeploymentConfigurationProperty{
		Alarms: &DeploymentAlarmsProperty{
			AlarmNames: []*string{
				jsii.String("alarmNames"),
			},
			Enable: jsii.Boolean(false),
			Rollback: jsii.Boolean(false),
		},
		BakeTimeInMinutes: jsii.Number(123),
		CanaryConfiguration: &CanaryConfigurationProperty{
			CanaryBakeTimeInMinutes: jsii.Number(123),
			CanaryPercent: jsii.Number(123),
		},
		DeploymentCircuitBreaker: &DeploymentCircuitBreakerProperty{
			Enable: jsii.Boolean(false),
			Rollback: jsii.Boolean(false),

			// the properties below are optional
			ResetOnHealthyTask: jsii.Boolean(false),
			ThresholdConfiguration: &ThresholdConfigurationProperty{
				Type: jsii.String("type"),
				Value: jsii.Number(123),
			},
		},
		EarlySuccessCriteria: &DeploymentEarlySuccessCriteriaProperty{
			Enable: jsii.Boolean(false),
			HealthyPercent: jsii.Number(123),
			SourceServiceRevisionCleanup: jsii.String("sourceServiceRevisionCleanup"),
		},
		LifecycleHooks: []interface{}{
			&DeploymentLifecycleHookProperty{
				LifecycleStages: []*string{
					jsii.String("lifecycleStages"),
				},

				// the properties below are optional
				HookDetails: hookDetails,
				HookTargetArn: jsii.String("hookTargetArn"),
				RoleArn: jsii.String("roleArn"),
				TargetType: jsii.String("targetType"),
				TimeoutConfiguration: &HookTimeoutConfigProperty{
					Action: jsii.String("action"),
					TimeoutInMinutes: jsii.Number(123),
				},
			},
		},
		LinearConfiguration: &LinearConfigurationProperty{
			StepBakeTimeInMinutes: jsii.Number(123),
			StepPercent: jsii.Number(123),
		},
		MaximumPercent: jsii.Number(123),
		MinimumHealthyPercent: jsii.Number(123),
		Strategy: jsii.String("strategy"),
	},
	DeploymentController: &DeploymentControllerProperty{
		Type: jsii.String("type"),
	},
	DesiredCount: jsii.Number(123),
	EnableEcsManagedTags: jsii.Boolean(false),
	EnableExecuteCommand: jsii.Boolean(false),
	ForceNewDeployment: &ForceNewDeploymentProperty{
		EnableForceNewDeployment: jsii.Boolean(false),

		// the properties below are optional
		ForceNewDeploymentNonce: jsii.String("forceNewDeploymentNonce"),
	},
	GatewayConnectors: []interface{}{
		&GatewayConnectorProperty{
			PortName: jsii.String("portName"),

			// the properties below are optional
			DeregistrationDelay: &GatewayConnectorDeregistrationDelayProperty{
				TimeoutSeconds: jsii.Number(123),
			},
			Filters: &GatewayConnectorFiltersProperty{
				AccessTypes: []*string{
					jsii.String("accessTypes"),
				},
			},
			HealthCheck: &GatewayConnectorHealthCheckProperty{
				HealthCheckIntervalSeconds: jsii.Number(123),
				HealthCheckPath: jsii.String("healthCheckPath"),
				HealthCheckPort: jsii.Number(123),
				HealthCheckProtocol: jsii.String("healthCheckProtocol"),
				HealthCheckTimeoutSeconds: jsii.Number(123),
				HealthyThresholdCount: jsii.Number(123),
				Matcher: &GatewayConnectorHealthCheckMatcherProperty{
					GrpcCode: jsii.String("grpcCode"),
					HttpCode: jsii.String("httpCode"),
				},
				UnhealthyThresholdCount: jsii.Number(123),
			},
		},
	},
	HealthCheckGracePeriodSeconds: jsii.Number(123),
	LaunchType: jsii.String("launchType"),
	LoadBalancers: []interface{}{
		&LoadBalancerProperty{
			AdvancedConfiguration: &AdvancedConfigurationProperty{
				AlternateTargetGroupArn: jsii.String("alternateTargetGroupArn"),

				// the properties below are optional
				ProductionListenerRule: jsii.String("productionListenerRule"),
				RoleArn: jsii.String("roleArn"),
				TestListenerRule: jsii.String("testListenerRule"),
			},
			ContainerName: jsii.String("containerName"),
			ContainerPort: jsii.Number(123),
			LoadBalancerName: jsii.String("loadBalancerName"),
			TargetGroupArn: jsii.String("targetGroupArn"),
		},
	},
	Monitoring: &MonitoringConfigurationProperty{
		MetricConfigurations: []interface{}{
			&MetricConfigurationProperty{
				MetricNames: []*string{
					jsii.String("metricNames"),
				},
				ResolutionSeconds: jsii.Number(123),
			},
		},
	},
	NetworkConfiguration: &NetworkConfigurationProperty{
		AwsvpcConfiguration: &AwsVpcConfigurationProperty{
			AssignPublicIp: jsii.String("assignPublicIp"),
			SecurityGroups: []*string{
				jsii.String("securityGroups"),
			},
			Subnets: []*string{
				jsii.String("subnets"),
			},
		},
	},
	PlacementConstraints: []interface{}{
		&PlacementConstraintProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			Expression: jsii.String("expression"),
		},
	},
	PlacementStrategies: []interface{}{
		&PlacementStrategyProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			Field: jsii.String("field"),
		},
	},
	PlatformVersion: jsii.String("platformVersion"),
	PropagateTags: jsii.String("propagateTags"),
	Role: jsii.String("role"),
	SchedulingStrategy: jsii.String("schedulingStrategy"),
	ServiceConnectConfiguration: &ServiceConnectConfigurationProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AccessLogConfiguration: &ServiceConnectAccessLogConfigurationProperty{
			Format: jsii.String("format"),

			// the properties below are optional
			IncludeQueryParameters: jsii.String("includeQueryParameters"),
		},
		ContainerConfigurations: []interface{}{
			&ServiceConnectContainerConfigurationProperty{
				LogLevel: jsii.String("logLevel"),
			},
		},
		LogConfiguration: &LogConfigurationProperty{
			LogDriver: jsii.String("logDriver"),
			Options: map[string]*string{
				"optionsKey": jsii.String("options"),
			},
			SecretOptions: []interface{}{
				&SecretProperty{
					Name: jsii.String("name"),
					ValueFrom: jsii.String("valueFrom"),
				},
			},
		},
		Namespace: jsii.String("namespace"),
		Services: []interface{}{
			&ServiceConnectServiceProperty{
				PortName: jsii.String("portName"),

				// the properties below are optional
				ClientAliases: []interface{}{
					&ServiceConnectClientAliasProperty{
						Port: jsii.Number(123),

						// the properties below are optional
						DnsName: jsii.String("dnsName"),
						TestTrafficRules: &ServiceConnectTestTrafficRulesProperty{
							Header: &ServiceConnectTestTrafficRulesHeaderProperty{
								Name: jsii.String("name"),

								// the properties below are optional
								Value: &ServiceConnectTestTrafficRulesHeaderValueProperty{
									Exact: jsii.String("exact"),
								},
							},
						},
					},
				},
				DiscoveryName: jsii.String("discoveryName"),
				IngressPortOverride: jsii.Number(123),
				Timeout: &TimeoutConfigurationProperty{
					IdleTimeoutSeconds: jsii.Number(123),
					PerRequestTimeoutSeconds: jsii.Number(123),
				},
				Tls: &ServiceConnectTlsConfigurationProperty{
					IssuerCertificateAuthority: &ServiceConnectTlsCertificateAuthorityProperty{
						AwsPcaAuthorityArn: jsii.String("awsPcaAuthorityArn"),
					},

					// the properties below are optional
					KmsKey: jsii.String("kmsKey"),
					RoleArn: jsii.String("roleArn"),
				},
			},
		},
	},
	ServiceName: jsii.String("serviceName"),
	ServiceRegistries: []interface{}{
		&ServiceRegistryProperty{
			ContainerName: jsii.String("containerName"),
			ContainerPort: jsii.Number(123),
			Port: jsii.Number(123),
			RegistryArn: jsii.String("registryArn"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TaskDefinition: jsii.String("taskDefinition"),
	VolumeConfigurations: []interface{}{
		&ServiceVolumeConfigurationProperty{
			Name: jsii.String("name"),

			// the properties below are optional
			ManagedEbsVolume: &ServiceManagedEBSVolumeConfigurationProperty{
				RoleArn: jsii.String("roleArn"),

				// the properties below are optional
				Encrypted: jsii.Boolean(false),
				FilesystemType: jsii.String("filesystemType"),
				Iops: jsii.Number(123),
				KmsKeyId: jsii.String("kmsKeyId"),
				SizeInGiB: jsii.Number(123),
				SnapshotId: jsii.String("snapshotId"),
				TagSpecifications: []interface{}{
					&EBSTagSpecificationProperty{
						ResourceType: jsii.String("resourceType"),

						// the properties below are optional
						PropagateTags: jsii.String("propagateTags"),
						Tags: []CfnTag{
							&CfnTag{
								Key: jsii.String("key"),
								Value: jsii.String("value"),
							},
						},
					},
				},
				Throughput: jsii.Number(123),
				VolumeInitializationRate: jsii.Number(123),
				VolumeType: jsii.String("volumeType"),
			},
		},
	},
	VpcLatticeConfigurations: []interface{}{
		&VpcLatticeConfigurationProperty{
			PortName: jsii.String("portName"),
			RoleArn: jsii.String("roleArn"),
			TargetGroupArn: jsii.String("targetGroupArn"),

			// the properties below are optional
			AdvancedConfiguration: &VpcLatticeAdvancedConfigurationProperty{
				AlternateTargetGroupArn: jsii.String("alternateTargetGroupArn"),
				ProductionListenerRule: jsii.String("productionListenerRule"),
				TestListenerRule: jsii.String("testListenerRule"),
			},
		},
	},
}
```

## Properties

- `availabilityZoneRebalancing`: string = "ENABLED" — Indicates whether to use Availability Zone rebalancing for the service.

  For more information, see [Balancing an Amazon ECS service across Availability Zones](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html) in the **Amazon Elastic Container Service Developer Guide** .

  The default behavior of `AvailabilityZoneRebalancing` differs between create and update requests:

  - For create service requests, when no value is specified for `AvailabilityZoneRebalancing` , Amazon ECS defaults the value to `ENABLED` .
  - For update service requests, when no value is specified for `AvailabilityZoneRebalancing` , Amazon ECS defaults to the existing service’s `AvailabilityZoneRebalancing` value. If the service never had an `AvailabilityZoneRebalancing` value set, Amazon ECS treats this as `DISABLED` .

- `capacityProviderStrategy`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.CapacityProviderStrategyItemProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.CapacityProviderStrategyItemProperty.html)[] — The capacity provider strategy to use for the service.

  If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or `launchType` is specified, the `defaultCapacityProviderStrategy` for the cluster is used.

  A capacity provider strategy can contain a maximum of 20 capacity providers.

  > To remove this property from your service resource, specify an empty `CapacityProviderStrategyItem` array.

- `cluster`: string | [IClusterRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ecs.IClusterRef.html) — The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on.

  If you do not specify a cluster, the default cluster is assumed.

- `deploymentConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.DeploymentConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.DeploymentConfigurationProperty.html) — Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.

- `deploymentController`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.DeploymentControllerProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.DeploymentControllerProperty.html) — The deployment controller to use for the service.

- `desiredCount`: number — The number of instantiations of the specified task definition to place and keep running in your service.

  For new services, if a desired count is not specified, a default value of `1` is used. When using the `DAEMON` scheduling strategy, the desired count is not required.

  For existing services, if a desired count is not specified, it is omitted from the operation.

- `enableEcsManagedTags`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specifies whether to turn on Amazon ECS managed tags for the tasks within the service.

  For more information, see [Tagging your Amazon ECS resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon Elastic Container Service Developer Guide* .

  When you use Amazon ECS managed tags, you must set the `propagateTags` request parameter.

- `enableExecuteCommand`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Determines whether the execute command functionality is turned on for the service.

  If `true` , the execute command functionality is turned on for all containers in tasks as part of the service.

- `forceNewDeployment`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.ForceNewDeploymentProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.ForceNewDeploymentProperty.html) — Determines whether to force a new deployment of the service.

  By default, deployments aren't forced. You can use this option to start a new deployment with no service definition changes. For example, you can update a service's tasks to use a newer Docker image with the same image/tag combination ( `my_image:latest` ) or to roll Fargate tasks onto a newer platform version.

- `gatewayConnectors`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.GatewayConnectorProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.GatewayConnectorProperty.html)[]

- `healthCheckGracePeriodSeconds`: number — The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started.

  If you do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then `healthCheckGracePeriodSeconds` is unused.

  If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.

- `launchType`: string — The launch type on which to run your service.

  For more information, see [Amazon ECS Launch Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic Container Service Developer Guide* .

  > If you want to use Managed Instances, you must use the `capacityProviderStrategy` request parameter

- `loadBalancers`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.LoadBalancerProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.LoadBalancerProperty.html)[] — A list of load balancer objects to associate with the service.

  If you specify the `Role` property, `LoadBalancers` must be specified as well. For information about the number of load balancers that you can specify per service, see [Service Load Balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the *Amazon Elastic Container Service Developer Guide* .

  > To remove this property from your service resource, specify an empty `LoadBalancer` array.

- `monitoring`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.MonitoringConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.MonitoringConfigurationProperty.html) — The optional monitoring configuration for a service, which defines the resolution for the service-level ``CPUUtilization`` and ``MemoryUtilization`` Amazon CloudWatch metrics.

  When not specified, Amazon ECS uses the default resolution of ``60`` seconds.

- `networkConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.NetworkConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.NetworkConfigurationProperty.html) — The network configuration for the service.

  This parameter is required for task definitions that use the `awsvpc` network mode to receive their own elastic network interface, and it is not supported for other network modes. For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide* .

- `placementConstraints`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.PlacementConstraintProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.PlacementConstraintProperty.html)[] — An array of placement constraint objects to use for tasks in your service.

  You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.

  > To remove this property from your service resource, specify an empty `PlacementConstraint` array.

- `placementStrategies`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.PlacementStrategyProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.PlacementStrategyProperty.html)[] — The placement strategy objects to use for tasks in your service.

  You can specify a maximum of 5 strategy rules for each service.

  > To remove this property from your service resource, specify an empty `PlacementStrategy` array.

- `platformVersion`: string = "LATEST" — The platform version that your tasks in the service are running on.

  A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the `LATEST` platform version is used. For more information, see [AWS Fargate platform versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide* .

- `propagateTags`: string — Specifies whether to propagate the tags from the task definition to the task.

  If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the [TagResource](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) API action.

  You must set this to a value other than `NONE` when you use Cost Explorer. For more information, see [Amazon ECS usage reports](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/usage-reports.html) in the *Amazon Elastic Container Service Developer Guide* .

  The default is `NONE` .

- `role`: string | [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) — The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf.

  This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the `awsvpc` network mode. If you specify the `role` parameter, you must also specify a load balancer object with the `loadBalancers` parameter.

  > If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the `awsvpc` network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see [Using service-linked roles for Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon Elastic Container Service Developer Guide* .

  If your specified role has a path other than `/` , then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name `bar` has a path of `/foo/` then you would specify `/foo/bar` as the role name. For more information, see [Friendly names and paths](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in the *IAM User Guide* .

- `schedulingStrategy`: string — The scheduling strategy to use for the service. For more information, see [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) .

  There are two service scheduler strategies available:

  - `REPLICA` -The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the `CODE_DEPLOY` or `EXTERNAL` deployment controller types.
  - `DAEMON` -The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.

  > Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy.

- `serviceConnectConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.ServiceConnectConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.ServiceConnectConfigurationProperty.html) — The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.

  Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide* .

- `serviceName`: string — The name of your service.

  Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.

  > The stack update fails if you change any properties that require replacement and the `ServiceName` is configured. This is because AWS CloudFormation creates the replacement service first, but each `ServiceName` must be unique in the cluster.

- `serviceRegistries`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.ServiceRegistryProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.ServiceRegistryProperty.html)[] — The details of the service discovery registry to associate with this service. For more information, see [Service discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) .

  > Each service may be associated with one service registry. Multiple service registries for each service isn't supported. > To remove this property from your service resource, specify an empty `ServiceRegistry` array.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The metadata that you apply to the service to help you categorize and organize them.

  Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.

  The following basic restrictions apply to tags:

  - Maximum number of tags per resource - 50
  - For each resource, each tag key must be unique, and each tag key can have only one value.
  - Maximum key length - 128 Unicode characters in UTF-8
  - Maximum value length - 256 Unicode characters in UTF-8
  - If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : /

- `taskDefinition`: string | [ITaskDefinitionRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ecs.ITaskDefinitionRef.html) — The `family` and `revision` ( `family:revision` ) or full ARN of the task definition to run in your service.

  If a `revision` isn't specified, the latest `ACTIVE` revision is used.

  A task definition must be specified if the service uses either the `ECS` or `CODE_DEPLOY` deployment controllers.

  For more information about deployment types, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) .

- `volumeConfigurations`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.ServiceVolumeConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.ServiceVolumeConfigurationProperty.html)[] — The configuration for a volume specified in the task definition as a volume that is configured at launch time.

  Currently, the only supported volume type is an Amazon EBS volume.

  > To remove this property from your service resource, specify an empty `ServiceVolumeConfiguration` array.

- `vpcLatticeConfigurations`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.VpcLatticeConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.VpcLatticeConfigurationProperty.html)[] — The VPC Lattice configuration for the service being created.
