V2modelsBot class
Resource for managing an AWS Lex V2 Models Bot.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleRole = new aws.iam.Role("example", {
name: "example",
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Sid: "",
Principal: {
Service: "lexv2.amazonaws.com",
},
}],
}),
tags: {
created_by: "aws",
},
});
const example = new aws.lex.V2modelsBot("example", {
dataPrivacies: [{
childDirected: false,
}],
name: "example",
description: "Example description",
idleSessionTtlInSeconds: 60,
roleArn: exampleRole.arn,
type: "Bot",
tags: {
foo: "bar",
},
});
import pulumi
import json
import pulumi_aws as aws
example_role = aws.iam.Role("example",
name="example",
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": {
"Service": "lexv2.amazonaws.com",
},
}],
}),
tags={
"created_by": "aws",
})
example = aws.lex.V2modelsBot("example",
data_privacies=[{
"child_directed": False,
}],
name="example",
description="Example description",
idle_session_ttl_in_seconds=60,
role_arn=example_role.arn,
type="Bot",
tags={
"foo": "bar",
})
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleRole = new Aws.Iam.Role("example", new()
{
Name = "example",
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = "sts:AssumeRole",
["Effect"] = "Allow",
["Sid"] = "",
["Principal"] = new Dictionary<string, object?>
{
["Service"] = "lexv2.amazonaws.com",
},
},
},
}),
Tags =
{
{ "created_by", "aws" },
},
});
var example = new Aws.Lex.V2modelsBot("example", new()
{
DataPrivacies = new[]
{
new Aws.Lex.Inputs.V2modelsBotDataPrivacyArgs
{
ChildDirected = false,
},
},
Name = "example",
Description = "Example description",
IdleSessionTtlInSeconds = 60,
RoleArn = exampleRole.Arn,
Type = "Bot",
Tags =
{
{ "foo", "bar" },
},
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lex"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": map[string]string{
"Service": "lexv2.amazonaws.com",
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
exampleRole, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
Name: pulumi.String("example"),
AssumeRolePolicy: pulumi.String(json0),
Tags: pulumi.StringMap{
"created_by": pulumi.String("aws"),
},
})
if err != nil {
return err
}
_, err = lex.NewV2modelsBot(ctx, "example", &lex.V2modelsBotArgs{
DataPrivacies: lex.V2modelsBotDataPrivacyArray{
&lex.V2modelsBotDataPrivacyArgs{
ChildDirected: pulumi.Bool(false),
},
},
Name: pulumi.String("example"),
Description: pulumi.String("Example description"),
IdleSessionTtlInSeconds: pulumi.Int(60),
RoleArn: exampleRole.Arn,
Type: pulumi.String("Bot"),
Tags: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_lex_v2modelsbot" "example" {
data_privacies {
child_directed = false
}
name = "example"
description = "Example description"
idle_session_ttl_in_seconds = 60
role_arn = aws_iam_role.example.arn
type = "Bot"
tags = {
"foo" = "bar"
}
}
resource "aws_iam_role" "example" {
name = "example"
assume_role_policy = jsonencode({
"Version" = "2012-10-17"
"Statement" = [{
"Action" = "sts:AssumeRole"
"Effect" = "Allow"
"Sid" = ""
"Principal" = {
"Service" = "lexv2.amazonaws.com"
}
}]
})
tags = {
"created_by" = "aws"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.lex.V2modelsBot;
import com.pulumi.aws.lex.V2modelsBotArgs;
import com.pulumi.aws.lex.inputs.V2modelsBotDataPrivacyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 exampleRole = new Role("exampleRole", RoleArgs.builder()
.name("example")
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Sid", ""),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "lexv2.amazonaws.com")
))
)))
)))
.tags(Map.of("created_by", "aws"))
.build());
var example = new V2modelsBot("example", V2modelsBotArgs.builder()
.dataPrivacies(V2modelsBotDataPrivacyArgs.builder()
.childDirected(false)
.build())
.name("example")
.description("Example description")
.idleSessionTtlInSeconds(60)
.roleArn(exampleRole.arn())
.type("Bot")
.tags(Map.of("foo", "bar"))
.build());
}
}
resources:
example:
type: aws:lex:V2modelsBot
properties:
dataPrivacies:
- childDirected: false
name: example
description: Example description
idleSessionTtlInSeconds: 60
roleArn: ${exampleRole.arn}
type: Bot
tags:
foo: bar
exampleRole:
type: aws:iam:Role
name: example
properties:
name: example
assumeRolePolicy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Action: sts:AssumeRole
Effect: Allow
Sid: ""
Principal:
Service: lexv2.amazonaws.com
tags:
created_by: aws
Import
Using pulumi import, import Lex V2 Models Bot using the id. For example:
$ pulumi import aws:lex/v2modelsBot:V2modelsBot example bot-id-12345678
Constructors
- V2modelsBot(String name, {V2modelsBotArgs? args, CustomResourceOptions? options})
-
Creates a new V2modelsBot.
nameThe Pulumi resource name.argsArguments used to configure this V2modelsBot. The set of arguments for V2modelsBot.optionsResource options controlling this resource's behavior. - V2modelsBot.reference(String urn)
- Creates a typed reference to an existing V2modelsBot resource.
Properties
-
arn
↔ Output<
String> -
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
dataPrivacies
↔ Output<
List< V2modelsBotDataPrivacy> > -
Provides information on additional privacy protections Amazon Lex should use with the bot's data. See
dataPrivacylatefinal -
description
↔ Output<
String?> -
Description of the bot. It appears in lists to help you identify a particular bot.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
idleSessionTtlInSeconds
↔ Output<
int> -
Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
latefinal
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
members
↔ Output<
List< V2modelsBotMember> ?> -
List of bot members in a network to be created. See
botMembers.latefinal -
name
↔ Output<
String> -
Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
roleArn
↔ Output<
String> -
ARN of an IAM role that has permission to access the bot.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
List of tags to add to the bot. You can only add tags when you create a bot.
latefinal
-
latefinal
-
testBotAliasTags
↔ Output<
Map< String, String> ?> -
List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
latefinal
-
timeouts
↔ Output<
V2modelsBotTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
type
↔ Output<
String> -
Type of a bot to create. Possible values are
"Bot"and"BotNetwork".latefinal -
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {V2modelsBotState? state, CustomResourceOptions? options}) → V2modelsBot -
Gets an existing V2modelsBot resource's state with the given
nameandid.