{
  "typeName" : "AWS::EMRContainers::Endpoint",
  "description" : "Resource Schema of AWS::EMRContainers::Endpoint Type",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalIdentifiers" : [ [ "/properties/VirtualClusterId", "/properties/Id" ] ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/Id", "/properties/ServerUrl", "/properties/State", "/properties/StateDetails", "/properties/FailureReason", "/properties/CreatedAt", "/properties/SecurityGroup", "/properties/CertificateAuthority" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/VirtualClusterId", "/properties/Type", "/properties/ReleaseLabel", "/properties/ExecutionRoleArn", "/properties/ConfigurationOverrides" ],
  "definitions" : {
    "ConfigurationOverrides" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ApplicationConfiguration" : {
          "type" : "array",
          "maxItems" : 100,
          "items" : {
            "$ref" : "#/definitions/EMREKSConfiguration"
          }
        },
        "MonitoringConfiguration" : {
          "$ref" : "#/definitions/MonitoringConfiguration"
        }
      }
    },
    "EMREKSConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Classification" : {
          "type" : "string"
        },
        "Properties" : {
          "type" : "object",
          "patternProperties" : {
            ".*" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "Configurations" : {
          "type" : "array",
          "maxItems" : 100,
          "items" : {
            "$ref" : "#/definitions/EMREKSConfiguration"
          }
        }
      },
      "required" : [ "Classification" ]
    },
    "MonitoringConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PersistentAppUI" : {
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "ContainerLogRotationConfiguration" : {
          "$ref" : "#/definitions/ContainerLogRotationConfiguration"
        },
        "CloudWatchMonitoringConfiguration" : {
          "$ref" : "#/definitions/CloudWatchMonitoringConfiguration"
        },
        "S3MonitoringConfiguration" : {
          "$ref" : "#/definitions/S3MonitoringConfiguration"
        }
      }
    },
    "ContainerLogRotationConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "RotationSize" : {
          "type" : "string"
        },
        "MaxFilesToKeep" : {
          "type" : "integer"
        }
      },
      "required" : [ "RotationSize", "MaxFilesToKeep" ]
    },
    "CloudWatchMonitoringConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "LogGroupName" : {
          "type" : "string"
        },
        "LogStreamNamePrefix" : {
          "type" : "string"
        }
      },
      "required" : [ "LogGroupName" ]
    },
    "S3MonitoringConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "LogUri" : {
          "type" : "string"
        }
      },
      "required" : [ "LogUri" ]
    },
    "Certificate" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "CertificateArn" : {
          "type" : "string"
        },
        "CertificateData" : {
          "type" : "string"
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "description" : "A user-defined key, which is the minimum required information for a valid tag.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "A user-defined value, which is optional in a tag.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "Arn" : {
      "description" : "The ARN of the managed endpoint.",
      "type" : "string"
    },
    "Id" : {
      "description" : "The ID of the managed endpoint.",
      "type" : "string"
    },
    "Name" : {
      "description" : "The name of the managed endpoint.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "[0-9A-Za-z][A-Za-z0-9\\-_]*"
    },
    "VirtualClusterId" : {
      "description" : "The ID of the virtual cluster for which the managed endpoint is created.",
      "type" : "string"
    },
    "Type" : {
      "description" : "The type of the managed endpoint.",
      "type" : "string"
    },
    "ReleaseLabel" : {
      "description" : "The Amazon EMR release label.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "[A-Za-z0-9._/-]+"
    },
    "ExecutionRoleArn" : {
      "description" : "The execution role ARN for the managed endpoint.",
      "type" : "string"
    },
    "ConfigurationOverrides" : {
      "description" : "The configuration overrides for the managed endpoint.",
      "$ref" : "#/definitions/ConfigurationOverrides"
    },
    "ServerUrl" : {
      "description" : "The server URL of the managed endpoint.",
      "type" : "string"
    },
    "State" : {
      "description" : "The state of the managed endpoint.",
      "type" : "string"
    },
    "StateDetails" : {
      "description" : "Additional details about the state of the managed endpoint.",
      "type" : "string"
    },
    "FailureReason" : {
      "description" : "The reason for a failed managed endpoint.",
      "type" : "string"
    },
    "CreatedAt" : {
      "description" : "The date and time when the managed endpoint was created.",
      "type" : "string"
    },
    "SecurityGroup" : {
      "description" : "The security group associated with the managed endpoint.",
      "type" : "string"
    },
    "CertificateAuthority" : {
      "description" : "The certificate authority for the managed endpoint.",
      "$ref" : "#/definitions/Certificate"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this managed endpoint.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 50
    }
  },
  "additionalProperties" : false,
  "required" : [ "VirtualClusterId", "Type", "ReleaseLabel", "ExecutionRoleArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "emr-containers:TagResource", "emr-containers:UntagResource", "emr-containers:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "emr-containers:CreateManagedEndpoint", "emr-containers:DescribeManagedEndpoint", "emr-containers:TagResource", "ec2:CreateSecurityGroup", "ec2:DeleteSecurityGroup", "ec2:AuthorizeSecurityGroupEgress", "ec2:AuthorizeSecurityGroupIngress", "ec2:RevokeSecurityGroupEgress", "ec2:RevokeSecurityGroupIngress" ]
    },
    "read" : {
      "permissions" : [ "emr-containers:DescribeManagedEndpoint", "emr-containers:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "emr-containers:DeleteManagedEndpoint", "emr-containers:DescribeManagedEndpoint", "ec2:DeleteSecurityGroup", "ec2:DescribeSecurityGroup", "ec2:DescribeNetworkInterfaces", "ec2:DeleteNetworkInterface", "ec2:AuthorizeSecurityGroupEgress", "ec2:AuthorizeSecurityGroupIngress", "ec2:RevokeSecurityGroupEgress", "ec2:RevokeSecurityGroupIngress" ]
    },
    "list" : {
      "permissions" : [ "emr-containers:ListManagedEndpoints" ]
    },
    "update" : {
      "permissions" : [ "emr-containers:DescribeManagedEndpoint", "emr-containers:ListTagsForResource", "emr-containers:TagResource", "emr-containers:UntagResource" ]
    }
  }
}