{
  "typeName" : "AWS::SageMaker::FeatureGroup",
  "description" : "Resource Type definition for AWS::SageMaker::FeatureGroup",
  "additionalProperties" : false,
  "properties" : {
    "FeatureGroupName" : {
      "type" : "string",
      "description" : "The Name of the FeatureGroup.",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"
    },
    "RecordIdentifierFeatureName" : {
      "type" : "string",
      "description" : "The Record Identifier Feature Name.",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"
    },
    "EventTimeFeatureName" : {
      "type" : "string",
      "description" : "The Event Time Feature Name.",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"
    },
    "FeatureDefinitions" : {
      "type" : "array",
      "description" : "An Array of Feature Definition",
      "uniqueItems" : false,
      "minItems" : 1,
      "maxItems" : 2500,
      "items" : {
        "$ref" : "#/definitions/FeatureDefinition"
      }
    },
    "OnlineStoreConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "SecurityConfig" : {
          "$ref" : "#/definitions/OnlineStoreSecurityConfig"
        },
        "EnableOnlineStore" : {
          "type" : "boolean"
        }
      }
    },
    "OfflineStoreConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "S3StorageConfig" : {
          "$ref" : "#/definitions/S3StorageConfig"
        },
        "DisableGlueTableCreation" : {
          "type" : "boolean"
        },
        "DataCatalogConfig" : {
          "$ref" : "#/definitions/DataCatalogConfig"
        },
        "TableFormat" : {
          "$ref" : "#/definitions/TableFormat"
        }
      },
      "required" : [ "S3StorageConfig" ]
    },
    "RoleArn" : {
      "type" : "string",
      "description" : "Role Arn",
      "minLength" : 20,
      "maxLength" : 2048,
      "pattern" : "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"
    },
    "Description" : {
      "type" : "string",
      "description" : "Description about the FeatureGroup.",
      "maxLength" : 128
    },
    "Tags" : {
      "type" : "array",
      "description" : "An array of key-value pair to apply to this resource.",
      "uniqueItems" : false,
      "maxItems" : 50,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "definitions" : {
    "FeatureDefinition" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "FeatureName" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 64,
          "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"
        },
        "FeatureType" : {
          "type" : "string",
          "enum" : [ "Integral", "Fractional", "String" ]
        }
      },
      "required" : [ "FeatureName", "FeatureType" ]
    },
    "KmsKeyId" : {
      "type" : "string",
      "maxLength" : 2048
    },
    "OnlineStoreSecurityConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "KmsKeyId" : {
          "$ref" : "#/definitions/KmsKeyId"
        }
      }
    },
    "S3StorageConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "S3Uri" : {
          "type" : "string",
          "maxLength" : 1024,
          "pattern" : "^(https|s3)://([^/]+)/?(.*)$"
        },
        "KmsKeyId" : {
          "$ref" : "#/definitions/KmsKeyId"
        }
      },
      "required" : [ "S3Uri" ]
    },
    "DataCatalogConfig" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "TableName" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\t]*"
        },
        "Catalog" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\t]*"
        },
        "Database" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\t]*"
        }
      },
      "required" : [ "TableName", "Catalog", "Database" ]
    },
    "TableFormat" : {
      "type" : "string",
      "description" : "Format for the offline store feature group. Iceberg is the optimal format for feature groups shared between offline and online stores.",
      "enum" : [ "Iceberg", "Glue" ]
    },
    "Tag" : {
      "type" : "object",
      "description" : "A key-value pair to associate with a resource.",
      "additionalProperties" : false,
      "properties" : {
        "Value" : {
          "type" : "string"
        },
        "Key" : {
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "required" : [ "FeatureGroupName", "RecordIdentifierFeatureName", "EventTimeFeatureName", "FeatureDefinitions" ],
  "createOnlyProperties" : [ "/properties/FeatureGroupName", "/properties/RecordIdentifierFeatureName", "/properties/EventTimeFeatureName", "/properties/OnlineStoreConfig", "/properties/OfflineStoreConfig", "/properties/RoleArn", "/properties/Description", "/properties/Tags" ],
  "primaryIdentifier" : [ "/properties/FeatureGroupName" ],
  "readOnlyProperties" : [ "/properties/CreationTime", "/properties/FeatureGroupStatus", "/properties/FailureReason", "/properties/OfflineStoreStatus" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iam:PassRole", "kms:CreateGrant", "kms:DescribeKey", "glue:CreateTable", "glue:GetTable", "glue:CreateDatabase", "glue:GetDatabase", "sagemaker:CreateFeatureGroup", "sagemaker:DescribeFeatureGroup", "sagemaker:AddTags", "sagemaker:ListTags" ]
    },
    "update" : {
      "permissions" : [ "sagemaker:UpdateFeatureGroup", "sagemaker:DescribeFeatureGroup", "sagemaker:AddTags", "sagemaker:ListTags", "sagemaker:DeleteTags" ]
    },
    "read" : {
      "permissions" : [ "sagemaker:DescribeFeatureGroup", "sagemaker:ListTags" ]
    },
    "delete" : {
      "permissions" : [ "sagemaker:DeleteFeatureGroup", "sagemaker:DescribeFeatureGroup" ]
    },
    "list" : {
      "permissions" : [ "sagemaker:ListFeatureGroups" ]
    }
  }
}