Skip to content

How to import json flow using CLI

0

I am trying to import amazon connect flows (after I successfully deployed amazon connect resources: queues, phones, etc) using create-contact-flow. However, it fails with An error occurred (InvalidContactFlowException) when calling the CreateContactFlow operation: probably because the json file contains ARNs from previous amz connect instance (which does not exist).

I don't want and not asking how to import it from UI (dashboard) which imports it somehow and displays warning that some resources were resolved to ones with identical names. I'd like to reach the same effect using cli. Is it possible using cli?

The entire purpose of the JSON flows (so called Connect Flow Language) remains unclear to me and I've been struggling to find a way to automate deployment of the flow. Imagine a big project consisting of tens of Routing profiles, Queues, over fifty flows,... So, what are the use cases of this so called Connect Flow Language? How can I utilise it in case of disaster recovery, for example? How to use inside a CI/CD? Even manual import of, say 50 flows is daunting: a lot of unresolved resources.

Update: Replacing ARNs manually inside json files is out of question.

1 Answer
-1

To import JSON flows using the AWS CLI for Amazon Connect without encountering the InvalidContactFlowException:

  1. Remove or Update ARNs: The JSON file must not contain ARNs from previous instances. Before using create-contact-flow via the CLI, remove or replace these ARNs with ones corresponding to your current environment.

  2. CLI Command for Importing: Use the following command to import your JSON flow:

    aws connect create-contact-flow \
      --instance-id <your-instance-id> \
      --name <flow-name> \
      --type CONTACT_FLOW \
      --content file://path_to_your_json_file.json \
      --description "flow description"
answered a year ago
  • remove or replace these ARNs with ones corresponding to your current environment.

    Really? Are you kidding? Go through 50+ flows and remove and replace? Your smartness strikes me. :-D If I am going to replace everything manually what the f..k do I need the aws connect and entire cloudformation? Plus their Connect Flow Language is as usually undocumented, so can't automate replacing process.

  • Yeah it’s lacking, but more than likely that’s the issue ARN references which do not match the current instance.

    david

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.