{
  "typeName" : "AWS::ECS::Cluster",
  "description" : "Create an Elastic Container Service (ECS) cluster.",
  "definitions" : {
    "Tag" : {
      "description" : "The metadata that you apply to the cluster to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ClusterSettings" : {
      "description" : "The setting to use when creating a cluster. This parameter is used to enable CloudWatch Container Insights for a cluster. If this value is specified, it will override the containerInsights value set with PutAccountSetting or PutAccountSettingDefault.",
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ClusterConfiguration" : {
      "description" : "The configurations to be set at cluster level.",
      "type" : "object",
      "properties" : {
        "ExecuteCommandConfiguration" : {
          "$ref" : "#/definitions/ExecuteCommandConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "ExecuteCommandConfiguration" : {
      "description" : "The configuration for ExecuteCommand.",
      "type" : "object",
      "properties" : {
        "KmsKeyId" : {
          "type" : "string"
        },
        "Logging" : {
          "type" : "string"
        },
        "LogConfiguration" : {
          "$ref" : "#/definitions/ExecuteCommandLogConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "ExecuteCommandLogConfiguration" : {
      "description" : "The session logging configuration for ExecuteCommand.",
      "type" : "object",
      "properties" : {
        "CloudWatchLogGroupName" : {
          "type" : "string"
        },
        "CloudWatchEncryptionEnabled" : {
          "type" : "boolean"
        },
        "S3BucketName" : {
          "type" : "string"
        },
        "S3EncryptionEnabled" : {
          "type" : "boolean"
        },
        "S3KeyPrefix" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ServiceConnectDefaults" : {
      "description" : "Service Connect Configuration default for all services or tasks within this cluster",
      "type" : "object",
      "properties" : {
        "Namespace" : {
          "description" : "Service Connect Namespace Name or ARN default for all services or tasks within this cluster",
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "CapacityProviderStrategyItem" : {
      "description" : "A capacity provider strategy consists of one or more capacity providers along with the `base` and `weight` to assign to them. A capacity provider must be associated with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders API is used to associate a capacity provider with a cluster. Only capacity providers with an `ACTIVE` or `UPDATING` status can be used.",
      "type" : "object",
      "properties" : {
        "CapacityProvider" : {
          "type" : "string"
        },
        "Weight" : {
          "type" : "integer"
        },
        "Base" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Tags" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "ClusterName" : {
      "description" : "A user-generated string that you use to identify your cluster. If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.",
      "type" : "string"
    },
    "ClusterSettings" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ClusterSettings"
      }
    },
    "Configuration" : {
      "$ref" : "#/definitions/ClusterConfiguration"
    },
    "CapacityProviders" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "DefaultCapacityProviderStrategy" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/CapacityProviderStrategyItem"
      }
    },
    "ServiceConnectDefaults" : {
      "$ref" : "#/definitions/ServiceConnectDefaults"
    },
    "Arn" : {
      "description" : "The Amazon Resource Name (ARN) of the Amazon ECS cluster, such as arn:aws:ecs:us-east-2:123456789012:cluster/MyECSCluster.",
      "type" : "string"
    }
  },
  "primaryIdentifier" : [ "/properties/ClusterName" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ecs:CreateCluster", "ecs:DescribeClusters", "iam:CreateServiceLinkedRole" ]
    },
    "read" : {
      "permissions" : [ "ecs:DescribeClusters" ]
    },
    "update" : {
      "permissions" : [ "ecs:PutAccountSettingDefault", "ecs:DescribeClusters", "ecs:TagResource", "ecs:UntagResource", "ecs:PutAccountSetting", "ecs:ListTagsForResource", "ecs:UpdateCluster", "ecs:UpdateClusterSettings", "ecs:PutClusterCapacityProviders" ]
    },
    "delete" : {
      "permissions" : [ "ecs:DeleteCluster", "ecs:DescribeClusters" ]
    },
    "list" : {
      "permissions" : [ "ecs:DescribeClusters", "ecs:ListClusters" ]
    }
  },
  "readOnlyProperties" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/ClusterName" ],
  "writeOnlyProperties" : [ "/properties/ServiceConnectDefaults" ],
  "additionalProperties" : false
}