> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# PromptVersion

Class to create a Prompt Version with CDK.

Creates a version of the prompt. Use this to create a static snapshot of your
prompt that can be deployed to production. Versions allow you to easily switch
between different configurations for your prompt and update your application
with the most appropriate version for your use-case.

Extends: Construct › PromptVersion
Implements: IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- CloudFormation: [`AWS::Bedrock::PromptVersion`](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html)
- Source: [`bedrock/prompts/prompt-version.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/prompts/prompt-version.ts#L42)

## Example

```ts
const cmk = new kms.Key(this, 'cmk', {});
const claudeModel = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0;

const variant1 = bedrock.PromptVariant.text({
  variantName: 'variant1',
  model: claudeModel,
  promptVariables: ['topic'],
  promptText: 'This is my first text prompt. Please summarize our conversation on: {{topic}}.',
  inferenceConfiguration: bedrock.PromptInferenceConfiguration.text({
    temperature: 1.0,
    topP: 0.999,
    maxTokens: 2000,
  }),
});

const prompt1 = new bedrock.Prompt(this, 'prompt1', {
  promptName: 'prompt1',
  description: 'my first prompt',
  defaultVariant: variant1,
  variants: [variant1],
  kmsKey: cmk,
});

const promptVersion = new bedrock.PromptVersion(this, 'MyPromptVersion', {
  prompt: prompt1,
  description: 'my first version',
});
//or alternatively:
// const promptVersion = prompt1.createVersion('my first version');
const versionString = promptVersion.version;
```

## Initializer

```ts
new PromptVersion(scope: Construct, id: string, props: PromptVersionProps)
```

## Construct Props

- `description`: string — The description of the prompt version.

  **Default:** No description provided. Maximum length: 200

- `prompt`: [IPrompt](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.IPrompt.html) (required) — The prompt to use for this version.

## Properties

- `description`: string — The description of the prompt version.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `prompt`: [IPrompt](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.IPrompt.html) — The prompt used by this version.

- `version`: string — The version of the prompt that was created.

- `versionArn`: string — The Amazon Resource Name (ARN) of the prompt version.

  ```ts
  "arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT12345:1"
  ```

## Methods

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
