{
 "additionalProperties": false,
 "conditionalCreateOnlyProperties": [
  "/properties/LaunchType"
 ],
 "createOnlyProperties": [
  "/properties/Cluster",
  "/properties/Role",
  "/properties/SchedulingStrategy",
  "/properties/ServiceName"
 ],
 "definitions": {
  "AdvancedConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AlternateTargetGroupArn": {
     "type": "string"
    },
    "ProductionListenerRule": {
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "TestListenerRule": {
     "type": "string"
    }
   },
   "required": [
    "AlternateTargetGroupArn"
   ],
   "type": "object"
  },
  "AwsVpcConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AssignPublicIp": {
     "enum": [
      "DISABLED",
      "ENABLED"
     ],
     "type": "string"
    },
    "SecurityGroups": {
     "format": "AWS::EC2::SecurityGroup.Ids",
     "insertionOrder": false,
     "items": {
      "format": "AWS::EC2::SecurityGroup.Id",
      "type": "string"
     },
     "type": "array"
    },
    "Subnets": {
     "format": "AWS::EC2::Subnet.Ids",
     "insertionOrder": false,
     "items": {
      "format": "AWS::EC2::Subnet.Id",
      "type": "string"
     },
     "type": "array"
    }
   },
   "type": "object"
  },
  "CanaryConfiguration": {
   "additionalProperties": false,
   "properties": {
    "CanaryBakeTimeInMinutes": {
     "maximum": 1440,
     "minimum": 0,
     "type": "integer"
    },
    "CanaryPercent": {
     "maximum": 100,
     "minimum": 0.1,
     "multipleOf": 0.1,
     "type": "number"
    }
   },
   "type": "object"
  },
  "CapacityProviderStrategyItem": {
   "additionalProperties": false,
   "properties": {
    "Base": {
     "maximum": 100000,
     "minimum": 0,
     "type": "integer"
    },
    "CapacityProvider": {
     "type": "string"
    },
    "Weight": {
     "maximum": 1000,
     "minimum": 0,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "DeploymentAlarms": {
   "additionalProperties": false,
   "properties": {
    "AlarmNames": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "Enable": {
     "type": "boolean"
    },
    "Rollback": {
     "type": "boolean"
    }
   },
   "required": [
    "AlarmNames",
    "Rollback",
    "Enable"
   ],
   "type": "object"
  },
  "DeploymentCircuitBreaker": {
   "additionalProperties": false,
   "properties": {
    "Enable": {
     "type": "boolean"
    },
    "Rollback": {
     "type": "boolean"
    }
   },
   "required": [
    "Enable",
    "Rollback"
   ],
   "type": "object"
  },
  "DeploymentConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Alarms": {
     "$ref": "#/definitions/DeploymentAlarms"
    },
    "BakeTimeInMinutes": {
     "maximum": 1440,
     "minimum": 0,
     "type": "integer"
    },
    "CanaryConfiguration": {
     "$ref": "#/definitions/CanaryConfiguration"
    },
    "DeploymentCircuitBreaker": {
     "$ref": "#/definitions/DeploymentCircuitBreaker"
    },
    "LifecycleHooks": {
     "items": {
      "$ref": "#/definitions/DeploymentLifecycleHook"
     },
     "type": "array"
    },
    "LinearConfiguration": {
     "$ref": "#/definitions/LinearConfiguration"
    },
    "MaximumPercent": {
     "type": "integer"
    },
    "MinimumHealthyPercent": {
     "type": "integer"
    },
    "Strategy": {
     "enum": [
      "ROLLING",
      "BLUE_GREEN",
      "LINEAR",
      "CANARY"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "DeploymentController": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "enum": [
      "CODE_DEPLOY",
      "ECS",
      "EXTERNAL"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "DeploymentLifecycleHook": {
   "additionalProperties": false,
   "properties": {
    "HookDetails": {
     "type": [
      "string",
      "object"
     ]
    },
    "HookTargetArn": {
     "type": "string"
    },
    "LifecycleStages": {
     "items": {
      "enum": [
       "RECONCILE_SERVICE",
       "PRE_SCALE_UP",
       "POST_SCALE_UP",
       "TEST_TRAFFIC_SHIFT",
       "POST_TEST_TRAFFIC_SHIFT",
       "PRODUCTION_TRAFFIC_SHIFT",
       "POST_PRODUCTION_TRAFFIC_SHIFT"
      ],
      "type": "string"
     },
     "minItems": 1,
     "type": "array"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    }
   },
   "required": [
    "HookTargetArn",
    "RoleArn",
    "LifecycleStages"
   ],
   "type": "object"
  },
  "EBSTagSpecification": {
   "additionalProperties": false,
   "properties": {
    "PropagateTags": {
     "enum": [
      "SERVICE",
      "TASK_DEFINITION"
     ],
     "type": "string"
    },
    "ResourceType": {
     "enum": [
      "volume"
     ],
     "type": "string"
    },
    "Tags": {
     "items": {
      "$ref": "#/definitions/Tag"
     },
     "maxItems": 50,
     "minItems": 0,
     "type": "array"
    }
   },
   "required": [
    "ResourceType"
   ],
   "type": "object"
  },
  "ForceNewDeployment": {
   "additionalProperties": false,
   "properties": {
    "EnableForceNewDeployment": {
     "type": "boolean"
    },
    "ForceNewDeploymentNonce": {
     "$comment": "A time-varying value that has at most a negligible chance of repeating; for example, a random value that is generated anew for each use, a time-stamp, a sequence number, or some combination of these.",
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "EnableForceNewDeployment"
   ],
   "type": "object"
  },
  "LinearConfiguration": {
   "additionalProperties": false,
   "properties": {
    "StepBakeTimeInMinutes": {
     "maximum": 1440,
     "minimum": 0,
     "type": "integer"
    },
    "StepPercent": {
     "maximum": 100,
     "minimum": 3,
     "multipleOf": 0.1,
     "type": "number"
    }
   },
   "type": "object"
  },
  "LoadBalancer": {
   "additionalProperties": false,
   "properties": {
    "AdvancedConfiguration": {
     "$ref": "#/definitions/AdvancedConfiguration"
    },
    "ContainerName": {
     "type": "string"
    },
    "ContainerPort": {
     "type": "integer"
    },
    "LoadBalancerName": {
     "type": "string"
    },
    "TargetGroupArn": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "LogConfiguration": {
   "additionalProperties": false,
   "properties": {
    "LogDriver": {
     "type": "string"
    },
    "Options": {
     "additionalProperties": false,
     "patternProperties": {
      ".{1,}": {
       "type": "string"
      }
     },
     "type": "object"
    },
    "SecretOptions": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Secret"
     },
     "type": "array"
    }
   },
   "type": "object"
  },
  "NetworkConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AwsvpcConfiguration": {
     "$ref": "#/definitions/AwsVpcConfiguration"
    }
   },
   "type": "object"
  },
  "PlacementConstraint": {
   "additionalProperties": false,
   "properties": {
    "Expression": {
     "type": "string"
    },
    "Type": {
     "enum": [
      "distinctInstance",
      "memberOf"
     ],
     "type": "string"
    }
   },
   "required": [
    "Type"
   ],
   "type": "object"
  },
  "PlacementStrategy": {
   "additionalProperties": false,
   "properties": {
    "Field": {
     "type": "string"
    },
    "Type": {
     "enum": [
      "binpack",
      "random",
      "spread"
     ],
     "type": "string"
    }
   },
   "required": [
    "Type"
   ],
   "type": "object"
  },
  "Secret": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    },
    "ValueFrom": {
     "type": "string"
    }
   },
   "required": [
    "Name",
    "ValueFrom"
   ],
   "type": "object"
  },
  "ServiceConnectAccessLogConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Format": {
     "enum": [
      "TEXT",
      "JSON"
     ],
     "type": "string"
    },
    "IncludeQueryParameters": {
     "enum": [
      "DISABLED",
      "ENABLED"
     ],
     "type": "string"
    }
   },
   "required": [
    "Format"
   ],
   "type": "object"
  },
  "ServiceConnectClientAlias": {
   "additionalProperties": false,
   "properties": {
    "DnsName": {
     "type": "string"
    },
    "Port": {
     "maximum": 65535,
     "minimum": 0,
     "type": "integer"
    },
    "TestTrafficRules": {
     "$ref": "#/definitions/ServiceConnectTestTrafficRules"
    }
   },
   "required": [
    "Port"
   ],
   "type": "object"
  },
  "ServiceConnectConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AccessLogConfiguration": {
     "$ref": "#/definitions/ServiceConnectAccessLogConfiguration"
    },
    "Enabled": {
     "type": "boolean"
    },
    "LogConfiguration": {
     "$ref": "#/definitions/LogConfiguration"
    },
    "Namespace": {
     "type": "string"
    },
    "Services": {
     "items": {
      "$ref": "#/definitions/ServiceConnectService"
     },
     "type": "array"
    }
   },
   "required": [
    "Enabled"
   ],
   "type": "object"
  },
  "ServiceConnectService": {
   "additionalProperties": false,
   "properties": {
    "ClientAliases": {
     "items": {
      "$ref": "#/definitions/ServiceConnectClientAlias"
     },
     "type": "array"
    },
    "DiscoveryName": {
     "type": "string"
    },
    "IngressPortOverride": {
     "maximum": 65535,
     "minimum": 0,
     "type": "integer"
    },
    "PortName": {
     "type": "string"
    },
    "Timeout": {
     "$ref": "#/definitions/TimeoutConfiguration"
    },
    "Tls": {
     "$ref": "#/definitions/ServiceConnectTlsConfiguration"
    }
   },
   "required": [
    "PortName"
   ],
   "type": "object"
  },
  "ServiceConnectTestTrafficRules": {
   "additionalProperties": false,
   "properties": {
    "Header": {
     "$ref": "#/definitions/ServiceConnectTestTrafficRulesHeader"
    }
   },
   "required": [
    "Header"
   ],
   "type": "object"
  },
  "ServiceConnectTestTrafficRulesHeader": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    },
    "Value": {
     "$ref": "#/definitions/ServiceConnectTestTrafficRulesHeaderValue"
    }
   },
   "required": [
    "Name"
   ],
   "type": "object"
  },
  "ServiceConnectTestTrafficRulesHeaderValue": {
   "additionalProperties": false,
   "properties": {
    "Exact": {
     "type": "string"
    }
   },
   "required": [
    "Exact"
   ],
   "type": "object"
  },
  "ServiceConnectTlsCertificateAuthority": {
   "additionalProperties": false,
   "properties": {
    "AwsPcaAuthorityArn": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ServiceConnectTlsConfiguration": {
   "additionalProperties": false,
   "properties": {
    "IssuerCertificateAuthority": {
     "$ref": "#/definitions/ServiceConnectTlsCertificateAuthority"
    },
    "KmsKey": {
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    }
   },
   "required": [
    "IssuerCertificateAuthority"
   ],
   "type": "object"
  },
  "ServiceManagedEBSVolumeConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Encrypted": {
     "type": "boolean"
    },
    "FilesystemType": {
     "enum": [
      "ext3",
      "ext4",
      "ntfs",
      "xfs"
     ],
     "type": "string"
    },
    "Iops": {
     "type": "integer"
    },
    "KmsKeyId": {
     "anyOf": [
      {
       "format": "AWS::KMS::Key.Arn"
      },
      {
       "format": "AWS::KMS::Key.Id"
      },
      {
       "format": "AWS::KMS::Alias.AliasName"
      }
     ],
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "SizeInGiB": {
     "type": "integer"
    },
    "SnapshotId": {
     "type": "string"
    },
    "TagSpecifications": {
     "items": {
      "$ref": "#/definitions/EBSTagSpecification"
     },
     "type": "array"
    },
    "Throughput": {
     "type": "integer"
    },
    "VolumeInitializationRate": {
     "type": "integer"
    },
    "VolumeType": {
     "type": "string"
    }
   },
   "required": [
    "RoleArn"
   ],
   "type": "object"
  },
  "ServiceRegistry": {
   "additionalProperties": false,
   "properties": {
    "ContainerName": {
     "type": "string"
    },
    "ContainerPort": {
     "type": "integer"
    },
    "Port": {
     "type": "integer"
    },
    "RegistryArn": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ServiceVolumeConfiguration": {
   "additionalProperties": false,
   "properties": {
    "ManagedEBSVolume": {
     "$ref": "#/definitions/ServiceManagedEBSVolumeConfiguration"
    },
    "Name": {
     "type": "string"
    }
   },
   "required": [
    "Name"
   ],
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "TimeoutConfiguration": {
   "additionalProperties": false,
   "properties": {
    "IdleTimeoutSeconds": {
     "maximum": 2147483647,
     "minimum": 0,
     "type": "integer"
    },
    "PerRequestTimeoutSeconds": {
     "maximum": 2147483647,
     "minimum": 0,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "VpcLatticeConfiguration": {
   "additionalProperties": false,
   "properties": {
    "PortName": {
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "TargetGroupArn": {
     "type": "string"
    }
   },
   "required": [
    "RoleArn",
    "TargetGroupArn",
    "PortName"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ServiceArn",
  "/properties/Cluster"
 ],
 "properties": {
  "AvailabilityZoneRebalancing": {
   "default": "ENABLED",
   "enum": [
    "ENABLED",
    "DISABLED"
   ],
   "type": "string"
  },
  "CapacityProviderStrategy": {
   "items": {
    "$ref": "#/definitions/CapacityProviderStrategyItem"
   },
   "type": "array"
  },
  "Cluster": {
   "type": "string"
  },
  "DeploymentConfiguration": {
   "$ref": "#/definitions/DeploymentConfiguration"
  },
  "DeploymentController": {
   "$ref": "#/definitions/DeploymentController"
  },
  "DesiredCount": {
   "type": "integer"
  },
  "EnableECSManagedTags": {
   "type": "boolean"
  },
  "EnableExecuteCommand": {
   "type": "boolean"
  },
  "ForceNewDeployment": {
   "$ref": "#/definitions/ForceNewDeployment"
  },
  "HealthCheckGracePeriodSeconds": {
   "type": "integer"
  },
  "LaunchType": {
   "enum": [
    "EC2",
    "FARGATE",
    "EXTERNAL"
   ],
   "type": "string"
  },
  "LoadBalancers": {
   "items": {
    "$ref": "#/definitions/LoadBalancer"
   },
   "type": "array"
  },
  "Name": {
   "type": "string"
  },
  "NetworkConfiguration": {
   "$ref": "#/definitions/NetworkConfiguration"
  },
  "PlacementConstraints": {
   "items": {
    "$ref": "#/definitions/PlacementConstraint"
   },
   "type": "array"
  },
  "PlacementStrategies": {
   "items": {
    "$ref": "#/definitions/PlacementStrategy"
   },
   "type": "array"
  },
  "PlatformVersion": {
   "default": "LATEST",
   "type": "string"
  },
  "PropagateTags": {
   "enum": [
    "SERVICE",
    "TASK_DEFINITION"
   ],
   "type": "string"
  },
  "Role": {
   "type": "string"
  },
  "SchedulingStrategy": {
   "enum": [
    "DAEMON",
    "REPLICA"
   ],
   "type": "string"
  },
  "ServiceArn": {
   "type": "string"
  },
  "ServiceConnectConfiguration": {
   "$ref": "#/definitions/ServiceConnectConfiguration"
  },
  "ServiceName": {
   "type": "string"
  },
  "ServiceRegistries": {
   "items": {
    "$ref": "#/definitions/ServiceRegistry"
   },
   "type": "array"
  },
  "Tags": {
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "minItems": 0,
   "type": "array"
  },
  "TaskDefinition": {
   "type": "string"
  },
  "VolumeConfigurations": {
   "items": {
    "$ref": "#/definitions/ServiceVolumeConfiguration"
   },
   "type": "array"
  },
  "VpcLatticeConfigurations": {
   "items": {
    "$ref": "#/definitions/VpcLatticeConfiguration"
   },
   "type": "array"
  }
 },
 "propertyTransform": {
  "/properties/Role": "Role $OR $join([\"arn:(aws)[-]{0,1}[a-z]{0,3}[-]{0,1}[a-z]{0,3}:iam::[0-9]{12}[:]role/{1}\", Role])",
  "/properties/TaskDefinition": "TaskDefinition $OR $join([\"arn:(aws)[-]{0,1}[a-z]{0,3}[-]{0,1}[a-z]{0,3}:ecs:[a-z0-9-]+:[0-9]{12}:task-definition/\", $contains(TaskDefinition,\":\")?TaskDefinition:$join([TaskDefinition, \":[0-9]+\"])])"
 },
 "readOnlyProperties": [
  "/properties/ServiceArn",
  "/properties/Name"
 ],
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::ECS::Service",
 "writeOnlyProperties": [
  "/properties/ServiceConnectConfiguration",
  "/properties/VolumeConfigurations",
  "/properties/ForceNewDeployment"
 ]
}
