{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iam-access-analyzer/json-schema/amazon-iam-access-analyzer-create-service-linked-analyzer-request-schema.json",
  "title": "CreateServiceLinkedAnalyzerRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iam-access-analyzer-operations-api-openapi.yml#/components/schemas/CreateServiceLinkedAnalyzerRequest",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "The type of analyzer to create. Valid values are ACCOUNT_UNUSED_ACCESS and ORGANIZATION_UNUSED_ACCESS."
    },
    "archiveRules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InlineArchiveRule"
      },
      "description": "Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule."
    },
    "clientToken": {
      "type": "string",
      "description": "A client token."
    },
    "configuration": {
      "$ref": "#/$defs/AnalyzerConfiguration"
    }
  },
  "required": [
    "type"
  ],
  "$defs": {
    "AnalysisRule": {
      "type": "object",
      "properties": {
        "exclusions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AnalysisRuleCriteria"
          },
          "description": "A list of rules for the analyzer containing criteria to exclude from analysis. Entities that meet the rule criteria will not generate findings."
        }
      }
    },
    "AnalysisRuleCriteria": {
      "type": "object",
      "properties": {
        "accountIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of Amazon Web Services account IDs to apply to the analysis rule criteria. The accounts cannot include the organization analyzer owner account. Account IDs can only be applied to the analysis rule criteria for organization-level analyzers. The list cannot include more than 2,000 account IDs."
        },
        "resourceTags": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "description": "An array of key-value pairs to match for your resources. You can use the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. For the tag key, you can specify a value that is 1 to 128 characters in length and cannot be prefixed with aws:. For the tag value, you can specify a value that is 0 to 256 characters in length. If the specified tag value is 0 characters, the rule is applied to all principals with the specified tag key."
        }
      }
    },
    "AnalyzerConfiguration": {
      "type": "object",
      "properties": {
        "unusedAccess": {
          "$ref": "#/$defs/UnusedAccessConfiguration"
        },
        "internalAccess": {
          "$ref": "#/$defs/InternalAccessConfiguration"
        }
      },
      "description": "Exactly one member is set."
    },
    "Criterion": {
      "type": "object",
      "properties": {
        "eq": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An \"equals\" operator to match for the filter used to create the rule."
        },
        "neq": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A \"not equals\" operator to match for the filter used to create the rule."
        },
        "contains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A \"contains\" operator to match for the filter used to create the rule."
        },
        "exists": {
          "type": "boolean",
          "description": "An \"exists\" operator to match for the filter used to create the rule."
        }
      }
    },
    "InlineArchiveRule": {
      "type": "object",
      "properties": {
        "ruleName": {
          "type": "string",
          "description": "The name of the rule."
        },
        "filter": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Criterion"
          },
          "description": "The condition and values for a criterion."
        }
      },
      "required": [
        "ruleName",
        "filter"
      ]
    },
    "InternalAccessAnalysisRule": {
      "type": "object",
      "properties": {
        "inclusions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InternalAccessAnalysisRuleCriteria"
          },
          "description": "A list of rules for the internal access analyzer containing criteria to include in analysis. Only resources that meet the rule criteria will generate findings."
        }
      }
    },
    "InternalAccessAnalysisRuleCriteria": {
      "type": "object",
      "properties": {
        "accountIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of Amazon Web Services account IDs to apply to the internal access analysis rule criteria. Account IDs can only be applied to the analysis rule criteria for organization-level analyzers."
        },
        "resourceTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of resource types to apply to the internal access analysis rule criteria. The analyzer will only generate findings for resources of these types. These resource types are currently supported for internal access analyzers: AWS::S3::Bucket AWS::RDS::DBSnapshot AWS::RDS::DBClusterSnapshot AWS::S3Express::DirectoryBucket AWS::DynamoDB::Table AWS::DynamoDB::Stream"
        },
        "resourceArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of resource ARNs to apply to the internal access analysis rule criteria. The analyzer will only generate findings for resources that match these ARNs."
        }
      }
    },
    "InternalAccessConfiguration": {
      "type": "object",
      "properties": {
        "analysisRule": {
          "$ref": "#/$defs/InternalAccessAnalysisRule"
        }
      }
    },
    "UnusedAccessConfiguration": {
      "type": "object",
      "properties": {
        "unusedAccessAge": {
          "type": "integer",
          "description": "The specified access age in days for which to generate findings for unused access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value between 1 and 365 days."
        },
        "analysisRule": {
          "$ref": "#/$defs/AnalysisRule"
        }
      }
    }
  }
}