{
  "tagging" : {
    "permissions" : [ "rtbfabric:TagResource", "rtbfabric:UntagResource", "rtbfabric:ListTagsForResource" ],
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "tagProperty" : "/properties/Tags",
    "cloudFormationSystemTags" : true
  },
  "handlers" : {
    "read" : {
      "permissions" : [ "rtbfabric:GetResponderGateway", "rtbfabric:GetCertificateAssociation", "rtbfabric:ListCertificateAssociations", "rtbfabric:ListTagsForResource", "acm:DescribeCertificate" ]
    },
    "create" : {
      "permissions" : [ "rtbfabric:CreateResponderGateway", "rtbfabric:GetResponderGateway", "rtbfabric:AssociateCertificate", "rtbfabric:GetCertificateAssociation", "rtbfabric:ListCertificateAssociations", "rtbfabric:TagResource", "rtbfabric:ListTagsForResource", "iam:CreateServiceLinkedRole", "acm:CreateCertificateRelation", "quickbeam:CreateCertificateRelation", "quickbeam-admin:CreateCertificateRelation", "acm:DescribeCertificate" ]
    },
    "update" : {
      "permissions" : [ "rtbfabric:GetResponderGateway", "rtbfabric:UpdateResponderGateway", "rtbfabric:ListCertificateAssociations", "rtbfabric:TagResource", "rtbfabric:UntagResource", "rtbfabric:ListTagsForResource" ]
    },
    "list" : {
      "permissions" : [ "rtbfabric:ListResponderGateways", "rtbfabric:ListCertificateAssociations" ]
    },
    "delete" : {
      "permissions" : [ "rtbfabric:DeleteResponderGateway", "rtbfabric:GetResponderGateway", "rtbfabric:DisassociateCertificate", "rtbfabric:ListCertificateAssociations", "rtbfabric:GetCertificateAssociation", "acm:RemoveCertificateRelation", "quickbeam:RemoveCertificateRelation", "quickbeam-admin:RemoveCertificateRelation" ]
    }
  },
  "typeName" : "AWS::RTBFabric::ResponderGateway",
  "readOnlyProperties" : [ "/properties/GatewayId", "/properties/Arn", "/properties/ResponderGatewayStatus", "/properties/CreatedTimestamp", "/properties/UpdatedTimestamp", "/properties/ExternalInboundEndpoint", "/properties/CertificateAssociationStatus" ],
  "description" : "Resource Type definition for AWS::RTBFabric::ResponderGateway Resource Type",
  "additionalIdentifiers" : [ [ "/properties/GatewayId" ] ],
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/Arn" ],
  "definitions" : {
    "TrustStoreConfiguration" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "CertificateAuthorityCertificates" : {
          "$ref" : "#/definitions/CertificateAuthorityCertificates"
        }
      },
      "required" : [ "CertificateAuthorityCertificates" ]
    },
    "Description" : {
      "pattern" : "^[A-Za-z0-9 ]+$",
      "type" : "string"
    },
    "CreatedTimestamp" : {
      "type" : "string"
    },
    "Port" : {
      "maximum" : 65535,
      "type" : "integer",
      "minimum" : 1
    },
    "GatewayType" : {
      "type" : "string",
      "enum" : [ "EXTERNAL", "INTERNAL" ]
    },
    "TotalLinksCount" : {
      "type" : "integer"
    },
    "ManagedEndpointConfiguration" : {
      "oneOf" : [ {
        "additionalProperties" : false,
        "properties" : {
          "AutoScalingGroupsConfiguration" : {
            "$ref" : "#/definitions/AutoScalingGroupsConfiguration"
          }
        },
        "required" : [ "AutoScalingGroupsConfiguration" ]
      }, {
        "additionalProperties" : false,
        "properties" : {
          "EksEndpointsConfiguration" : {
            "$ref" : "#/definitions/EksEndpointsConfiguration"
          }
        },
        "required" : [ "EksEndpointsConfiguration" ]
      } ],
      "type" : "object"
    },
    "SubnetIds" : {
      "minItems" : 1,
      "uniqueItems" : true,
      "description" : "The ID of one or more subnets in order to create a gateway.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "relationshipRef" : {
          "typeName" : "AWS::EC2::Subnet",
          "propertyPath" : "/properties/SubnetId"
        },
        "type" : "string"
      }
    },
    "Base64EncodedCertificateChain" : {
      "minLength" : 1,
      "type" : "string",
      "maxLength" : 2097152
    },
    "EksEndpointsConfiguration" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "ClusterApiServerCaCertificateChain" : {
          "minLength" : 1,
          "type" : "string",
          "maxLength" : 2097152
        },
        "EndpointsResourceName" : {
          "pattern" : "^[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9]$",
          "type" : "string"
        },
        "ClusterApiServerEndpointUri" : {
          "minLength" : 0,
          "pattern" : "^(https|http)://(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)(?:\\.(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?))+$",
          "type" : "string",
          "maxLength" : 255
        },
        "ClusterName" : {
          "pattern" : "^[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9]$",
          "type" : "string"
        },
        "EndpointsResourceNamespace" : {
          "pattern" : "^[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9]$",
          "type" : "string"
        },
        "RoleArn" : {
          "type" : "string"
        }
      },
      "required" : [ "EndpointsResourceName", "EndpointsResourceNamespace", "ClusterApiServerEndpointUri", "ClusterApiServerCaCertificateChain", "ClusterName", "RoleArn" ]
    },
    "ListenerConfig" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Protocols" : {
          "minItems" : 1,
          "maxItems" : 2,
          "insertionOrder" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Protocol"
          }
        }
      },
      "required" : [ "Protocols" ]
    },
    "AutoScalingGroupNameList" : {
      "uniqueItems" : true,
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "CertificateAssociationStatus" : {
      "type" : "string",
      "enum" : [ "PENDING_ASSOCIATION", "ASSOCIATED", "PENDING_DISASSOCIATION", "DISASSOCIATED", "EXPIRED", "FAILED" ]
    },
    "Protocol" : {
      "type" : "string",
      "enum" : [ "HTTP", "HTTPS" ]
    },
    "Tags" : {
      "minItems" : 0,
      "maxItems" : 50,
      "uniqueItems" : true,
      "description" : "Tags to assign to the Responder Gateway.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "AcmCertificateArn" : {
      "relationshipRef" : {
        "typeName" : "AWS::CertificateManager::Certificate",
        "propertyPath" : "/properties/CertificateArn"
      },
      "pattern" : "arn:(aws|aws-cn|aws-us-gov):acm:([a-z0-9-]+):[0-9]{12}:certificate/.{1,2048}",
      "type" : "string"
    },
    "InboundLinksCount" : {
      "type" : "integer"
    },
    "UpdatedTimestamp" : {
      "type" : "string"
    },
    "DomainName" : {
      "pattern" : "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)(?:\\.(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?))+$",
      "type" : "string"
    },
    "ActiveLinksCount" : {
      "type" : "integer"
    },
    "AutoScalingGroupsConfiguration" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "AutoScalingGroupNameList" : {
          "$ref" : "#/definitions/AutoScalingGroupNameList"
        },
        "HealthCheckConfig" : {
          "$ref" : "#/definitions/HealthCheckConfig"
        },
        "RoleArn" : {
          "type" : "string"
        }
      },
      "required" : [ "AutoScalingGroupNameList", "RoleArn" ]
    },
    "ExternalInboundEndpoint" : {
      "$ref" : "#/definitions/DomainName"
    },
    "GatewayId" : {
      "pattern" : "^(rtbapp-[a-z0-9-]{1,25}|rtb-gw-[a-z0-9-]{1,25})$",
      "type" : "string"
    },
    "SecurityGroupIds" : {
      "minItems" : 1,
      "uniqueItems" : true,
      "description" : "The ID of one or more security groups in order to create a gateway.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "anyOf" : [ {
          "relationshipRef" : {
            "typeName" : "AWS::EC2::SecurityGroup",
            "propertyPath" : "/properties/GroupId"
          }
        }, {
          "relationshipRef" : {
            "typeName" : "AWS::EC2::SecurityGroup",
            "propertyPath" : "/properties/Id"
          }
        } ],
        "type" : "string"
      }
    },
    "VpcId" : {
      "relationshipRef" : {
        "typeName" : "AWS::EC2::VPC",
        "propertyPath" : "/properties/VpcId"
      },
      "minLength" : 5,
      "type" : "string",
      "maxLength" : 50
    },
    "ResponderGatewayStatus" : {
      "type" : "string",
      "enum" : [ "PENDING_CREATION", "ACTIVE", "PENDING_DELETION", "DELETED", "ERROR", "PENDING_UPDATE", "ISOLATED", "PENDING_ISOLATION", "PENDING_RESTORATION" ]
    },
    "CertificateAuthorityCertificates" : {
      "minItems" : 0,
      "maxItems" : 1,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Base64EncodedCertificateChain"
      }
    },
    "HealthCheckConfig" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Path" : {
          "minLength" : 1,
          "pattern" : "^/.*$",
          "type" : "string",
          "maxLength" : 128
        },
        "TimeoutMs" : {
          "maximum" : 5000,
          "type" : "integer",
          "minimum" : 100
        },
        "HealthyThresholdCount" : {
          "maximum" : 10,
          "type" : "integer",
          "minimum" : 2
        },
        "Port" : {
          "maximum" : 65535,
          "type" : "integer",
          "minimum" : 80
        },
        "StatusCodeMatcher" : {
          "minLength" : 3,
          "pattern" : "^[0-9,\\-]+$",
          "type" : "string",
          "maxLength" : 2000
        },
        "Protocol" : {
          "$ref" : "#/definitions/Protocol"
        },
        "UnhealthyThresholdCount" : {
          "maximum" : 10,
          "type" : "integer",
          "minimum" : 2
        },
        "IntervalSeconds" : {
          "maximum" : 60,
          "type" : "integer",
          "minimum" : 5
        }
      },
      "required" : [ "Port", "Path" ]
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Value" : {
          "minLength" : 0,
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "type" : "string",
          "maxLength" : 256
        },
        "Key" : {
          "minLength" : 1,
          "pattern" : "^(resourceArn|internalId|[a-zA-Z0-9+\\-=._:/@]+)$",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "type" : "string",
          "maxLength" : 128
        }
      },
      "required" : [ "Key" ]
    },
    "Arn" : {
      "minLength" : 20,
      "pattern" : "^arn:aws:rtbfabric:[a-zA-Z0-9_-]+:[0-9]{12}:gateway/[a-zA-Z0-9-]+$",
      "type" : "string",
      "maxLength" : 2048
    }
  },
  "properties" : {
    "UpdatedTimestamp" : {
      "$ref" : "#/definitions/UpdatedTimestamp"
    },
    "TrustStoreConfiguration" : {
      "$ref" : "#/definitions/TrustStoreConfiguration"
    },
    "Description" : {
      "$ref" : "#/definitions/Description"
    },
    "CreatedTimestamp" : {
      "$ref" : "#/definitions/CreatedTimestamp"
    },
    "DomainName" : {
      "$ref" : "#/definitions/DomainName"
    },
    "Port" : {
      "$ref" : "#/definitions/Port"
    },
    "GatewayType" : {
      "$ref" : "#/definitions/GatewayType"
    },
    "ExternalInboundEndpoint" : {
      "$ref" : "#/definitions/ExternalInboundEndpoint"
    },
    "GatewayId" : {
      "$ref" : "#/definitions/GatewayId"
    },
    "ManagedEndpointConfiguration" : {
      "$ref" : "#/definitions/ManagedEndpointConfiguration"
    },
    "SubnetIds" : {
      "$ref" : "#/definitions/SubnetIds"
    },
    "SecurityGroupIds" : {
      "$ref" : "#/definitions/SecurityGroupIds"
    },
    "ListenerConfig" : {
      "$ref" : "#/definitions/ListenerConfig"
    },
    "VpcId" : {
      "$ref" : "#/definitions/VpcId"
    },
    "ResponderGatewayStatus" : {
      "$ref" : "#/definitions/ResponderGatewayStatus"
    },
    "CertificateAssociationStatus" : {
      "$ref" : "#/definitions/CertificateAssociationStatus"
    },
    "Arn" : {
      "$ref" : "#/definitions/Arn"
    },
    "Protocol" : {
      "$ref" : "#/definitions/Protocol"
    },
    "Tags" : {
      "$ref" : "#/definitions/Tags"
    },
    "AcmCertificateArn" : {
      "$ref" : "#/definitions/AcmCertificateArn"
    }
  },
  "required" : [ "VpcId", "SubnetIds", "SecurityGroupIds", "Port", "Protocol" ],
  "conditionalCreateOnlyProperties" : [ "/properties/Description", "/properties/VpcId", "/properties/SubnetIds", "/properties/SecurityGroupIds", "/properties/Port", "/properties/Protocol", "/properties/DomainName", "/properties/TrustStoreConfiguration", "/properties/ManagedEndpointConfiguration", "/properties/GatewayType", "/properties/AcmCertificateArn" ]
}