{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-managed-prometheus/json-schema/amazon-managed-prometheus-create-scraper-request-schema.json",
  "title": "CreateScraperRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-managed-prometheus-scrapers-api-openapi.yml#/components/schemas/CreateScraperRequest",
  "type": "object",
  "properties": {
    "alias": {
      "type": "string",
      "description": "(optional) An alias to associate with the scraper. This is for your use, and does not need to be unique."
    },
    "scrapeConfiguration": {
      "$ref": "#/$defs/ScrapeConfiguration"
    },
    "source": {
      "$ref": "#/$defs/Source"
    },
    "destination": {
      "$ref": "#/$defs/Destination"
    },
    "roleConfiguration": {
      "$ref": "#/$defs/RoleConfiguration"
    },
    "clientToken": {
      "type": "string",
      "description": "(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "(Optional) The list of tag keys and values to associate with the scraper."
    },
    "exporters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExporterConfiguration"
      },
      "description": "The exporter configurations for the scraper. You can configure at most one Amazon OpenSearch Service domain. If you don't specify a value, the scraper is created without an exporter configuration."
    }
  },
  "required": [
    "scrapeConfiguration",
    "source",
    "destination"
  ],
  "$defs": {
    "AmpConfiguration": {
      "type": "object",
      "properties": {
        "workspaceArn": {
          "type": "string",
          "description": "ARN of the Amazon Managed Service for Prometheus workspace."
        }
      },
      "required": [
        "workspaceArn"
      ]
    },
    "CloudWatchConfiguration": {
      "type": "object",
      "properties": {
        "datasetArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the CloudWatch dataset. To use the default dataset, specify arn:aws:cloudwatch:&lt;region&gt;:&lt;account-id&gt;:dataset/default."
        }
      },
      "required": [
        "datasetArn"
      ]
    },
    "Destination": {
      "type": "object",
      "properties": {
        "ampConfiguration": {
          "$ref": "#/$defs/AmpConfiguration"
        },
        "cloudWatchConfiguration": {
          "$ref": "#/$defs/CloudWatchConfiguration"
        }
      },
      "description": "Exactly one member is set."
    },
    "EksConfiguration": {
      "type": "object",
      "properties": {
        "clusterArn": {
          "type": "string",
          "description": "ARN of the Amazon EKS cluster."
        },
        "securityGroupIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of the security group IDs for the Amazon EKS cluster VPC configuration."
        },
        "subnetIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of subnet IDs for the Amazon EKS cluster VPC configuration."
        }
      },
      "required": [
        "clusterArn",
        "subnetIds"
      ]
    },
    "ExporterConfiguration": {
      "type": "object",
      "properties": {
        "openSearchConfiguration": {
          "$ref": "#/$defs/OpenSearchExporterConfiguration"
        }
      },
      "description": "Exactly one member is set."
    },
    "OpenSearchExporterConfiguration": {
      "type": "object",
      "properties": {
        "domainArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Amazon OpenSearch Service domain."
        }
      },
      "required": [
        "domainArn"
      ]
    },
    "RoleConfiguration": {
      "type": "object",
      "properties": {
        "sourceRoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the role used in the source account to enable cross-account scraping. For information about the contents of this policy, see Cross-account setup."
        },
        "targetRoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the role used in the target account to enable cross-account scraping. For information about the contents of this policy, see Cross-account setup."
        }
      }
    },
    "ScrapeConfiguration": {
      "type": "object",
      "properties": {
        "configurationBlob": {
          "type": "string",
          "description": "The base 64 encoded scrape configuration file."
        }
      },
      "description": "Exactly one member is set."
    },
    "Source": {
      "type": "object",
      "properties": {
        "eksConfiguration": {
          "$ref": "#/$defs/EksConfiguration"
        },
        "vpcConfiguration": {
          "$ref": "#/$defs/VpcConfiguration"
        }
      },
      "description": "Exactly one member is set."
    },
    "VpcConfiguration": {
      "type": "object",
      "properties": {
        "securityGroupIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The security group IDs that control network access for the Prometheus collector. These security groups must allow the collector to communicate with your Amazon MSK cluster on the required ports."
        },
        "subnetIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The subnet IDs where the Prometheus collector will be deployed. The subnets must be in the same Amazon VPC as your Amazon MSK cluster and have network connectivity to the cluster."
        }
      },
      "required": [
        "securityGroupIds",
        "subnetIds"
      ]
    }
  }
}