{
  "typeName" : "AWS::GameLiftStreams::StreamGroup",
  "description" : "Definition of AWS::GameLiftStreams::StreamGroup Resource Type",
  "definitions" : {
    "DefaultApplication" : {
      "type" : "object",
      "properties" : {
        "Id" : {
          "type" : "string",
          "maxLength" : 32,
          "minLength" : 1,
          "pattern" : "^[a-zA-Z0-9-]+$"
        },
        "Arn" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 1,
          "pattern" : "^arn:aws:gameliftstreams:([^:\n]*):([0-9]{12}):([^:\n]*)$"
        }
      },
      "additionalProperties" : false
    },
    "LocationConfiguration" : {
      "type" : "object",
      "properties" : {
        "LocationName" : {
          "type" : "string",
          "maxLength" : 20,
          "minLength" : 1,
          "pattern" : "^[a-zA-Z0-9-]+$"
        },
        "AlwaysOnCapacity" : {
          "type" : "integer",
          "minimum" : 0
        },
        "OnDemandCapacity" : {
          "type" : "integer",
          "minimum" : 0,
          "description" : "This shape is deprecated."
        },
        "TargetIdleCapacity" : {
          "type" : "integer",
          "minimum" : 0
        },
        "MaximumCapacity" : {
          "type" : "integer",
          "minimum" : 0
        },
        "VpcTransitConfiguration" : {
          "$ref" : "#/definitions/VpcTransitConfiguration"
        }
      },
      "required" : [ "LocationName" ],
      "additionalProperties" : false
    },
    "Tags" : {
      "type" : "object",
      "maxProperties" : 50,
      "minProperties" : 1,
      "patternProperties" : {
        ".+" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0
        }
      },
      "additionalProperties" : false
    },
    "VpcTransitConfiguration" : {
      "type" : "object",
      "properties" : {
        "VpcId" : {
          "type" : "string",
          "maxLength" : 32,
          "minLength" : 1
        },
        "Ipv4CidrBlocks" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([0-9]|[1-2][0-9]|3[0-2])$"
          },
          "maxItems" : 5,
          "minItems" : 1,
          "uniqueItems" : true
        }
      },
      "required" : [ "Ipv4CidrBlocks", "VpcId" ],
      "additionalProperties" : false
    },
    "StreamClass" : {
      "type" : "string",
      "maxLength" : 20,
      "minLength" : 1
    }
  },
  "properties" : {
    "Arn" : {
      "type" : "string",
      "maxLength" : 128,
      "minLength" : 1,
      "pattern" : "^(^[a-zA-Z0-9-]+$)|(^arn:aws:gameliftstreams:([^:\n]*):([0-9]{12}):([^:\n]*)$)$"
    },
    "DefaultApplication" : {
      "$ref" : "#/definitions/DefaultApplication"
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 80,
      "minLength" : 1,
      "pattern" : "^[a-zA-Z0-9-_.!+@/][a-zA-Z0-9-_.!+@/ ]*$"
    },
    "Id" : {
      "type" : "string",
      "maxLength" : 32,
      "minLength" : 1,
      "pattern" : "^[a-zA-Z0-9-]+$"
    },
    "StreamClass" : {
      "$ref" : "#/definitions/StreamClass"
    },
    "Tags" : {
      "$ref" : "#/definitions/Tags"
    },
    "LocationConfigurations" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/LocationConfiguration"
      },
      "maxItems" : 100,
      "minItems" : 1,
      "uniqueItems" : true,
      "insertionOrder" : false
    }
  },
  "required" : [ "Description", "LocationConfigurations", "StreamClass" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/Id" ],
  "createOnlyProperties" : [ "/properties/StreamClass", "/properties/DefaultApplication/Id" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "gameliftstreams:CreateStreamGroup", "gameliftstreams:UpdateStreamGroup", "gameliftstreams:GetStreamGroup", "gameliftstreams:TagResource", "gameliftstreams:ListTagsForResource", "gameliftstreams:AssociateApplications", "ec2:DescribeVpcs" ]
    },
    "delete" : {
      "permissions" : [ "gameliftstreams:DeleteStreamGroup", "gameliftstreams:GetStreamGroup" ]
    },
    "list" : {
      "permissions" : [ "gameliftstreams:ListStreamGroups", "gameliftstreams:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "gameliftstreams:GetStreamGroup", "gameliftstreams:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "gameliftstreams:UpdateStreamGroup", "gameliftstreams:GetStreamGroup", "gameliftstreams:AddStreamGroupLocations", "gameliftstreams:RemoveStreamGroupLocations", "gameliftstreams:TagResource", "gameliftstreams:UntagResource", "gameliftstreams:ListTagsForResource", "ec2:DescribeVpcs" ]
    }
  },
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "gameliftstreams:TagResource", "gameliftstreams:UntagResource", "gameliftstreams:ListTagsForResource" ]
  },
  "propertyTransform" : {
    "/properties/LocationConfiguration/OnDemandCapacity" : "$exists(LocationConfiguration.MaximumCapacity) ? (LocationConfiguration.MaximumCapacity - LocationConfiguration.AlwaysOnCapacity) : 0",
    "/properties/LocationConfiguration/MaximumCapacity" : "($exists(LocationConfiguration.OnDemandCapacity) ? LocationConfiguration.OnDemandCapacity : 0) + LocationConfiguration.AlwaysOnCapacity"
  },
  "additionalIdentifiers" : [ [ "/properties/Id" ] ],
  "deprecatedProperties" : [ "/properties/LocationConfiguration/OnDemandCapacity" ]
}