{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instaclustr/json-schema/instaclustr-byoc-aws-provider-account-setup-v1-schema.json",
  "title": "ByocAwsProviderAccountSetupV1",
  "description": "A resource representing a BYOC provider account setup record.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instaclustr-byoc-aws-provider-account-setup-v1-api-openapi.yml#/components/schemas/ByocAwsProviderAccountSetupV1",
  "required": [
    "cloudProviderAccountId",
    "dataCentreBackupBuckets",
    "providerAccountName"
  ],
  "type": "object",
  "properties": {
    "accountId": {
      "type": "string",
      "description": "UUID of the Instaclustr Account.",
      "format": "uuid",
      "readOnly": true
    },
    "selfServiceByoc": {
      "type": "boolean",
      "description": "Whether this provider account was created via self-service BYOC setup.",
      "readOnly": true
    },
    "cloudProvider": {
      "type": "string",
      "description": "Cloud provider for this BYOC setup.",
      "readOnly": true
    },
    "providerAccountId": {
      "type": "string",
      "description": "ID of the provider account.",
      "format": "uuid",
      "readOnly": true,
      "x-terraform-id": true
    },
    "cloudProviderAccountId": {
      "type": "string",
      "description": "Cloud provider account ID for BYOC setup."
    },
    "dataCentreBackupBuckets": {
      "maxItems": 30,
      "type": "array",
      "description": "One or more data centre backup bucket mappings. Array order has no semantic meaning.",
      "items": {
        "$ref": "#/$defs/ByocAwsDataCentreBackupBucketV1"
      },
      "x-terraform-ignore-order": true
    },
    "existingKeyPairProviderAccountNames": {
      "type": "array",
      "description": "Names of other RUNNING BYOC provider accounts under this Instaclustr account that share the same AWS account ID and overlap at least one configured data centre region.",
      "readOnly": true,
      "items": {
        "type": "string"
      }
    },
    "providerAccountName": {
      "type": "string",
      "description": "Name of the provider account.",
      "x-terraform-force-new": true
    },
    "iamRoleName": {
      "type": "string",
      "description": "Custom IAM role name for BYOC setup. If not provided, defaults to 'instaclustr-<account-id>'. Must be 1-64 characters, containing only alphanumeric characters and +=,.@-_ symbols."
    },
    "skipKeyPairCreation": {
      "type": "boolean",
      "description": "When true, an EC2 key pair already exists for this Instaclustr account in every configured data centre region in the target AWS account (created by another RUNNING BYOC setup, or by this setup if already validated). Terraform users should pass create_key_pair = false when applying the template. When false, individual regions may still overlap the RUNNING accounts named in existingKeyPairProviderAccountNames; compare their data centre mappings and set create_key_pair = false only for overlapping regions. CloudFormation downloads set CreateKeyPair automatically per region.",
      "readOnly": true
    },
    "status": {
      "type": "string",
      "description": "Status of the BYOC provider account setup.",
      "readOnly": true,
      "x-terraform-field-status": true
    }
  },
  "$defs": {
    "ByocAwsDataCentreBackupBucketV1": {
      "required": [
        "backupBucketName",
        "dataCentre"
      ],
      "type": "object",
      "properties": {
        "backupBucketName": {
          "type": "string",
          "description": "S3 backup bucket name for the data centre region. An empty string indicates that an existing validated region from a manually configured provider account has no backup bucket. New and pending regions require a valid bucket name."
        },
        "dataCentre": {
          "type": "string",
          "description": "Data centre region name."
        }
      },
      "description": "Backup bucket mapping for a BYOC data centre region."
    }
  }
}