{
  "typeName" : "AWS::OpenSearchService::Application",
  "description" : "Amazon OpenSearchService application resource",
  "definitions" : {
    "AppConfigType" : {
      "type" : "string",
      "enum" : [ "opensearchDashboards.dashboardAdmin.users", "opensearchDashboards.dashboardAdmin.groups" ],
      "description" : "AppConfig type values."
    },
    "Tag" : {
      "type" : "object",
      "description" : "A key-value pair metadata associated with resource",
      "properties" : {
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 1,
          "description" : "The key in the key-value pair"
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0,
          "description" : "The value in the key-value pair"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "AppConfig" : {
      "type" : "object",
      "description" : "A key-value pair of AppConfig",
      "properties" : {
        "Key" : {
          "$ref" : "#/definitions/AppConfigType",
          "description" : "The configuration key"
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0,
          "description" : "The configuration value."
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "DataSource" : {
      "type" : "object",
      "description" : "Datasource arn and description",
      "properties" : {
        "DataSourceArn" : {
          "$ref" : "#/properties/Arn",
          "description" : "The ARN of the data source."
        },
        "DataSourceDescription" : {
          "type" : "string",
          "description" : "Description of the data source."
        }
      },
      "required" : [ "DataSourceArn" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "IamIdentityCenterOptions" : {
      "type" : "object",
      "description" : "Options for configuring IAM Identity Center",
      "properties" : {
        "Enabled" : {
          "type" : "boolean",
          "description" : "Whether IAM Identity Center is enabled."
        },
        "IamIdentityCenterInstanceArn" : {
          "$ref" : "#/properties/Arn",
          "description" : "The ARN of the IAM Identity Center instance."
        },
        "IamRoleForIdentityCenterApplicationArn" : {
          "type" : "string",
          "description" : "The ARN of the IAM role for Identity Center application."
        }
      },
      "additionalProperties" : false
    },
    "Arn" : {
      "type" : "string",
      "description" : "Amazon Resource Name (ARN) format."
    },
    "Id" : {
      "type" : "string",
      "maxLength" : 40,
      "minLength" : 3,
      "description" : "The identifier of the application."
    },
    "Name" : {
      "type" : "string",
      "pattern" : "[a-z][a-z0-9\\-]+",
      "minLength" : 3,
      "maxLength" : 40,
      "description" : "The name of the application."
    },
    "Endpoint" : {
      "type" : "string",
      "description" : "The endpoint for the application."
    },
    "AppConfigs" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/AppConfig"
      },
      "description" : "List of application configurations.",
      "insertionOrder" : false
    },
    "KmsKeyArn" : {
      "type" : "string",
      "minLength" : 20,
      "maxLength" : 2048,
      "pattern" : "^arn:aws(-[a-z]+)*:kms:[a-z0-9-]+:\\d{12}:key/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
      "description" : "The ARN of the KMS key used to encrypt the application."
    },
    "DataSources" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/DataSource"
      },
      "description" : "List of data sources.",
      "insertionOrder" : false
    },
    "Tags" : {
      "description" : "An arbitrary set of tags (key-value pairs) for this application.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "type" : "array",
      "uniqueItems" : true
    }
  },
  "required" : [ "Name" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/KmsKeyArn" ],
  "writeOnlyProperties" : [ "/properties/KmsKeyArn" ],
  "primaryIdentifier" : [ "/properties/Name" ],
  "additionalIdentifiers" : [ [ "/properties/Arn" ] ],
  "handlers" : {
    "create" : {
      "permissions" : [ "es:CreateApplication", "es:GetApplication", "es:AddTags", "es:ListTags", "iam:CreateServiceLinkedRole" ]
    },
    "read" : {
      "permissions" : [ "es:GetApplication", "es:ListTags" ]
    },
    "update" : {
      "permissions" : [ "es:UpdateApplication", "es:GetApplication", "es:AddTags", "es:RemoveTags", "es:ListTags" ]
    },
    "delete" : {
      "permissions" : [ "es:GetApplication", "es:DeleteApplication" ]
    },
    "list" : {
      "permissions" : [ "es:ListApplications" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "es:AddTags", "es:RemoveTags", "es:ListTags" ]
  },
  "additionalProperties" : false
}