PromptVersion
The PromptVersion resource allows you to create and manage AWS Bedrock PromptVersions which are used for versioning prompts in your AI applications.
Minimal Example
Section titled “Minimal Example”Create a basic PromptVersion with required properties and an optional description.
import AWS from "alchemy/aws/control";
const promptVersion = await AWS.Bedrock.PromptVersion("myPromptVersion", { PromptArn: "arn:aws:bedrock:us-west-2:123456789012:prompt/my-prompt", Description: "Initial version of my AI prompt."});
Advanced Configuration
Section titled “Advanced Configuration”Configure a PromptVersion with tags for better management and organization.
const taggedPromptVersion = await AWS.Bedrock.PromptVersion("myTaggedPromptVersion", { PromptArn: "arn:aws:bedrock:us-west-2:123456789012:prompt/my-prompt", Description: "Version 1 of my prompt with tags.", Tags: { Environment: "Production", Team: "AI Development" }});
Adopting Existing Resources
Section titled “Adopting Existing Resources”Create a PromptVersion that adopts an existing resource instead of failing.
const adoptExistingPromptVersion = await AWS.Bedrock.PromptVersion("myAdoptedPromptVersion", { PromptArn: "arn:aws:bedrock:us-west-2:123456789012:prompt/my-existing-prompt", Description: "Adopted version of an existing prompt.", adopt: true});
Updating an Existing PromptVersion
Section titled “Updating an Existing PromptVersion”You can also update an existing PromptVersion by using the same ID and modifying the properties.
const updatedPromptVersion = await AWS.Bedrock.PromptVersion("myPromptVersion", { PromptArn: "arn:aws:bedrock:us-west-2:123456789012:prompt/my-prompt", Description: "Updated version of my AI prompt with new features."});