{
  "typeName" : "AWS::BedrockAgentCore::ConfigurationBundle",
  "description" : "Definition of AWS::BedrockAgentCore::ConfigurationBundle Resource Type",
  "definitions" : {
    "Tag" : {
      "type" : "object",
      "description" : "A tag consisting of a key-value pair.",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^[a-zA-Z0-9\\s._:/=+@-]*$"
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256,
          "pattern" : "^[a-zA-Z0-9\\s._:/=+@-]*$"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "ComponentConfiguration" : {
      "type" : "object",
      "description" : "The configuration for a component within a configuration bundle.",
      "properties" : {
        "Configuration" : {
          "type" : "object",
          "description" : "The configuration values as a flexible JSON document."
        }
      },
      "required" : [ "Configuration" ],
      "additionalProperties" : false
    },
    "VersionCreatedBySource" : {
      "type" : "object",
      "description" : "The source that created a configuration bundle version.",
      "properties" : {
        "Name" : {
          "type" : "string",
          "description" : "The name of the source (for example, user, optimization-job, or system)."
        },
        "Arn" : {
          "type" : "string",
          "description" : "The Amazon Resource Name (ARN) of the source, if applicable."
        }
      },
      "required" : [ "Name" ],
      "additionalProperties" : false
    },
    "VersionLineageMetadata" : {
      "type" : "object",
      "description" : "The version lineage metadata that tracks parent versions and creation source.",
      "properties" : {
        "ParentVersionIds" : {
          "type" : "array",
          "description" : "A list of parent version identifiers.",
          "items" : {
            "type" : "string",
            "pattern" : "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          }
        },
        "BranchName" : {
          "type" : "string",
          "description" : "The branch name for this version.",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^[a-zA-Z][a-zA-Z0-9_/-]{0,127}$"
        },
        "CreatedBy" : {
          "$ref" : "#/definitions/VersionCreatedBySource"
        },
        "CommitMessage" : {
          "type" : "string",
          "description" : "A commit message describing the changes in this version.",
          "minLength" : 1,
          "maxLength" : 500
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "BundleArn" : {
      "type" : "string",
      "description" : "The Amazon Resource Name (ARN) of the configuration bundle.",
      "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:configuration-bundle/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}$"
    },
    "BundleId" : {
      "type" : "string",
      "description" : "The unique identifier of the configuration bundle.",
      "pattern" : "^[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}$"
    },
    "BundleName" : {
      "type" : "string",
      "description" : "The name for the configuration bundle. Names must be unique within your account.",
      "pattern" : "^[a-zA-Z][a-zA-Z0-9_]{0,99}$"
    },
    "Description" : {
      "type" : "string",
      "description" : "The description for the configuration bundle.",
      "minLength" : 1,
      "maxLength" : 500,
      "pattern" : "^.+$"
    },
    "Components" : {
      "type" : "object",
      "description" : "A map of component identifiers to their configurations.",
      "patternProperties" : {
        "^[a-zA-Z][a-zA-Z0-9_:/.\\-]{0,2047}$" : {
          "$ref" : "#/definitions/ComponentConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "BranchName" : {
      "type" : "string",
      "description" : "The branch name for version tracking.",
      "minLength" : 1,
      "maxLength" : 128,
      "pattern" : "^[a-zA-Z][a-zA-Z0-9_/-]{0,127}$"
    },
    "CommitMessage" : {
      "type" : "string",
      "description" : "A commit message describing the version of the configuration bundle.",
      "minLength" : 1,
      "maxLength" : 500
    },
    "CreatedBy" : {
      "$ref" : "#/definitions/VersionCreatedBySource"
    },
    "VersionId" : {
      "type" : "string",
      "description" : "The version identifier of the configuration bundle.",
      "pattern" : "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
    },
    "LineageMetadata" : {
      "$ref" : "#/definitions/VersionLineageMetadata"
    },
    "KmsKeyArn" : {
      "type" : "string",
      "description" : "The ARN of the KMS key used to encrypt component configurations.",
      "minLength" : 1,
      "maxLength" : 2048,
      "pattern" : "^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$"
    },
    "Tags" : {
      "type" : "array",
      "description" : "Tags to assign to the configuration bundle.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 50,
      "insertionOrder" : false
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The timestamp when the configuration bundle was created.",
      "format" : "date-time"
    },
    "UpdatedAt" : {
      "type" : "string",
      "description" : "The timestamp when the configuration bundle was last updated.",
      "format" : "date-time"
    }
  },
  "required" : [ "BundleName", "Components" ],
  "additionalProperties" : false,
  "readOnlyProperties" : [ "/properties/BundleArn", "/properties/BundleId", "/properties/CreatedAt", "/properties/UpdatedAt", "/properties/LineageMetadata", "/properties/VersionId" ],
  "createOnlyProperties" : [ "/properties/BundleName" ],
  "writeOnlyProperties" : [ "/properties/CommitMessage", "/properties/CreatedBy", "/properties/BranchName" ],
  "primaryIdentifier" : [ "/properties/BundleArn" ],
  "additionalIdentifiers" : [ [ "/properties/BundleId" ] ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "tagProperty" : "/properties/Tags",
    "cloudFormationSystemTags" : false,
    "permissions" : [ "bedrock-agentcore:TagResource", "bedrock-agentcore:UntagResource", "bedrock-agentcore:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "bedrock-agentcore:CreateConfigurationBundle", "bedrock-agentcore:GetConfigurationBundle", "bedrock-agentcore:TagResource", "bedrock-agentcore:ListTagsForResource", "kms:Encrypt", "kms:Decrypt", "kms:ReEncryptFrom", "kms:ReEncryptTo", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:DescribeKey", "kms:CreateGrant", "kms:RetireGrant" ]
    },
    "read" : {
      "permissions" : [ "bedrock-agentcore:GetConfigurationBundle", "bedrock-agentcore:ListTagsForResource", "kms:Decrypt", "kms:DescribeKey" ]
    },
    "update" : {
      "permissions" : [ "bedrock-agentcore:UpdateConfigurationBundle", "bedrock-agentcore:GetConfigurationBundle", "bedrock-agentcore:TagResource", "bedrock-agentcore:UntagResource", "bedrock-agentcore:ListTagsForResource", "kms:Encrypt", "kms:Decrypt", "kms:ReEncryptFrom", "kms:ReEncryptTo", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:DescribeKey", "kms:CreateGrant", "kms:RetireGrant" ]
    },
    "delete" : {
      "permissions" : [ "bedrock-agentcore:DeleteConfigurationBundle", "bedrock-agentcore:GetConfigurationBundle", "kms:Decrypt", "kms:DescribeKey", "kms:RetireGrant" ]
    },
    "list" : {
      "permissions" : [ "bedrock-agentcore:ListConfigurationBundles" ]
    }
  }
}