{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-s3-storagelens.json",
  "title": "AWSS3StorageLensProperties",
  "description": "The AWS::S3::StorageLens resource is an Amazon S3 resource type that you can use to create Storage Lens configurations.. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-s3-storagelens>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-s3-storagelens.json",
    "sourceSha256": "c87f38fe17d1a8e0db7a109ce8884508c6fd527879c57694ab7b17763e40cc5f"
  },
  "type": "object",
  "properties": {
    "StorageLensConfiguration": {
      "$ref": "#/$defs/StorageLensConfiguration"
    },
    "Tags": {
      "description": "A set of tags (key-value pairs) for this Amazon S3 Storage Lens configuration.",
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "maxItems": 50
    }
  },
  "typeName": "AWS::S3::StorageLens",
  "primaryIdentifier": [
    "/properties/StorageLensConfiguration/Id"
  ],
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-s3-storagelens",
  "additionalProperties": false,
  "createOnlyProperties": [
    "/properties/StorageLensConfiguration/Id"
  ],
  "$defs": {
    "Id": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[a-zA-Z0-9\\-_.]+$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The ID that identifies the Amazon S3 Storage Lens configuration.",
      "title": "AWSS3StorageLensIdDefinition"
    },
    "Arn": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The Amazon Resource Name (ARN) of the specified resource.",
      "title": "AWSS3StorageLensArnDefinition"
    },
    "BucketsAndRegions": {
      "description": "S3 buckets and Regions to include/exclude in the Amazon S3 Storage Lens configuration.",
      "type": "object",
      "title": "AWSS3StorageLensBucketsAndRegionsDefinition",
      "properties": {
        "Buckets": {
          "type": "array",
          "insertionOrder": false,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/Arn"
          }
        },
        "Regions": {
          "type": "array",
          "insertionOrder": false,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "description": "An AWS Region."
          }
        }
      },
      "additionalProperties": false
    },
    "AwsOrg": {
      "description": "The AWS Organizations ARN to use in the Amazon S3 Storage Lens configuration.",
      "type": "object",
      "title": "AWSS3StorageLensAwsOrgDefinition",
      "properties": {
        "Arn": {
          "$ref": "#/$defs/Arn"
        }
      },
      "required": [
        "Arn"
      ],
      "additionalProperties": false
    },
    "ActivityMetrics": {
      "description": "Enables activity metrics.",
      "type": "object",
      "title": "AWSS3StorageLensActivityMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether activity metrics are enabled or disabled.",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "AdvancedCostOptimizationMetrics": {
      "description": "Enables advanced cost optimization metrics.",
      "type": "object",
      "title": "AWSS3StorageLensAdvancedCostOptimizationMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether advanced cost optimization metrics are enabled or disabled.",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "AdvancedDataProtectionMetrics": {
      "description": "Enables advanced data protection metrics.",
      "type": "object",
      "title": "AWSS3StorageLensAdvancedDataProtectionMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether advanced data protection metrics are enabled or disabled.",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "DetailedStatusCodesMetrics": {
      "description": "Enables detailed status codes metrics.",
      "type": "object",
      "title": "AWSS3StorageLensDetailedStatusCodesMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether detailed status codes metrics are enabled or disabled.",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SelectionCriteria": {
      "description": "Selection criteria for prefix-level metrics.",
      "type": "object",
      "title": "AWSS3StorageLensSelectionCriteriaDefinition",
      "properties": {
        "MaxDepth": {
          "description": "Max depth of prefixes of S3 key that Amazon S3 Storage Lens will analyze.",
          "type": "integer"
        },
        "Delimiter": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Delimiter to divide S3 key into hierarchy of prefixes."
        },
        "MinStorageBytesPercentage": {
          "description": "The minimum storage bytes threshold for the prefixes to be included in the analysis.",
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "PrefixLevelStorageMetrics": {
      "type": "object",
      "title": "AWSS3StorageLensPrefixLevelStorageMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether prefix-level storage metrics are enabled or disabled.",
          "type": "boolean"
        },
        "SelectionCriteria": {
          "$ref": "#/$defs/SelectionCriteria"
        }
      },
      "additionalProperties": false
    },
    "PrefixLevel": {
      "description": "Prefix-level metrics configurations.",
      "type": "object",
      "title": "AWSS3StorageLensPrefixLevelDefinition",
      "properties": {
        "StorageMetrics": {
          "$ref": "#/$defs/PrefixLevelStorageMetrics"
        }
      },
      "required": [
        "StorageMetrics"
      ],
      "additionalProperties": false
    },
    "BucketLevel": {
      "description": "Bucket-level metrics configurations.",
      "type": "object",
      "title": "AWSS3StorageLensBucketLevelDefinition",
      "properties": {
        "ActivityMetrics": {
          "$ref": "#/$defs/ActivityMetrics"
        },
        "AdvancedCostOptimizationMetrics": {
          "$ref": "#/$defs/AdvancedCostOptimizationMetrics"
        },
        "AdvancedDataProtectionMetrics": {
          "$ref": "#/$defs/AdvancedDataProtectionMetrics"
        },
        "DetailedStatusCodesMetrics": {
          "$ref": "#/$defs/DetailedStatusCodesMetrics"
        },
        "PrefixLevel": {
          "$ref": "#/$defs/PrefixLevel"
        }
      },
      "additionalProperties": false
    },
    "AccountLevel": {
      "description": "Account-level metrics configurations.",
      "type": "object",
      "title": "AWSS3StorageLensAccountLevelDefinition",
      "properties": {
        "ActivityMetrics": {
          "$ref": "#/$defs/ActivityMetrics"
        },
        "AdvancedCostOptimizationMetrics": {
          "$ref": "#/$defs/AdvancedCostOptimizationMetrics"
        },
        "AdvancedDataProtectionMetrics": {
          "$ref": "#/$defs/AdvancedDataProtectionMetrics"
        },
        "DetailedStatusCodesMetrics": {
          "$ref": "#/$defs/DetailedStatusCodesMetrics"
        },
        "BucketLevel": {
          "$ref": "#/$defs/BucketLevel"
        }
      },
      "required": [
        "BucketLevel"
      ],
      "additionalProperties": false
    },
    "SSEKMS": {
      "description": "AWS KMS server-side encryption.",
      "type": "object",
      "title": "AWSS3StorageLensSSEKMSDefinition",
      "properties": {
        "KeyId": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The ARN of the KMS key to use for encryption."
        }
      },
      "required": [
        "KeyId"
      ],
      "additionalProperties": false
    },
    "Encryption": {
      "description": "Configures the server-side encryption for Amazon S3 Storage Lens report files with either S3-managed keys (SSE-S3) or KMS-managed keys (SSE-KMS).",
      "type": "object",
      "oneOf": [
        {
          "required": [
            "SSES3"
          ],
          "properties": {
            "SSES3": {
              "description": "S3 default server-side encryption.",
              "type": "object",
              "additionalProperties": false
            }
          },
          "additionalProperties": false,
          "type": "object"
        },
        {
          "required": [
            "SSEKMS"
          ],
          "properties": {
            "SSEKMS": {
              "$ref": "#/$defs/SSEKMS"
            }
          },
          "additionalProperties": false,
          "type": "object"
        }
      ],
      "title": "AWSS3StorageLensEncryptionDefinition"
    },
    "S3BucketDestination": {
      "description": "S3 bucket destination settings for the Amazon S3 Storage Lens metrics export.",
      "type": "object",
      "title": "AWSS3StorageLensS3BucketDestinationDefinition",
      "properties": {
        "OutputSchemaVersion": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "V_1"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The version of the output schema to use when exporting Amazon S3 Storage Lens metrics."
        },
        "Format": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "CSV",
                "Parquet"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Specifies the file format to use when exporting Amazon S3 Storage Lens metrics export."
        },
        "AccountId": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The AWS account ID that owns the destination S3 bucket."
        },
        "Arn": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The ARN of the bucket to which Amazon S3 Storage Lens exports will be placed."
        },
        "Prefix": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The prefix to use for Amazon S3 Storage Lens export."
        },
        "Encryption": {
          "$ref": "#/$defs/Encryption"
        }
      },
      "required": [
        "OutputSchemaVersion",
        "Format",
        "AccountId",
        "Arn"
      ],
      "additionalProperties": false
    },
    "CloudWatchMetrics": {
      "description": "CloudWatch metrics settings for the Amazon S3 Storage Lens metrics export.",
      "type": "object",
      "title": "AWSS3StorageLensCloudWatchMetricsDefinition",
      "properties": {
        "IsEnabled": {
          "description": "Specifies whether CloudWatch metrics are enabled or disabled.",
          "type": "boolean"
        }
      },
      "required": [
        "IsEnabled"
      ],
      "additionalProperties": false
    },
    "DataExport": {
      "description": "Specifies how Amazon S3 Storage Lens metrics should be exported.",
      "type": "object",
      "title": "AWSS3StorageLensDataExportDefinition",
      "properties": {
        "S3BucketDestination": {
          "$ref": "#/$defs/S3BucketDestination"
        },
        "CloudWatchMetrics": {
          "$ref": "#/$defs/CloudWatchMetrics"
        }
      },
      "additionalProperties": false
    },
    "Tag": {
      "type": "object",
      "title": "AWSS3StorageLensTagDefinition",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 127,
              "pattern": "^(?!aws:.*)[a-zA-Z0-9\\s\\_\\.\\/\\=\\+\\-]+$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^(?!aws:.*)[a-zA-Z0-9\\s\\_\\.\\/\\=\\+\\-]+$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "required": [
        "Key",
        "Value"
      ],
      "additionalProperties": false
    },
    "StorageLensConfiguration": {
      "description": "Specifies the details of Amazon S3 Storage Lens configuration.",
      "type": "object",
      "title": "AWSS3StorageLensStorageLensConfigurationDefinition",
      "properties": {
        "Id": {
          "$ref": "#/$defs/Id"
        },
        "Include": {
          "$ref": "#/$defs/BucketsAndRegions"
        },
        "Exclude": {
          "$ref": "#/$defs/BucketsAndRegions"
        },
        "AwsOrg": {
          "$ref": "#/$defs/AwsOrg"
        },
        "AccountLevel": {
          "$ref": "#/$defs/AccountLevel"
        },
        "DataExport": {
          "$ref": "#/$defs/DataExport"
        },
        "IsEnabled": {
          "description": "Specifies whether the Amazon S3 Storage Lens configuration is enabled or disabled.",
          "type": "boolean"
        },
        "StorageLensArn": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The ARN for the Amazon S3 Storage Lens configuration."
        }
      },
      "required": [
        "Id",
        "AccountLevel",
        "IsEnabled"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "StorageLensConfiguration"
  ],
  "readOnlyProperties": [
    "/properties/StorageLensConfiguration/StorageLensArn"
  ]
}
