{
  "typeName" : "AWS::GameLift::Alias",
  "description" : "The AWS::GameLift::Alias resource creates an alias for an Amazon GameLift (GameLift) fleet destination.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-gamelift.git",
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "gamelift:ListTagsForResource", "gamelift:TagResource", "gamelift:UntagResource" ]
  },
  "definitions" : {
    "RoutingStrategy" : {
      "type" : "object",
      "properties" : {
        "Message" : {
          "description" : "The message text to be used with a terminal routing strategy. If you specify TERMINAL for the Type property, you must specify this property.",
          "type" : "string"
        },
        "FleetId" : {
          "description" : "A unique identifier for a fleet that the alias points to. If you specify SIMPLE for the Type property, you must specify this property.",
          "type" : "string",
          "pattern" : "^[a-z]*fleet-[a-zA-Z0-9\\-]+"
        },
        "Type" : {
          "description" : "Simple routing strategy. The alias resolves to one specific fleet. Use this type when routing to active fleets.",
          "type" : "string",
          "enum" : [ "SIMPLE", "TERMINAL" ]
        }
      },
      "additionalProperties" : false,
      "required" : [ "Type" ],
      "anyOf" : [ {
        "required" : [ "FleetId" ]
      }, {
        "required" : [ "Message" ]
      } ]
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Description" : {
      "description" : "A human-readable description of the alias.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024
    },
    "Name" : {
      "description" : "A descriptive label that is associated with an alias. Alias names do not need to be unique.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024,
      "pattern" : ".*\\S.*"
    },
    "RoutingStrategy" : {
      "description" : "A routing configuration that specifies where traffic is directed for this alias, such as to a fleet or to a message.",
      "$ref" : "#/definitions/RoutingStrategy"
    },
    "AliasId" : {
      "description" : "Unique alias ID",
      "type" : "string"
    },
    "AliasArn" : {
      "description" : "The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Alias resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift Alias ARN, the resource ID matches the AliasId value.",
      "pattern" : "^arn:.*:alias\\/alias-\\S+",
      "type" : "string"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "maxItems" : 200,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "Name", "RoutingStrategy" ],
  "readOnlyProperties" : [ "/properties/AliasId", "/properties/AliasArn" ],
  "primaryIdentifier" : [ "/properties/AliasId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "gamelift:CreateAlias", "gamelift:TagResource" ]
    },
    "read" : {
      "permissions" : [ "gamelift:DescribeAlias", "gamelift:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "gamelift:UpdateAlias", "gamelift:DescribeAlias", "gamelift:ListTagsForResource", "gamelift:TagResource", "gamelift:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "gamelift:DeleteAlias" ]
    },
    "list" : {
      "permissions" : [ "gamelift:ListAliases" ]
    }
  }
}