{
  "typeName" : "AWS::SystemsManagerSAP::Application",
  "description" : "Resource schema for AWS::SystemsManagerSAP::Application",
  "properties" : {
    "ApplicationId" : {
      "type" : "string",
      "pattern" : "[\\w\\d]{1,50}"
    },
    "ApplicationType" : {
      "type" : "string",
      "enum" : [ "HANA" ]
    },
    "Arn" : {
      "description" : "The ARN of the Helix application",
      "type" : "string",
      "pattern" : "^arn:(.+:){2,4}.+$|^arn:(.+:){1,3}.+\\/.+$"
    },
    "Credentials" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Credential"
      },
      "minItems" : 1,
      "insertionOrder" : true
    },
    "Instances" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Instance"
      },
      "minItems" : 1,
      "insertionOrder" : true
    },
    "SapInstanceNumber" : {
      "type" : "string",
      "pattern" : "[0-9]{2}"
    },
    "Sid" : {
      "type" : "string",
      "pattern" : "[A-Z][A-Z0-9]{2}"
    },
    "Tags" : {
      "description" : "The tags of a SystemsManagerSAP application.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "insertionOrder" : true
    }
  },
  "required" : [ "ApplicationId", "ApplicationType" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "readOnlyProperties" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/Credentials", "/properties/Instances", "/properties/SapInstanceNumber", "/properties/Sid" ],
  "writeOnlyProperties" : [ "/properties/Credentials", "/properties/Instances", "/properties/SapInstanceNumber", "/properties/Sid" ],
  "additionalProperties" : false,
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "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 -. ",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "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 -. ",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "Credential" : {
      "type" : "object",
      "properties" : {
        "DatabaseName" : {
          "type" : "string",
          "pattern" : "^(?=.{1,100}$).*"
        },
        "CredentialType" : {
          "type" : "string",
          "enum" : [ "ADMIN" ]
        },
        "SecretId" : {
          "type" : "string",
          "pattern" : "^(?=.{1,100}$).*"
        }
      },
      "additionalProperties" : false
    },
    "Instance" : {
      "type" : "string",
      "pattern" : "^i-[\\w\\d]{8}$|^i-[\\w\\d]{17}$"
    }
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "ssm-sap:RegisterApplication", "ssm-sap:GetApplication", "ssm-sap:TagResource", "ssm-sap:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "ssm-sap:GetApplication", "ssm-sap:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "ssm-sap:TagResource", "ssm-sap:UntagResource", "ssm-sap:ListTagsForResource", "ssm-sap:GetApplication" ]
    },
    "delete" : {
      "permissions" : [ "ssm-sap:DeregisterApplication", "ssm-sap:GetApplication" ]
    },
    "list" : {
      "permissions" : [ "ssm-sap:ListApplications" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  }
}