Skip to content

Resource: awsConnectContactFlowModule

Provides an Amazon Connect Contact Flow Module resource. For more information see Amazon Connect: Getting Started

This resource embeds or references Contact Flows Modules specified in Amazon Connect Contact Flow Language. For more information see Amazon Connect Flow language

!> WARN: Contact Flow Modules exported from the Console See Contact Flow import/export which is the same for Contact Flow Modules are not in the Amazon Connect Contact Flow Language and can not be used with this resource. Instead, the recommendation is to use the AWS CLI describeContactFlowModule. See example below which uses jq to extract the content attribute and saves it to a local file.

Example Usage

Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.connectContactFlowModule.ConnectContactFlowModule(this, "example", {
  content:
    '${jsonencode({\n    Version     = "2019-10-30"\n    StartAction = "12345678-1234-1234-1234-123456789012"\n    Actions = [\n      {\n        Identifier = "12345678-1234-1234-1234-123456789012"\n\n        Parameters = {\n          Text = "Hello contact flow module"\n        }\n\n        Transitions = {\n          NextAction = "abcdef-abcd-abcd-abcd-abcdefghijkl"\n          Errors     = []\n          Conditions = []\n        }\n\n        Type = "MessageParticipant"\n      },\n      {\n        Identifier  = "abcdef-abcd-abcd-abcd-abcdefghijkl"\n        Type        = "DisconnectParticipant"\n        Parameters  = {}\n        Transitions = {}\n      }\n    ]\n    Settings = {\n      InputParameters  = []\n      OutputParameters = []\n      Transitions = [\n        {\n          DisplayName   = "Success"\n          ReferenceName = "Success"\n          Description   = ""\n        },\n        {\n          DisplayName   = "Error"\n          ReferenceName = "Error"\n          Description   = ""\n        }\n      ]\n    }\n  })}',
  description: "Example Contact Flow Module Description",
  instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
  name: "Example",
  tags: {
    Application: "Terraform",
    Method: "Create",
    Name: "Example Contact Flow Module",
  },
});

With External Content

Use the AWS CLI to extract Contact Flow Content:

$ aws connect describe-contact-flow-module --instance-id 1b3c5d8-1b3c-1b3c-1b3c-1b3c5d81b3c5 --contact-flow-module-id c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5 --region us-west-2 | jq '.ContactFlowModule.Content | fromjson' > contact_flow_module.json

Use the generated file as input:

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.connectContactFlowModule.ConnectContactFlowModule(this, "example", {
  contentHash: '${filebase64sha256("contact_flow_module.json")}',
  description: "Example Contact Flow Module Description",
  filename: "contact_flow_module.json",
  instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
  name: "Example",
  tags: {
    Application: "Terraform",
    Method: "Create",
    Name: "Example Contact Flow Module",
  },
});

Argument Reference

The following arguments are supported:

  • content - (Optional) Specifies the content of the Contact Flow Module, provided as a JSON string, written in Amazon Connect Contact Flow Language. If defined, the filename argument cannot be used.
  • contentHash - (Optional) Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the Contact Flow Module source specified with filename. The usual way to set this is filebase64sha256("contact_flow_module.json") (Terraform 0.11.12 and later) or base64sha256(file("contact_flow_module.json")) (Terraform 0.11.11 and earlier), where "contact_flow_module.json" is the local filename of the Contact Flow Module source.
  • description - (Optional) Specifies the description of the Contact Flow Module.
  • filename - (Optional) The path to the Contact Flow Module source within the local filesystem. Conflicts with content.
  • instanceId - (Required) Specifies the identifier of the hosting Amazon Connect Instance.
  • name - (Required) Specifies the name of the Contact Flow Module.
  • tags - (Optional) Tags to apply to the Contact Flow Module. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The Amazon Resource Name (ARN) of the Contact Flow Module.
  • id - The identifier of the hosting Amazon Connect Instance and identifier of the Contact Flow Module separated by a colon (:).
  • contactFlowModuleId - The identifier of the Contact Flow Module.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Amazon Connect Contact Flow Modules can be imported using the instanceId and contactFlowModuleId separated by a colon (:), e.g.,

$ terraform import aws_connect_contact_flow_module.example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5