Create AWS Connect Contact flow using CLI - amazon-web-services

I am trying to create a contact flow in my connect instance and keep getting the following issue when trying to use the AWS CLI.
An error occurred (InvalidRequestException) when calling the CreateContactFlow operation: Invalid request
aws connect create-contact-flow --instance-id b835bc8c-7c26-4f26-a471-16b806ccf1a2 --name jenkinsTest --type CONTACT_FLOW --content "{\"Version\":\"2019-10-30\",\"StartAction\":\"1a34ecf3-77ff-46a7-b210-38a1a980127b\",\"Metadata\":{\"entryPointPosition\":{\"x\":75,\"y\":20},\"snapToGrid\":false,\"ActionMetadata\":{\"1a34ecf3-77ff-46a7-b210-38a1a980127b\":{\"position\":{\"x\":258,\"y\":66},\"audio\":[{\"type\":\"Text\",\"tts\":\"<speak>You are on hold <break time=\\\"10s\\\"/></speak>\",\"$$hashKey\":\"01J\",\"ttsType\":\"ssml\"}],\"timeoutUnit\":{\"display\":\"Minutes\",\"value\":\"min\"}}}},\"Actions\":[{\"Identifier\":\"1a34ecf3-77ff-46a7-b210-38a1a980127b\",\"Parameters\":{\"Messages\":[{\"SSML\":\"<speak>You are on hold <break time=\\\"10s\\\"/></speak>\"}]},\"Transitions\":{\"Errors\":[],\"Conditions\":[]},\"Type\":\"MessageParticipantIteratively\"}]}"
I am using the above CLI command. Can Any one help me to figure out this error?
MigrateContactFlows API reference

Related

Not able to Create Contact flow with lex bot

Trying to migrate contact flow from one instance to other able to migrate simple flow but issue is when I tried with lex bot not able to migrate contact flow.
aws connect describe-contact-flow --instance-id <value> --contact-flow-id <value> --region us-east-1
aws connect create-contact-flow --instance-id <value> --name test_flow --type AGENT_TRANSFER --region 'us-east-1' --content "{\"Version\":\"2019-10-30\",\"StartAction\":\"cd60c6aa-6229-4a47-81ae-bef78a528590\",\"Metadata\":{\"entryPointPosition\":{\"x\":15,\"y\":23.99998474121091},\"snapToGrid\":false,\"ActionMetadata\":{\"bbb8a214-1f5c-4534-bfe5-6bf5f0aab9a0\":{\"position\":{\"x\":685,\"y\":132}},\"d76376f8-9b97-42dc-8b96-60167fd5f7a2\":{\"position\":{\"x\":351,\"y\":15}},\"cd60c6aa-6229-4a47-81ae-bef78a528590\":{\"position\":{\"x\":194,\"y\":197.3333282470703},\"useDynamic\":false},\"e36919ca-8fe7-4797-8c7e-6524acd838f8\":{\"position\":{\"x\":446,\"y\":208},\"conditionMetadata\":[],\"useDynamic\":false,\"dynamicMetadata\":{},\"useLexBotDropdown\":true,\"useDynamicLexBotArn\":false,\"lexV2BotName\":\"jenkinsbooktrip\"}}},\"Actions\":[{\"Identifier\":\"bbb8a214-1f5c-4534-bfe5-6bf5f0aab9a0\",\"Type\":\"DisconnectParticipant\",\"Parameters\":{},\"Transitions\":{}},{\"Identifier\":\"d76376f8-9b97-42dc-8b96-60167fd5f7a2\",\"Parameters\":{\"FlowLoggingBehavior\":\"Enabled\"},\"Transitions\":{\"NextAction\":\"bbb8a214-1f5c-4534-bfe5-6bf5f0aab9a0\",\"Errors\":[],\"Conditions\":[]},\"Type\":\"UpdateFlowLoggingBehavior\"},{\"Identifier\":\"cd60c6aa-6229-4a47-81ae-bef78a528590\",\"Parameters\":{\"Text\":\"hi welcome\"},\"Transitions\":{\"NextAction\":\"e36919ca-8fe7-4797-8c7e-6524acd838f8\",\"Errors\":[],\"Conditions\":[]},\"Type\":\"MessageParticipant\"},{\"Identifier\":\"e36919ca-8fe7-4797-8c7e-6524acd838f8\",\"Parameters\":{\"Text\":\"welcome\",\"LexBot\":{\"Name\":\"jenkinsbooktrip\",\"Region\":\"us-east-1\",\"Alias\":\"$LATEST\"}},\"Transitions\":{\"NextAction\":\"bbb8a214-1f5c-4534-bfe5-6bf5f0aab9a0\",\"Errors\":[{\"NextAction\":\"bbb8a214-1f5c-4534-bfe5-6bf5f0aab9a0\",\"ErrorType\":\"NoMatchingError\"},{\"NextAction\":\"d76376f8-9b97-42dc-8b96-60167fd5f7a2\",\"ErrorType\":\"NoMatchingCondition\"}],\"Conditions\":[]},\"Type\":\"ConnectParticipantWithLexBot\"}]}"
An error occurred (InvalidContactFlowException) when calling the CreateContactFlow operation: None,
when trying without lex parameter it working fine able to create but with lex its through an error I am using aws cli command
I have had the same issue generally with connect. When the content is less than ~1500-2000 characters, the Api works perfectly. Once the contact flow content grows beyond that, you start getting those errors.
Yes that's right need to skip $ symbol and it will work fine.

Unable to add bulk contacts in AWS SES using cli

I am trying to run a simple command from aws documentation to upload the contacts.csv from S3 bucket to SES, while trying to do so, am constantly getting the error:
An error occurred (InternalFailure) when calling the CreateImportJob operation (reached max retries: 15): None
I have awscli 2.1.38 installed
The command I have used to transfer bulk contacts from an S3 bucket object to SES from documentation is:
aws sesv2 create-import-job \
--import-destination "{\"ContactListDestination\": {\"ContactListName\":\"ExampleContactListName\", \"ContactListImportAction\":\"PUT\"}}" \
--import-data-source "{\"S3Url\": \"s3://wwsexampletest/email-test\",\"DataFormat\": \"CSV\"}" --profile sameer```
Let me know, if you can run this command in your account. FYI, my SES is out of Sandbox.

aws emr cli failed for InvalidRequestException

I was able to run the create-cluster cli successfully and launched my EMR cluster, but when I tried to run below command to add a step:
aws emr add-steps --cluster-id j-your-cluster-id --steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,Args=arg1,arg2,arg3 Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,MainClass=mymainclass,Args=arg1,arg2,arg3 --profile my-test-account
it failed with this error:
An error occurred (InvalidRequestException) when calling the DescribeCluster operation: Cluster id 'j-your-cluster-id' is not valid.
and I've double checked j-your-cluster-id is matching my cluster-id exactly.
I feel like this is a permission issue, but how come the same profile could let me create a cluster, but cannot let me describe it?
How can I dig further and fix this please?
Based on the comments.
The issue was caused by execution AWS CLI in different region than intended. The solution was to use --region option to provide correct region for the CLI.

aws kops create cluster errors out as InvalidClientTokenId

I am actually trying to deploy my application using Kubernetes in the AWS Kops. For this i followed the steps given in the AWS workshop tutorial.
https://github.com/aws-samples/aws-workshop-for-kubernetes/tree/master/01-path-basics/101-start-here
I created a AWS Cloud9 environment by logging in as a IAM user and installed kops and other required software's as well. When i try to create the cluster using the following command
kops create cluster --name cs.cluster.k8s.local --zones $AWS_AVAILABILITY_ZONES
--yes
i get an error like below in the cloud9 IDE
error running tasks: deadline exceeded executing task IAMRole/nodes.cs.cluster.k8s.local. Example error: error creating IAMRole: InvalidClientTokenId: The security token included in the request is invalid
status code: 403, request id: 30fe2a97-0fc4-11e8-8c48-0f8441e73bc3
I am not able to find a way to solve this issue. Any help on this would be appreciable.
I found the issue and fixed it. Actually
I did not export the following 2 environment variables in the terminal where I am running create cluster. These 2 below variables are required while creating a cluster using kops
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)

aws ec2 describe-instances command not working

I am executing the following command
aws ec2 describe-instances
The error that i am getting is:
Could not connect to the endpoint URL: "https://ec2.us-west-2.amazonaws.com/"
I tried this link in my browser and it was working fine. Actually i am completely new to AWS cli and i am trying to stop, start my instances using AWS cli.
I have used the command aws configure and then provided my access key and secret key. In the region i have entered us-west-2 and output as json.