{
 "additionalProperties": false,
 "definitions": {
  "AdvancedEventSelector": {
   "additionalProperties": false,
   "properties": {
    "FieldSelectors": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/AdvancedFieldSelector"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "Name": {
     "maxLength": 1000,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "FieldSelectors"
   ],
   "type": "object"
  },
  "AdvancedFieldSelector": {
   "additionalProperties": false,
   "properties": {
    "EndsWith": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "Equals": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "Field": {
     "maxLength": 1000,
     "minLength": 1,
     "pattern": "([\\w|\\d|\\.|_]+)",
     "type": "string"
    },
    "NotEndsWith": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "NotEquals": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "NotStartsWith": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "StartsWith": {
     "insertionOrder": false,
     "items": {
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "Field"
   ],
   "type": "object"
  },
  "ContextKeySelector": {
   "additionalProperties": false,
   "properties": {
    "Equals": {
     "insertionOrder": false,
     "items": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "(.+)",
      "type": "string"
     },
     "maxItems": 50,
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    },
    "Type": {
     "enum": [
      "RequestContext",
      "TagContext"
     ],
     "type": "string"
    }
   },
   "required": [
    "Type",
    "Equals"
   ],
   "type": "object"
  },
  "InsightSelector": {
   "additionalProperties": false,
   "properties": {
    "InsightType": {
     "enum": [
      "ApiCallRateInsight",
      "ApiErrorRateInsight"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Value",
    "Key"
   ],
   "type": "object"
  },
  "Timestamp": {
   "type": "string"
  }
 },
 "primaryIdentifier": [
  "/properties/EventDataStoreArn"
 ],
 "properties": {
  "AdvancedEventSelectors": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/AdvancedEventSelector"
   },
   "type": "array",
   "uniqueItems": true
  },
  "BillingMode": {
   "enum": [
    "EXTENDABLE_RETENTION_PRICING",
    "FIXED_RETENTION_PRICING"
   ],
   "type": "string"
  },
  "ContextKeySelectors": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/ContextKeySelector"
   },
   "maxItems": 2,
   "minItems": 0,
   "type": "array",
   "uniqueItems": true
  },
  "CreatedTimestamp": {
   "$ref": "#/definitions/Timestamp"
  },
  "EventDataStoreArn": {
   "type": "string"
  },
  "FederationEnabled": {
   "type": "boolean"
  },
  "FederationRoleArn": {
   "format": "AWS::IAM::Role.Arn",
   "type": "string"
  },
  "IngestionEnabled": {
   "type": "boolean"
  },
  "InsightSelectors": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/InsightSelector"
   },
   "type": "array",
   "uniqueItems": true
  },
  "InsightsDestination": {
   "maxLength": 256,
   "minLength": 3,
   "pattern": "^[a-zA-Z0-9._/\\-:]+$",
   "type": "string"
  },
  "KmsKeyId": {
   "anyOf": [
    {
     "format": "AWS::KMS::Key.Arn"
    },
    {
     "format": "AWS::KMS::Key.Id"
    },
    {
     "format": "AWS::KMS::Alias.AliasName"
    }
   ],
   "maxLength": 350,
   "minLength": 1,
   "pattern": "^[a-zA-Z0-9._/\\-:]+$",
   "type": "string"
  },
  "MaxEventSize": {
   "enum": [
    "Standard",
    "Large"
   ],
   "type": "string"
  },
  "MultiRegionEnabled": {
   "type": "boolean"
  },
  "Name": {
   "maxLength": 128,
   "minLength": 3,
   "pattern": "^[a-zA-Z0-9._\\-]+$",
   "type": "string"
  },
  "OrganizationEnabled": {
   "type": "boolean"
  },
  "RetentionPeriod": {
   "maximum": 3653,
   "minimum": 7,
   "type": "integer"
  },
  "Status": {
   "type": "string"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array",
   "uniqueItems": false
  },
  "TerminationProtectionEnabled": {
   "type": "boolean"
  },
  "UpdatedTimestamp": {
   "$ref": "#/definitions/Timestamp"
  }
 },
 "propertyTransform": {
  "/properties/KmsKeyId": "$join([\"arn:(aws)[-]{0,1}[a-z]{0,2}[-]{0,1}[a-z]{0,3}:kms:[a-z]{2}[-]{1}[a-z]{3,10}[-]{0,1}[a-z]{0,10}[-]{1}[1-3]{1}:[0-9]{12}[:]{1}key\\/\", KmsKeyId])"
 },
 "readOnlyProperties": [
  "/properties/EventDataStoreArn",
  "/properties/CreatedTimestamp",
  "/properties/UpdatedTimestamp",
  "/properties/Status"
 ],
 "required": [],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cloudtrail.git",
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::CloudTrail::EventDataStore"
}
