{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-resilience-hub/json-schema/amazon-resilience-hub-create-app-request-schema.json",
  "title": "CreateAppRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-resilience-hub-applications-api-openapi.yml#/components/schemas/CreateAppRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the application."
    },
    "description": {
      "type": "string",
      "description": "The optional description for an app."
    },
    "policyArn": {
      "type": "string",
      "description": "Amazon Resource Name (ARN) of the resiliency policy. The format for this ARN is: arn:partition:resiliencehub:region:account:resiliency-policy/policy-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key/value pair."
    },
    "clientToken": {
      "type": "string",
      "description": "Used for an idempotency token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. You should not reuse the same client token for other API requests."
    },
    "assessmentSchedule": {
      "type": "string",
      "enum": [
        "Disabled",
        "Daily"
      ],
      "description": "Assessment execution schedule with 'Daily' or 'Disabled' values."
    },
    "permissionModel": {
      "$ref": "#/$defs/PermissionModel"
    },
    "eventSubscriptions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EventSubscription"
      },
      "description": "The list of events you would like to subscribe and get notification for. Currently, Resilience Hub supports only Drift detected and Scheduled assessment failure events notification."
    },
    "awsApplicationArn": {
      "type": "string",
      "description": "Amazon Resource Name (ARN) of Resource Groups group that is integrated with an AppRegistry application. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide."
    }
  },
  "required": [
    "name"
  ],
  "$defs": {
    "EventSubscription": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique name to identify an event subscription."
        },
        "eventType": {
          "type": "string",
          "enum": [
            "ScheduledAssessmentFailure",
            "DriftDetected"
          ],
          "description": "The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports notifications only for Drift detected (DriftDetected) and Scheduled assessment failure (ScheduledAssessmentFailure) events."
        },
        "snsTopicArn": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is: arn:partition:sns:region:account:topic-name. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide."
        }
      },
      "required": [
        "name",
        "eventType"
      ]
    },
    "PermissionModel": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LegacyIAMUser",
            "RoleBased"
          ],
          "description": "Defines how Resilience Hub scans your resources. It can scan for the resources by using a pre-existing role in your Amazon Web Services account, or by using the credentials of the current IAM user."
        },
        "invokerRoleName": {
          "type": "string",
          "description": "Existing Amazon Web Services IAM role name in the primary Amazon Web Services account that will be assumed by Resilience Hub Service Principle to obtain a read-only access to your application resources while running an assessment. If your IAM role includes a path, you must include the path in the invokerRoleName parameter. For example, if your IAM role's ARN is arn:aws:iam:123456789012:role/my-path/role-name, you should pass my-path/role-name. You must have iam:passRole permission for this role while creating or updating the application. Currently, invokerRoleName accepts only [A-Za-z0-9_+=,.@"
        },
        "crossAccountRoleArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Defines a list of role Amazon Resource Names (ARNs) to be used in other accounts. These ARNs are used for querying purposes while importing resources and assessing your application. These ARNs are required only when your resources are in other accounts and you have different role name in these accounts. Else, the invoker role name will be used in the other accounts. These roles must have a trust policy with iam:AssumeRole permission to the invoker role in the primary account."
        }
      },
      "required": [
        "type"
      ]
    }
  }
}