{
  "typeName" : "AWS::SageMaker::Project",
  "description" : "Resource Type definition for AWS::SageMaker::Project",
  "definitions" : {
    "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 127 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 -. ",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 1 to 255 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 -. ",
          "maxLength" : 256,
          "pattern" : "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "ProjectDescription" : {
      "type" : "string",
      "description" : "The description of the project.",
      "pattern" : ".*",
      "maxLength" : 1024
    },
    "ProjectId" : {
      "type" : "string",
      "description" : "Project Id.",
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9])*",
      "maxLength" : 20
    },
    "ProvisionedProductStatusMessage" : {
      "type" : "string",
      "description" : "Provisioned Product Status Message"
    },
    "ProjectName" : {
      "type" : "string",
      "description" : "The name of the project.",
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$",
      "minLength" : 1,
      "maxLength" : 32
    },
    "ProjectArn" : {
      "description" : "The Amazon Resource Name (ARN) of the Project.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 2048,
      "pattern" : "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:project.*"
    },
    "ProductId" : {
      "type" : "string",
      "description" : "Service Catalog product identifier.",
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$",
      "maxLength" : 100
    },
    "ProvisioningArtifactId" : {
      "type" : "string",
      "description" : "The identifier of the provisioning artifact (also known as a version).",
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$",
      "maxLength" : 100
    },
    "PathId" : {
      "type" : "string",
      "description" : "The path identifier of the product.",
      "pattern" : "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$",
      "maxLength" : 100
    },
    "ProvisioningParameter" : {
      "description" : "Information about a parameter used to provision a product.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The parameter key.",
          "minLength" : 1,
          "maxLength" : 1000,
          "pattern" : ".*"
        },
        "Value" : {
          "type" : "string",
          "description" : "The parameter value.",
          "maxLength" : 4096,
          "pattern" : ".*"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "TemplateProviderDetail" : {
      "description" : "Details about the template provider for the SageMaker project.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "CfnTemplateProviderDetail" : {
          "$ref" : "#/definitions/CfnTemplateProviderDetail"
        }
      },
      "oneOf" : [ {
        "required" : [ "CfnTemplateProviderDetail" ]
      } ]
    },
    "CfnTemplateProviderDetail" : {
      "description" : "CloudFormation template provider details for a SageMaker project.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Parameters" : {
          "$ref" : "#/definitions/CfnStackParameters"
        },
        "RoleARN" : {
          "type" : "string",
          "description" : "The Amazon Resource Name (ARN) of the IAM role used by the template provider.",
          "minLength" : 20,
          "maxLength" : 2048,
          "pattern" : "arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+"
        },
        "TemplateName" : {
          "type" : "string",
          "description" : "The name of the template used for the project.",
          "minLength" : 1,
          "maxLength" : 32,
          "pattern" : "(?=.{1,32}$)[a-zA-Z0-9](-*[a-zA-Z0-9])*"
        },
        "TemplateURL" : {
          "type" : "string",
          "description" : "The URL of the CloudFormation template.",
          "minLength" : 1,
          "maxLength" : 1024,
          "pattern" : "(?=.{1,1024}$)(https)://([^/]+)/(.+)"
        }
      },
      "required" : [ "TemplateName", "TemplateURL" ]
    },
    "CfnStackParameters" : {
      "type" : "array",
      "description" : "A list of parameters used in the CloudFormation template.",
      "minItems" : 0,
      "maxItems" : 180,
      "items" : {
        "$ref" : "#/definitions/CfnStackParameter"
      }
    },
    "CfnStackParameter" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key of the parameter.",
          "minLength" : 1,
          "maxLength" : 255
        },
        "Value" : {
          "type" : "string",
          "description" : "The value of the parameter.",
          "maxLength" : 4096
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "Tags" : {
      "type" : "array",
      "maxItems" : 40,
      "description" : "An array of key-value pairs to apply to this resource.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "ProjectArn" : {
      "$ref" : "#/definitions/ProjectArn"
    },
    "ProjectId" : {
      "$ref" : "#/definitions/ProjectId"
    },
    "ProjectName" : {
      "$ref" : "#/definitions/ProjectName"
    },
    "ProjectDescription" : {
      "$ref" : "#/definitions/ProjectDescription"
    },
    "CreationTime" : {
      "description" : "The time at which the project was created.",
      "type" : "string"
    },
    "ServiceCatalogProvisioningDetails" : {
      "description" : "Input ServiceCatalog Provisioning Details",
      "type" : "object",
      "properties" : {
        "ProductId" : {
          "$ref" : "#/definitions/ProductId"
        },
        "ProvisioningArtifactId" : {
          "$ref" : "#/definitions/ProvisioningArtifactId"
        },
        "PathId" : {
          "$ref" : "#/definitions/PathId"
        },
        "ProvisioningParameters" : {
          "type" : "array",
          "description" : "Parameters specified by the administrator that are required for provisioning the product.",
          "items" : {
            "$ref" : "#/definitions/ProvisioningParameter"
          }
        }
      },
      "required" : [ "ProductId" ],
      "additionalProperties" : false
    },
    "ServiceCatalogProvisionedProductDetails" : {
      "description" : "Provisioned ServiceCatalog  Details",
      "type" : "object",
      "properties" : {
        "ProvisionedProductId" : {
          "$ref" : "#/definitions/ProvisioningArtifactId"
        },
        "ProvisionedProductStatusMessage" : {
          "$ref" : "#/definitions/ProvisionedProductStatusMessage"
        }
      },
      "additionalProperties" : false
    },
    "TemplateProviderDetails" : {
      "type" : "array",
      "minItems" : 1,
      "maxItems" : 1,
      "description" : "An array of template providers associated with the project.",
      "items" : {
        "$ref" : "#/definitions/TemplateProviderDetail"
      },
      "insertionOrder" : true
    },
    "ProjectStatus" : {
      "description" : "The status of a project.",
      "type" : "string",
      "enum" : [ "Pending", "CreateInProgress", "CreateCompleted", "CreateFailed", "DeleteInProgress", "DeleteFailed", "DeleteCompleted" ]
    }
  },
  "additionalProperties" : false,
  "required" : [ "ProjectName" ],
  "oneOf" : [ {
    "required" : [ "ServiceCatalogProvisioningDetails" ]
  }, {
    "required" : [ "TemplateProviderDetails" ]
  } ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "sagemaker:AddTags", "sagemaker:ListTags", "sagemaker:DeleteTags" ]
  },
  "readOnlyProperties" : [ "/properties/ProjectArn", "/properties/CreationTime", "/properties/ProjectId", "/properties/ProjectStatus" ],
  "createOnlyProperties" : [ "/properties/ProjectName", "/properties/ProjectDescription", "/properties/ServiceCatalogProvisioningDetails", "/properties/TemplateProviderDetails", "/properties/Tags" ],
  "primaryIdentifier" : [ "/properties/ProjectArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "sagemaker:AddTags", "sagemaker:CreateProject", "sagemaker:DescribeProject", "sagemaker:ListTags", "servicecatalog:DescribeProduct", "servicecatalog:DescribeProvisioningArtifact", "servicecatalog:ProvisionProduct", "servicecatalog:DescribeProvisionedProduct", "servicecatalog:TerminateProvisionedProduct", "cloudformation:DescribeStacks", "cloudformation:CreateStack", "iam:PassRole", "s3:GetObject" ]
    },
    "read" : {
      "permissions" : [ "sagemaker:DescribeProject", "sagemaker:ListTags" ]
    },
    "update" : {
      "permissions" : [ "sagemaker:DescribeProject", "sagemaker:ListTags", "sagemaker:AddTags", "sagemaker:DeleteTags" ]
    },
    "delete" : {
      "permissions" : [ "sagemaker:DeleteProject", "sagemaker:DescribeProject", "servicecatalog:TerminateProvisionedProduct", "servicecatalog:DescribeRecord", "cloudformation:DescribeStacks", "cloudformation:DeleteStack" ]
    },
    "list" : {
      "permissions" : [ "sagemaker:ListProjects" ]
    }
  }
}