# CfnCustomActionProps

Properties for defining a `CfnCustomAction`.

Used as props by: [CfnCustomAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.CfnCustomAction.html)

- Source: Generated at build time
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_chatbot as chatbot } from 'aws-cdk-lib';
const cfnCustomActionProps: chatbot.CfnCustomActionProps = {
  actionName: 'actionName',
  definition: {
    commandText: 'commandText',
  },

  // the properties below are optional
  aliasName: 'aliasName',
  attachments: [{
    buttonText: 'buttonText',
    criteria: [{
      operator: 'operator',
      variableName: 'variableName',

      // the properties below are optional
      value: 'value',
    }],
    notificationType: 'notificationType',
    variables: {
      variablesKey: 'variables',
    },
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_chatbot as chatbot

cfn_custom_action_props = chatbot.CfnCustomActionProps(
    action_name="actionName",
    definition=chatbot.CfnCustomAction.CustomActionDefinitionProperty(
        command_text="commandText"
    ),

    # the properties below are optional
    alias_name="aliasName",
    attachments=[chatbot.CfnCustomAction.CustomActionAttachmentProperty(
        button_text="buttonText",
        criteria=[chatbot.CfnCustomAction.CustomActionAttachmentCriteriaProperty(
            operator="operator",
            variable_name="variableName",

            # the properties below are optional
            value="value"
        )],
        notification_type="notificationType",
        variables={
            "variables_key": "variables"
        }
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.chatbot.*;

CfnCustomActionProps cfnCustomActionProps = CfnCustomActionProps.builder()
        .actionName("actionName")
        .definition(CustomActionDefinitionProperty.builder()
                .commandText("commandText")
                .build())

        // the properties below are optional
        .aliasName("aliasName")
        .attachments(List.of(CustomActionAttachmentProperty.builder()
                .buttonText("buttonText")
                .criteria(List.of(CustomActionAttachmentCriteriaProperty.builder()
                        .operator("operator")
                        .variableName("variableName")

                        // the properties below are optional
                        .value("value")
                        .build()))
                .notificationType("notificationType")
                .variables(Map.of(
                        "variablesKey", "variables"))
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Chatbot;

var cfnCustomActionProps = new CfnCustomActionProps {
    ActionName = "actionName",
    Definition = new CustomActionDefinitionProperty {
        CommandText = "commandText"
    },

    // the properties below are optional
    AliasName = "aliasName",
    Attachments = new [] { new CustomActionAttachmentProperty {
        ButtonText = "buttonText",
        Criteria = new [] { new CustomActionAttachmentCriteriaProperty {
            Operator = "operator",
            VariableName = "variableName",

            // the properties below are optional
            Value = "value"
        } },
        NotificationType = "notificationType",
        Variables = new Dictionary<string, string> {
            { "variablesKey", "variables" }
        }
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCustomActionProps := &CfnCustomActionProps{
	ActionName: jsii.String("actionName"),
	Definition: &CustomActionDefinitionProperty{
		CommandText: jsii.String("commandText"),
	},

	// the properties below are optional
	AliasName: jsii.String("aliasName"),
	Attachments: []interface{}{
		&CustomActionAttachmentProperty{
			ButtonText: jsii.String("buttonText"),
			Criteria: []interface{}{
				&CustomActionAttachmentCriteriaProperty{
					Operator: jsii.String("operator"),
					VariableName: jsii.String("variableName"),

					// the properties below are optional
					Value: jsii.String("value"),
				},
			},
			NotificationType: jsii.String("notificationType"),
			Variables: map[string]*string{
				"variablesKey": jsii.String("variables"),
			},
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `actionName`: string (required) — The name of the custom action.

  This name is included in the Amazon Resource Name (ARN).

- `aliasName`: string — The name used to invoke this action in a chat channel.

  For example, `@Amazon Q run my-alias` .

- `attachments`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCustomAction.CustomActionAttachmentProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.CfnCustomAction.CustomActionAttachmentProperty.html)[] — Defines when this custom action button should be attached to a notification.

- `definition`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCustomAction.CustomActionDefinitionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_chatbot.CfnCustomAction.CustomActionDefinitionProperty.html) (required) — The definition of the command to run when invoked as an alias or as an action button.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags to add to the configuration.
