Intent

class Intent : KotlinCustomResource

Provides an Amazon Lex Intent resource. For more information see Amazon Lex: How It Works

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lex.Intent;
import com.pulumi.aws.lex.IntentArgs;
import com.pulumi.aws.lex.inputs.IntentConfirmationPromptArgs;
import com.pulumi.aws.lex.inputs.IntentFulfillmentActivityArgs;
import com.pulumi.aws.lex.inputs.IntentRejectionStatementArgs;
import com.pulumi.aws.lex.inputs.IntentSlotArgs;
import com.pulumi.aws.lex.inputs.IntentSlotValueElicitationPromptArgs;
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 orderFlowersIntent = new Intent("orderFlowersIntent", IntentArgs.builder()
.confirmationPrompt(IntentConfirmationPromptArgs.builder()
.maxAttempts(2)
.messages(IntentConfirmationPromptMessageArgs.builder()
.content("Okay, your {FlowerType} will be ready for pickup by {PickupTime} on {PickupDate}. Does this sound okay?")
.contentType("PlainText")
.build())
.build())
.createVersion(false)
.description("Intent to order a bouquet of flowers for pick up")
.fulfillmentActivity(IntentFulfillmentActivityArgs.builder()
.type("ReturnIntent")
.build())
.name("OrderFlowers")
.rejectionStatement(IntentRejectionStatementArgs.builder()
.messages(IntentRejectionStatementMessageArgs.builder()
.content("Okay, I will not place your order.")
.contentType("PlainText")
.build())
.build())
.sampleUtterances(
"I would like to order some flowers",
"I would like to pick up flowers")
.slots(
IntentSlotArgs.builder()
.description("The type of flowers to pick up")
.name("FlowerType")
.priority(1)
.sampleUtterances("I would like to order {FlowerType}")
.slotConstraint("Required")
.slotType("FlowerTypes")
.slotTypeVersion("$LATEST")
.valueElicitationPrompt(IntentSlotValueElicitationPromptArgs.builder()
.maxAttempts(2)
.message(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build(),
IntentSlotArgs.builder()
.description("The date to pick up the flowers")
.name("PickupDate")
.priority(2)
.sampleUtterances("I would like to order {FlowerType}")
.slotConstraint("Required")
.slotType("AMAZON.DATE")
.slotTypeVersion("$LATEST")
.valueElicitationPrompt(IntentSlotValueElicitationPromptArgs.builder()
.maxAttempts(2)
.message(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build(),
IntentSlotArgs.builder()
.description("The time to pick up the flowers")
.name("PickupTime")
.priority(3)
.sampleUtterances("I would like to order {FlowerType}")
.slotConstraint("Required")
.slotType("AMAZON.TIME")
.slotTypeVersion("$LATEST")
.valueElicitationPrompt(IntentSlotValueElicitationPromptArgs.builder()
.maxAttempts(2)
.message(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build())
.build());
}
}

Import

Intents can be imported using their name.

$ pulumi import aws:lex/intent:Intent order_flowers_intent OrderFlowers

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the Lex intent.

Link copied to clipboard
val checksum: Output<String>

Checksum identifying the version of the intent that was created. The checksum is not included as an argument because the resource will add it automatically when updating the intent.

Link copied to clipboard

The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function. This element is relevant only if you provide a Lambda function in the fulfillment_activity. If you return the intent to the client application, you can't specify this element. The follow_up_prompt and conclusion_statement are mutually exclusive. You can specify only one. Attributes are documented under statement.

Link copied to clipboard

Prompts the user to confirm the intent. This question should have a yes or no answer. You you must provide both the rejection_statement and confirmation_prompt, or neither. Attributes are documented under prompt.

Link copied to clipboard
val createdDate: Output<String>

The date when the intent version was created.

Link copied to clipboard
val createVersion: Output<Boolean>?

Determines if a new slot type version is created when the initial resource is created and on each update. Defaults to false.

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

A description of the intent. Must be less than or equal to 200 characters in length.

Link copied to clipboard

Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction. Attributes are documented under code_hook.

Link copied to clipboard

Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the OrderPizza intent is fulfilled, you might prompt the user to order a drink. The follow_up_prompt field and the conclusion_statement field are mutually exclusive. You can specify only one. Attributes are documented under follow_up_prompt.

Link copied to clipboard

Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, fulfillment_activity defines how the bot places an order with a local pizza store. Attributes are documented under fulfillment_activity.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val lastUpdatedDate: Output<String>

The date when the $LATEST version of this intent was updated.

Link copied to clipboard
val name: Output<String>

The name of the intent, not case sensitive. Must be less than or equal to 100 characters in length.

Link copied to clipboard

A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see Standard Built-in Intents in the Alexa Skills Kit.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

When the user answers "no" to the question defined in confirmation_prompt, Amazon Lex responds with this statement to acknowledge that the intent was canceled. You must provide both the rejection_statement and the confirmation_prompt, or neither. Attributes are documented under statement.

Link copied to clipboard

An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas". In each utterance, a slot name is enclosed in curly braces. Must have between 1 and 10 items in the list, and each item must be less than or equal to 200 characters in length.

Link copied to clipboard
val slots: Output<List<IntentSlot>>?

An list of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. Attributes are documented under slot.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>

The version of the bot.