AgentPromptArgs

data class AgentPromptArgs(val customerEncryptionKeyArn: Output<String>? = null, val defaultVariant: Output<String>? = null, val description: Output<String>? = null, val name: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val variants: Output<List<AgentPromptVariantArgs>>? = null) : ConvertibleToJava<AgentPromptArgs>

Resource for managing an AWS Bedrock Agents Prompt.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.AgentPrompt("example", {
name: "MyPrompt",
description: "My prompt description.",
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.AgentPrompt("example",
name="MyPrompt",
description="My prompt description.")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.AgentPrompt("example", new()
{
Name = "MyPrompt",
Description = "My prompt description.",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bedrock.NewAgentPrompt(ctx, "example", &bedrock.AgentPromptArgs{
Name: pulumi.String("MyPrompt"),
Description: pulumi.String("My prompt description."),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.AgentPrompt;
import com.pulumi.aws.bedrock.AgentPromptArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new AgentPrompt("example", AgentPromptArgs.builder()
.name("MyPrompt")
.description("My prompt description.")
.build());
}
}
resources:
example:
type: aws:bedrock:AgentPrompt
properties:
name: MyPrompt
description: My prompt description.

With Variants

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.AgentPrompt("example", {
name: "MakePlaylist",
description: "My first prompt.",
defaultVariant: "Variant1",
variants: [{
name: "Variant1",
modelId: "amazon.titan-text-express-v1",
inferenceConfiguration: {
text: {
temperature: 0.8,
},
},
templateType: "TEXT",
templateConfiguration: {
text: {
text: "Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.",
inputVariables: [
{
name: "genre",
},
{
name: "number",
},
],
},
},
}],
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.AgentPrompt("example",
name="MakePlaylist",
description="My first prompt.",
default_variant="Variant1",
variants=[{
"name": "Variant1",
"model_id": "amazon.titan-text-express-v1",
"inference_configuration": {
"text": {
"temperature": 0.8,
},
},
"template_type": "TEXT",
"template_configuration": {
"text": {
"text": "Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.",
"input_variables": [
{
"name": "genre",
},
{
"name": "number",
},
],
},
},
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.AgentPrompt("example", new()
{
Name = "MakePlaylist",
Description = "My first prompt.",
DefaultVariant = "Variant1",
Variants = new[]
{
new Aws.Bedrock.Inputs.AgentPromptVariantArgs
{
Name = "Variant1",
ModelId = "amazon.titan-text-express-v1",
InferenceConfiguration = new Aws.Bedrock.Inputs.AgentPromptVariantInferenceConfigurationArgs
{
Text = new Aws.Bedrock.Inputs.AgentPromptVariantInferenceConfigurationTextArgs
{
Temperature = 0.8,
},
},
TemplateType = "TEXT",
TemplateConfiguration = new Aws.Bedrock.Inputs.AgentPromptVariantTemplateConfigurationArgs
{
Text = new Aws.Bedrock.Inputs.AgentPromptVariantTemplateConfigurationTextArgs
{
Text = "Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.",
InputVariables = new[]
{
new Aws.Bedrock.Inputs.AgentPromptVariantTemplateConfigurationTextInputVariableArgs
{
Name = "genre",
},
new Aws.Bedrock.Inputs.AgentPromptVariantTemplateConfigurationTextInputVariableArgs
{
Name = "number",
},
},
},
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bedrock.NewAgentPrompt(ctx, "example", &bedrock.AgentPromptArgs{
Name: pulumi.String("MakePlaylist"),
Description: pulumi.String("My first prompt."),
DefaultVariant: pulumi.String("Variant1"),
Variants: bedrock.AgentPromptVariantArray{
&bedrock.AgentPromptVariantArgs{
Name: pulumi.String("Variant1"),
ModelId: pulumi.String("amazon.titan-text-express-v1"),
InferenceConfiguration: &bedrock.AgentPromptVariantInferenceConfigurationArgs{
Text: &bedrock.AgentPromptVariantInferenceConfigurationTextArgs{
Temperature: pulumi.Float64(0.8),
},
},
TemplateType: pulumi.String("TEXT"),
TemplateConfiguration: &bedrock.AgentPromptVariantTemplateConfigurationArgs{
Text: &bedrock.AgentPromptVariantTemplateConfigurationTextArgs{
Text: pulumi.String("Make me a {{genre}} playlist consisting of the following number of songs: {{number}}."),
InputVariables: bedrock.AgentPromptVariantTemplateConfigurationTextInputVariableArray{
&bedrock.AgentPromptVariantTemplateConfigurationTextInputVariableArgs{
Name: pulumi.String("genre"),
},
&bedrock.AgentPromptVariantTemplateConfigurationTextInputVariableArgs{
Name: pulumi.String("number"),
},
},
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.AgentPrompt;
import com.pulumi.aws.bedrock.AgentPromptArgs;
import com.pulumi.aws.bedrock.inputs.AgentPromptVariantArgs;
import com.pulumi.aws.bedrock.inputs.AgentPromptVariantInferenceConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentPromptVariantInferenceConfigurationTextArgs;
import com.pulumi.aws.bedrock.inputs.AgentPromptVariantTemplateConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentPromptVariantTemplateConfigurationTextArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new AgentPrompt("example", AgentPromptArgs.builder()
.name("MakePlaylist")
.description("My first prompt.")
.defaultVariant("Variant1")
.variants(AgentPromptVariantArgs.builder()
.name("Variant1")
.modelId("amazon.titan-text-express-v1")
.inferenceConfiguration(AgentPromptVariantInferenceConfigurationArgs.builder()
.text(AgentPromptVariantInferenceConfigurationTextArgs.builder()
.temperature(0.8)
.build())
.build())
.templateType("TEXT")
.templateConfiguration(AgentPromptVariantTemplateConfigurationArgs.builder()
.text(AgentPromptVariantTemplateConfigurationTextArgs.builder()
.text("Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.")
.inputVariables(
AgentPromptVariantTemplateConfigurationTextInputVariableArgs.builder()
.name("genre")
.build(),
AgentPromptVariantTemplateConfigurationTextInputVariableArgs.builder()
.name("number")
.build())
.build())
.build())
.build())
.build());
}
}
resources:
example:
type: aws:bedrock:AgentPrompt
properties:
name: MakePlaylist
description: My first prompt.
defaultVariant: Variant1
variants:
- name: Variant1
modelId: amazon.titan-text-express-v1
inferenceConfiguration:
text:
temperature: 0.8
templateType: TEXT
templateConfiguration:
text:
text: 'Make me a {{genre}} playlist consisting of the following number of songs: {{number}}.'
inputVariables:
- name: genre
- name: number

Import

Using pulumi import, import Bedrock Agents Prompt using the id. For example:

$ pulumi import aws:bedrock/agentPrompt:AgentPrompt example 1A2BC3DEFG

Constructors

Link copied to clipboard
constructor(customerEncryptionKeyArn: Output<String>? = null, defaultVariant: Output<String>? = null, description: Output<String>? = null, name: Output<String>? = null, tags: Output<Map<String, String>>? = null, variants: Output<List<AgentPromptVariantArgs>>? = null)

Properties

Link copied to clipboard
val customerEncryptionKeyArn: Output<String>? = null

Amazon Resource Name (ARN) of the KMS key that you encrypted the prompt with.

Link copied to clipboard
val defaultVariant: Output<String>? = null

Name of the default variant for your prompt.

Link copied to clipboard
val description: Output<String>? = null

Description of the prompt.

Link copied to clipboard
val name: Output<String>? = null

Name of the prompt. The following arguments are optional:

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val variants: Output<List<AgentPromptVariantArgs>>? = null

A list of objects, each containing details about a variant of the prompt. See Variant for more information.

Functions

Link copied to clipboard
open override fun toJava(): AgentPromptArgs