{
  "typeName" : "AWS::AccessAnalyzer::Analyzer",
  "description" : "The AWS::AccessAnalyzer::Analyzer type specifies an analyzer of the user's account",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-accessanalyzer.git",
  "resourceLink" : {
    "templateUri" : "/access-analyzer/home?region=${awsRegion}#/analyzer/${AnalyzerName}",
    "mappings" : {
      "AnalyzerName" : "/AnalyzerName"
    }
  },
  "definitions" : {
    "ArchiveRule" : {
      "description" : "An Access Analyzer archive rule. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.",
      "type" : "object",
      "properties" : {
        "Filter" : {
          "type" : "array",
          "insertionOrder" : false,
          "minItems" : 1,
          "items" : {
            "$ref" : "#/definitions/Filter"
          }
        },
        "RuleName" : {
          "type" : "string",
          "description" : "The archive rule name"
        }
      },
      "required" : [ "Filter", "RuleName" ],
      "additionalProperties" : false
    },
    "Filter" : {
      "type" : "object",
      "properties" : {
        "Contains" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "Eq" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "Exists" : {
          "type" : "boolean"
        },
        "Property" : {
          "type" : "string"
        },
        "Neq" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        }
      },
      "required" : [ "Property" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "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 -. ",
          "minLength" : 1,
          "maxLength" : 127
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 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 -. ",
          "minLength" : 0,
          "maxLength" : 255
        }
      },
      "required" : [ "Key" ],
      "additionalProperties" : false
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "description" : "An array of key-value pairs to apply to this resource.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "AnalysisRuleCriteria" : {
      "description" : "The criteria for an analysis rule for an analyzer.",
      "type" : "object",
      "properties" : {
        "AccountIds" : {
          "description" : "A list of AWS 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.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "ResourceTags" : {
          "description" : "An array of key-value pairs to match for your resources. You can use the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.\n\nFor the tag key, you can specify a value that is 1 to 128 characters in length and cannot be prefixed with aws:.\n\nFor 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.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Tags"
          }
        }
      },
      "additionalProperties" : false
    },
    "InternalAccessAnalysisRuleCriteria" : {
      "description" : "The criteria for an analysis rule for an internal access analyzer.",
      "type" : "object",
      "properties" : {
        "AccountIds" : {
          "description" : "A list of AWS 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 and cannot include the organization owner account.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "ResourceArns" : {
          "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.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "ResourceTypes" : {
          "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.",
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        }
      },
      "additionalProperties" : false
    },
    "InternalAccessConfiguration" : {
      "description" : "Specifies the configuration of an internal access analyzer for an AWS organization or account. This configuration determines how the analyzer evaluates internal access within your AWS environment.",
      "type" : "object",
      "properties" : {
        "InternalAccessAnalysisRule" : {
          "description" : "Contains information about analysis rules for the internal access analyzer. Analysis rules determine which entities will generate findings based on the criteria you define when you create the rule.",
          "type" : "object",
          "properties" : {
            "Inclusions" : {
              "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.",
              "type" : "array",
              "insertionOrder" : false,
              "items" : {
                "$ref" : "#/definitions/InternalAccessAnalysisRuleCriteria"
              }
            }
          },
          "additionalProperties" : false
        }
      },
      "additionalProperties" : false
    },
    "UnusedAccessConfiguration" : {
      "description" : "The Configuration for Unused Access Analyzer",
      "type" : "object",
      "properties" : {
        "UnusedAccessAge" : {
          "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.",
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 365
        },
        "AnalysisRule" : {
          "description" : "Contains information about rules for the analyzer.",
          "type" : "object",
          "properties" : {
            "Exclusions" : {
              "description" : "A list of rules for the analyzer containing criteria to exclude from analysis. Entities that meet the rule criteria will not generate findings.",
              "type" : "array",
              "insertionOrder" : false,
              "items" : {
                "$ref" : "#/definitions/AnalysisRuleCriteria"
              }
            }
          },
          "additionalProperties" : false
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AnalyzerName" : {
      "description" : "Analyzer name",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024
    },
    "ArchiveRules" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/ArchiveRule"
      }
    },
    "Arn" : {
      "description" : "Amazon Resource Name (ARN) of the analyzer",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1600
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 50,
      "insertionOrder" : false,
      "uniqueItems" : true,
      "description" : "An array of key-value pairs to apply to this resource.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Type" : {
      "description" : "The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_INTERNAL_ACCESS, ORGANIZATION_INTERNAL_ACCESS, ACCOUNT_UNUSED_ACCESS and ORGANIZATION_UNUSED_ACCESS",
      "type" : "string",
      "minLength" : 0,
      "maxLength" : 1024
    },
    "AnalyzerConfiguration" : {
      "description" : "The configuration for the analyzer",
      "type" : "object",
      "properties" : {
        "UnusedAccessConfiguration" : {
          "$ref" : "#/definitions/UnusedAccessConfiguration"
        },
        "InternalAccessConfiguration" : {
          "$ref" : "#/definitions/InternalAccessConfiguration"
        }
      },
      "additionalProperties" : false
    }
  },
  "required" : [ "Type" ],
  "readOnlyProperties" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/AnalyzerName", "/properties/Type" ],
  "conditionalCreateOnlyProperties" : [ "/properties/AnalyzerConfiguration" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalProperties" : false,
  "handlers" : {
    "create" : {
      "permissions" : [ "access-analyzer:CreateAnalyzer", "access-analyzer:TagResource", "iam:CreateServiceLinkedRole", "organizations:ListAWSServiceAccessForOrganization", "organizations:ListDelegatedAdministrators" ]
    },
    "read" : {
      "permissions" : [ "access-analyzer:ListAnalyzers", "access-analyzer:GetAnalyzer", "access-analyzer:ListArchiveRules" ]
    },
    "update" : {
      "permissions" : [ "access-analyzer:CreateArchiveRule", "access-analyzer:DeleteArchiveRule", "access-analyzer:ListAnalyzers", "access-analyzer:TagResource", "access-analyzer:UntagResource", "access-analyzer:UpdateAnalyzer", "access-analyzer:UpdateArchiveRule" ]
    },
    "delete" : {
      "permissions" : [ "access-analyzer:DeleteAnalyzer" ]
    },
    "list" : {
      "permissions" : [ "access-analyzer:ListAnalyzers" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "access-analyzer:UntagResource", "access-analyzer:TagResource", "access-analyzer:ListTagsForResource" ]
  }
}