Skip to content
v2.278.0

CfnRuleProps Struct ​

Properties for defining a CfnRule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_connect as connect } from 'aws-cdk-lib';

declare const assignContactCategoryActions: any;
declare const emptyValue: any;
declare const endAssociatedTasksActions: any;
const cfnRuleProps: connect.CfnRuleProps = {
  actions: {
    assignContactCategoryActions: [assignContactCategoryActions],
    assignSlaActions: [{
      caseSlaConfiguration: {
        name: 'name',
        targetSlaMinutes: 123,
        type: 'type',

        // the properties below are optional
        fieldId: 'fieldId',
        targetFieldValues: [{
          stringValue: 'stringValue',
        }],
      },
      slaAssignmentType: 'slaAssignmentType',
    }],
    createCaseActions: [{
      fields: [{
        id: 'id',
        value: {
          booleanValue: false,
          doubleValue: 123,
          emptyValue: emptyValue,
          stringValue: 'stringValue',
        },
      }],
      templateId: 'templateId',
    }],
    endAssociatedTasksActions: [endAssociatedTasksActions],
    eventBridgeActions: [{
      name: 'name',
    }],
    sendInAppNotificationActions: [{
      content: {
        deDe: 'deDe',
        enUs: 'enUs',
        esEs: 'esEs',
        frFr: 'frFr',
        idId: 'idId',
        itIt: 'itIt',
        jaJp: 'jaJp',
        koKr: 'koKr',
        ptBr: 'ptBr',
        zhCn: 'zhCn',
        zhTw: 'zhTw',
      },
      recipient: {
        userArns: ['userArns'],
        userTags: {
          userTagsKey: 'userTags',
        },
      },

      // the properties below are optional
      exclusion: {
        userArns: ['userArns'],
        userTags: {
          userTagsKey: 'userTags',
        },
      },
      priority: 'priority',
    }],
    sendNotificationActions: [{
      content: 'content',
      contentType: 'contentType',
      deliveryMethod: 'deliveryMethod',
      recipient: {
        userArns: ['userArns'],
        userTags: {
          userTagsKey: 'userTags',
        },
      },

      // the properties below are optional
      exclusion: {
        userArns: ['userArns'],
        userTags: {
          userTagsKey: 'userTags',
        },
      },
      subject: 'subject',
    }],
    submitAutoEvaluationActions: [{
      evaluationFormArn: 'evaluationFormArn',
    }],
    taskActions: [{
      contactFlowArn: 'contactFlowArn',
      name: 'name',

      // the properties below are optional
      description: 'description',
      references: {
        referencesKey: {
          type: 'type',
          value: 'value',
        },
      },
    }],
    updateCaseActions: [{
      fields: [{
        id: 'id',
        value: {
          booleanValue: false,
          doubleValue: 123,
          emptyValue: emptyValue,
          stringValue: 'stringValue',
        },
      }],
    }],
  },
  function: 'function',
  instanceArn: 'instanceArn',
  name: 'name',
  publishStatus: 'publishStatus',
  triggerEventSource: {
    eventSourceName: 'eventSourceName',

    // the properties below are optional
    integrationAssociationArn: 'integrationAssociationArn',
  },

  // the properties below are optional
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
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_connect as connect

# assign_contact_category_actions: Any
# empty_value: Any
# end_associated_tasks_actions: Any

cfn_rule_props = connect.CfnRuleProps(
    actions=connect.CfnRule.ActionsProperty(
        assign_contact_category_actions=[assign_contact_category_actions],
        assign_sla_actions=[connect.CfnRule.AssignSlaActionProperty(
            case_sla_configuration=connect.CfnRule.CaseSlaConfigurationProperty(
                name="name",
                target_sla_minutes=123,
                type="type",

                # the properties below are optional
                field_id="fieldId",
                target_field_values=[connect.CfnRule.SlaTargetFieldValueProperty(
                    string_value="stringValue"
                )]
            ),
            sla_assignment_type="slaAssignmentType"
        )],
        create_case_actions=[connect.CfnRule.CreateCaseActionProperty(
            fields=[connect.CfnRule.FieldProperty(
                id="id",
                value=connect.CfnRule.FieldValueProperty(
                    boolean_value=False,
                    double_value=123,
                    empty_value=empty_value,
                    string_value="stringValue"
                )
            )],
            template_id="templateId"
        )],
        end_associated_tasks_actions=[end_associated_tasks_actions],
        event_bridge_actions=[connect.CfnRule.EventBridgeActionProperty(
            name="name"
        )],
        send_in_app_notification_actions=[connect.CfnRule.SendInAppNotificationActionProperty(
            content=connect.CfnRule.NotificationContentProperty(
                de_de="deDe",
                en_us="enUs",
                es_es="esEs",
                fr_fr="frFr",
                id_id="idId",
                it_it="itIt",
                ja_jp="jaJp",
                ko_kr="koKr",
                pt_br="ptBr",
                zh_cn="zhCn",
                zh_tw="zhTw"
            ),
            recipient=connect.CfnRule.InAppNotificationRecipientTypeProperty(
                user_arns=["userArns"],
                user_tags={
                    "user_tags_key": "userTags"
                }
            ),

            # the properties below are optional
            exclusion=connect.CfnRule.InAppNotificationRecipientTypeProperty(
                user_arns=["userArns"],
                user_tags={
                    "user_tags_key": "userTags"
                }
            ),
            priority="priority"
        )],
        send_notification_actions=[connect.CfnRule.SendNotificationActionProperty(
            content="content",
            content_type="contentType",
            delivery_method="deliveryMethod",
            recipient=connect.CfnRule.NotificationRecipientTypeProperty(
                user_arns=["userArns"],
                user_tags={
                    "user_tags_key": "userTags"
                }
            ),

            # the properties below are optional
            exclusion=connect.CfnRule.NotificationRecipientTypeProperty(
                user_arns=["userArns"],
                user_tags={
                    "user_tags_key": "userTags"
                }
            ),
            subject="subject"
        )],
        submit_auto_evaluation_actions=[connect.CfnRule.SubmitAutoEvaluationActionProperty(
            evaluation_form_arn="evaluationFormArn"
        )],
        task_actions=[connect.CfnRule.TaskActionProperty(
            contact_flow_arn="contactFlowArn",
            name="name",

            # the properties below are optional
            description="description",
            references={
                "references_key": connect.CfnRule.ReferenceProperty(
                    type="type",
                    value="value"
                )
            }
        )],
        update_case_actions=[connect.CfnRule.UpdateCaseActionProperty(
            fields=[connect.CfnRule.FieldProperty(
                id="id",
                value=connect.CfnRule.FieldValueProperty(
                    boolean_value=False,
                    double_value=123,
                    empty_value=empty_value,
                    string_value="stringValue"
                )
            )]
        )]
    ),
    function="function",
    instance_arn="instanceArn",
    name="name",
    publish_status="publishStatus",
    trigger_event_source=connect.CfnRule.RuleTriggerEventSourceProperty(
        event_source_name="eventSourceName",

        # the properties below are optional
        integration_association_arn="integrationAssociationArn"
    ),

    # the properties below are optional
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
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.connect.*;

Object assignContactCategoryActions;
Object emptyValue;
Object endAssociatedTasksActions;

CfnRuleProps cfnRuleProps = CfnRuleProps.builder()
        .actions(ActionsProperty.builder()
                .assignContactCategoryActions(List.of(assignContactCategoryActions))
                .assignSlaActions(List.of(AssignSlaActionProperty.builder()
                        .caseSlaConfiguration(CaseSlaConfigurationProperty.builder()
                                .name("name")
                                .targetSlaMinutes(123)
                                .type("type")

                                // the properties below are optional
                                .fieldId("fieldId")
                                .targetFieldValues(List.of(SlaTargetFieldValueProperty.builder()
                                        .stringValue("stringValue")
                                        .build()))
                                .build())
                        .slaAssignmentType("slaAssignmentType")
                        .build()))
                .createCaseActions(List.of(CreateCaseActionProperty.builder()
                        .fields(List.of(FieldProperty.builder()
                                .id("id")
                                .value(FieldValueProperty.builder()
                                        .booleanValue(false)
                                        .doubleValue(123)
                                        .emptyValue(emptyValue)
                                        .stringValue("stringValue")
                                        .build())
                                .build()))
                        .templateId("templateId")
                        .build()))
                .endAssociatedTasksActions(List.of(endAssociatedTasksActions))
                .eventBridgeActions(List.of(EventBridgeActionProperty.builder()
                        .name("name")
                        .build()))
                .sendInAppNotificationActions(List.of(SendInAppNotificationActionProperty.builder()
                        .content(NotificationContentProperty.builder()
                                .deDe("deDe")
                                .enUs("enUs")
                                .esEs("esEs")
                                .frFr("frFr")
                                .idId("idId")
                                .itIt("itIt")
                                .jaJp("jaJp")
                                .koKr("koKr")
                                .ptBr("ptBr")
                                .zhCn("zhCn")
                                .zhTw("zhTw")
                                .build())
                        .recipient(InAppNotificationRecipientTypeProperty.builder()
                                .userArns(List.of("userArns"))
                                .userTags(Map.of(
                                        "userTagsKey", "userTags"))
                                .build())

                        // the properties below are optional
                        .exclusion(InAppNotificationRecipientTypeProperty.builder()
                                .userArns(List.of("userArns"))
                                .userTags(Map.of(
                                        "userTagsKey", "userTags"))
                                .build())
                        .priority("priority")
                        .build()))
                .sendNotificationActions(List.of(SendNotificationActionProperty.builder()
                        .content("content")
                        .contentType("contentType")
                        .deliveryMethod("deliveryMethod")
                        .recipient(NotificationRecipientTypeProperty.builder()
                                .userArns(List.of("userArns"))
                                .userTags(Map.of(
                                        "userTagsKey", "userTags"))
                                .build())

                        // the properties below are optional
                        .exclusion(NotificationRecipientTypeProperty.builder()
                                .userArns(List.of("userArns"))
                                .userTags(Map.of(
                                        "userTagsKey", "userTags"))
                                .build())
                        .subject("subject")
                        .build()))
                .submitAutoEvaluationActions(List.of(SubmitAutoEvaluationActionProperty.builder()
                        .evaluationFormArn("evaluationFormArn")
                        .build()))
                .taskActions(List.of(TaskActionProperty.builder()
                        .contactFlowArn("contactFlowArn")
                        .name("name")

                        // the properties below are optional
                        .description("description")
                        .references(Map.of(
                                "referencesKey", ReferenceProperty.builder()
                                        .type("type")
                                        .value("value")
                                        .build()))
                        .build()))
                .updateCaseActions(List.of(UpdateCaseActionProperty.builder()
                        .fields(List.of(FieldProperty.builder()
                                .id("id")
                                .value(FieldValueProperty.builder()
                                        .booleanValue(false)
                                        .doubleValue(123)
                                        .emptyValue(emptyValue)
                                        .stringValue("stringValue")
                                        .build())
                                .build()))
                        .build()))
                .build())
        .function("function")
        .instanceArn("instanceArn")
        .name("name")
        .publishStatus("publishStatus")
        .triggerEventSource(RuleTriggerEventSourceProperty.builder()
                .eventSourceName("eventSourceName")

                // the properties below are optional
                .integrationAssociationArn("integrationAssociationArn")
                .build())

        // the properties below are optional
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
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.Connect;

var assignContactCategoryActions;
var emptyValue;
var endAssociatedTasksActions;

var cfnRuleProps = new CfnRuleProps {
    Actions = new ActionsProperty {
        AssignContactCategoryActions = new [] { assignContactCategoryActions },
        AssignSlaActions = new [] { new AssignSlaActionProperty {
            CaseSlaConfiguration = new CaseSlaConfigurationProperty {
                Name = "name",
                TargetSlaMinutes = 123,
                Type = "type",

                // the properties below are optional
                FieldId = "fieldId",
                TargetFieldValues = new [] { new SlaTargetFieldValueProperty {
                    StringValue = "stringValue"
                } }
            },
            SlaAssignmentType = "slaAssignmentType"
        } },
        CreateCaseActions = new [] { new CreateCaseActionProperty {
            Fields = new [] { new FieldProperty {
                Id = "id",
                Value = new FieldValueProperty {
                    BooleanValue = false,
                    DoubleValue = 123,
                    EmptyValue = emptyValue,
                    StringValue = "stringValue"
                }
            } },
            TemplateId = "templateId"
        } },
        EndAssociatedTasksActions = new [] { endAssociatedTasksActions },
        EventBridgeActions = new [] { new EventBridgeActionProperty {
            Name = "name"
        } },
        SendInAppNotificationActions = new [] { new SendInAppNotificationActionProperty {
            Content = new NotificationContentProperty {
                DeDe = "deDe",
                EnUs = "enUs",
                EsEs = "esEs",
                FrFr = "frFr",
                IdId = "idId",
                ItIt = "itIt",
                JaJp = "jaJp",
                KoKr = "koKr",
                PtBr = "ptBr",
                ZhCn = "zhCn",
                ZhTw = "zhTw"
            },
            Recipient = new InAppNotificationRecipientTypeProperty {
                UserArns = new [] { "userArns" },
                UserTags = new Dictionary<string, string> {
                    { "userTagsKey", "userTags" }
                }
            },

            // the properties below are optional
            Exclusion = new InAppNotificationRecipientTypeProperty {
                UserArns = new [] { "userArns" },
                UserTags = new Dictionary<string, string> {
                    { "userTagsKey", "userTags" }
                }
            },
            Priority = "priority"
        } },
        SendNotificationActions = new [] { new SendNotificationActionProperty {
            Content = "content",
            ContentType = "contentType",
            DeliveryMethod = "deliveryMethod",
            Recipient = new NotificationRecipientTypeProperty {
                UserArns = new [] { "userArns" },
                UserTags = new Dictionary<string, string> {
                    { "userTagsKey", "userTags" }
                }
            },

            // the properties below are optional
            Exclusion = new NotificationRecipientTypeProperty {
                UserArns = new [] { "userArns" },
                UserTags = new Dictionary<string, string> {
                    { "userTagsKey", "userTags" }
                }
            },
            Subject = "subject"
        } },
        SubmitAutoEvaluationActions = new [] { new SubmitAutoEvaluationActionProperty {
            EvaluationFormArn = "evaluationFormArn"
        } },
        TaskActions = new [] { new TaskActionProperty {
            ContactFlowArn = "contactFlowArn",
            Name = "name",

            // the properties below are optional
            Description = "description",
            References = new Dictionary<string, object> {
                { "referencesKey", new ReferenceProperty {
                    Type = "type",
                    Value = "value"
                } }
            }
        } },
        UpdateCaseActions = new [] { new UpdateCaseActionProperty {
            Fields = new [] { new FieldProperty {
                Id = "id",
                Value = new FieldValueProperty {
                    BooleanValue = false,
                    DoubleValue = 123,
                    EmptyValue = emptyValue,
                    StringValue = "stringValue"
                }
            } }
        } }
    },
    Function = "function",
    InstanceArn = "instanceArn",
    Name = "name",
    PublishStatus = "publishStatus",
    TriggerEventSource = new RuleTriggerEventSourceProperty {
        EventSourceName = "eventSourceName",

        // the properties below are optional
        IntegrationAssociationArn = "integrationAssociationArn"
    },

    // the properties below are optional
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
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"

var assignContactCategoryActions interface{}
var emptyValue interface{}
var endAssociatedTasksActions interface{}

cfnRuleProps := &CfnRuleProps{
	Actions: &ActionsProperty{
		AssignContactCategoryActions: []interface{}{
			assignContactCategoryActions,
		},
		AssignSlaActions: []interface{}{
			&AssignSlaActionProperty{
				CaseSlaConfiguration: &CaseSlaConfigurationProperty{
					Name: jsii.String("name"),
					TargetSlaMinutes: jsii.Number(123),
					Type: jsii.String("type"),

					// the properties below are optional
					FieldId: jsii.String("fieldId"),
					TargetFieldValues: []interface{}{
						&SlaTargetFieldValueProperty{
							StringValue: jsii.String("stringValue"),
						},
					},
				},
				SlaAssignmentType: jsii.String("slaAssignmentType"),
			},
		},
		CreateCaseActions: []interface{}{
			&CreateCaseActionProperty{
				Fields: []interface{}{
					&FieldProperty{
						Id: jsii.String("id"),
						Value: &FieldValueProperty{
							BooleanValue: jsii.Boolean(false),
							DoubleValue: jsii.Number(123),
							EmptyValue: emptyValue,
							StringValue: jsii.String("stringValue"),
						},
					},
				},
				TemplateId: jsii.String("templateId"),
			},
		},
		EndAssociatedTasksActions: []interface{}{
			endAssociatedTasksActions,
		},
		EventBridgeActions: []interface{}{
			&EventBridgeActionProperty{
				Name: jsii.String("name"),
			},
		},
		SendInAppNotificationActions: []interface{}{
			&SendInAppNotificationActionProperty{
				Content: &NotificationContentProperty{
					DeDe: jsii.String("deDe"),
					EnUs: jsii.String("enUs"),
					EsEs: jsii.String("esEs"),
					FrFr: jsii.String("frFr"),
					IdId: jsii.String("idId"),
					ItIt: jsii.String("itIt"),
					JaJp: jsii.String("jaJp"),
					KoKr: jsii.String("koKr"),
					PtBr: jsii.String("ptBr"),
					ZhCn: jsii.String("zhCn"),
					ZhTw: jsii.String("zhTw"),
				},
				Recipient: &InAppNotificationRecipientTypeProperty{
					UserArns: []*string{
						jsii.String("userArns"),
					},
					UserTags: map[string]*string{
						"userTagsKey": jsii.String("userTags"),
					},
				},

				// the properties below are optional
				Exclusion: &InAppNotificationRecipientTypeProperty{
					UserArns: []*string{
						jsii.String("userArns"),
					},
					UserTags: map[string]*string{
						"userTagsKey": jsii.String("userTags"),
					},
				},
				Priority: jsii.String("priority"),
			},
		},
		SendNotificationActions: []interface{}{
			&SendNotificationActionProperty{
				Content: jsii.String("content"),
				ContentType: jsii.String("contentType"),
				DeliveryMethod: jsii.String("deliveryMethod"),
				Recipient: &NotificationRecipientTypeProperty{
					UserArns: []*string{
						jsii.String("userArns"),
					},
					UserTags: map[string]*string{
						"userTagsKey": jsii.String("userTags"),
					},
				},

				// the properties below are optional
				Exclusion: &NotificationRecipientTypeProperty{
					UserArns: []*string{
						jsii.String("userArns"),
					},
					UserTags: map[string]*string{
						"userTagsKey": jsii.String("userTags"),
					},
				},
				Subject: jsii.String("subject"),
			},
		},
		SubmitAutoEvaluationActions: []interface{}{
			&SubmitAutoEvaluationActionProperty{
				EvaluationFormArn: jsii.String("evaluationFormArn"),
			},
		},
		TaskActions: []interface{}{
			&TaskActionProperty{
				ContactFlowArn: jsii.String("contactFlowArn"),
				Name: jsii.String("name"),

				// the properties below are optional
				Description: jsii.String("description"),
				References: map[string]interface{}{
					"referencesKey": &ReferenceProperty{
						"type": jsii.String("type"),
						"value": jsii.String("value"),
					},
				},
			},
		},
		UpdateCaseActions: []interface{}{
			&UpdateCaseActionProperty{
				Fields: []interface{}{
					&FieldProperty{
						Id: jsii.String("id"),
						Value: &FieldValueProperty{
							BooleanValue: jsii.Boolean(false),
							DoubleValue: jsii.Number(123),
							EmptyValue: emptyValue,
							StringValue: jsii.String("stringValue"),
						},
					},
				},
			},
		},
	},
	Function: jsii.String("function"),
	InstanceArn: jsii.String("instanceArn"),
	Name: jsii.String("name"),
	PublishStatus: jsii.String("publishStatus"),
	TriggerEventSource: &RuleTriggerEventSourceProperty{
		EventSourceName: jsii.String("eventSourceName"),

		// the properties below are optional
		IntegrationAssociationArn: jsii.String("integrationAssociationArn"),
	},

	// the properties below are optional
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

actionsIResolvable | CfnRule.ActionsPropertyactionstyping.Union[IResolvable, ActionsProperty]actionsIResolvableActionsIResolvableActionsinterface{} required #
A list of actions to be run when the rule is triggered.
functionstringfunctionstrfunctionStringFunctionstringFunction*string required #
The conditions of the rule.
instanceArnstringinstance_arnstrinstanceArnStringInstanceArnstringInstanceArn*string required #
The Amazon Resource Name (ARN) of the instance.
namestringnamestrnameStringNamestringName*string required #
The name of the rule.
publishStatusstringpublish_statusstrpublishStatusStringPublishStatusstringPublishStatus*string required #
The publish status of the rule.

Allowed values : DRAFT | PUBLISHED

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
The tags used to organize, track, or control access for this resource.

For example, { "tags": {"key1":"value1", "key2":"value2"} }.

triggerEventSourceIResolvable | CfnRule.RuleTriggerEventSourcePropertytrigger_event_sourcetyping.Union[IResolvable, RuleTriggerEventSourceProperty]triggerEventSourceIResolvableTriggerEventSourceIResolvableTriggerEventSourceinterface{} required #
The event source to trigger the rule.