By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Amazon connect quick connect

0

Hi , While creating a AWS quick connect via terraform there is a list of 34 users we need for which we need to create a quick connect resource where the quick_connect type is "USER" . However. this. should be created via Terraform dynamically with help of for_each loop or Count etc. Can someone suggest how we can achieve this , if I can place some variables in variables.tf file like userid arn etc.

Regards Jo

asked 3 years ago372 views
2 Answers
0
profile pictureAWS
answered 2 years ago
0

Create quick connects in Amazon Connect - Amazon Connect https://docs.aws.amazon.com/connect/latest/adminguide/quick-connects.html

UserQuickConnectConfig - Amazon Connect https://docs.aws.amazon.com/connect/latest/APIReference/API_UserQuickConnectConfig.html

Quick connect actions - Amazon Connect https://docs.aws.amazon.com/connect/latest/APIReference/API_UserQuickConnectConfig.html

To create quick connect resources for 34 users using Terraform in Amazon Connect, where the quick_connect type is "USER", you can follow these steps:

-First, ensure you have the AWS provider configured in your Terraform configuration.

-Create a Terraform resource block for each quick connect. Here's an example of how you can structure this: resource "aws_connect_quick_connect" "user_quick_connect" { count = 34 instance_id = "your-connect-instance-id" name = "User Quick Connect ${count.index + 1}" description = "Quick connect for user ${count.index + 1}" quick_connect_config { quick_connect_type = "USER" user_config { user_id = "user-id-${count.index + 1}" } } }

  • Example: We're using the count parameter to create 34 resources. -Replace "your-connect-instance-id" with your actual Amazon Connect instance ID. -The name and description fields use the count.index to create unique names for each quick connect. -The quick_connect_type is set to "USER" as required. -In the user_config, you'll need to provide the actual user IDs. Replace "user-id-${count.index + 1}" with the -appropriate user IDs from your Amazon Connect instance.

-If you have a list of specific user IDs, you can use a for_each loop instead: variable "user_ids" { type = list(string) default = ["user-id-1", "user-id-2", ..., "user-id-34"] }

resource "aws_connect_quick_connect" "user_quick_connect" { for_each = toset(var.user_ids) instance_id = "your-connect-instance-id" name = "User Quick Connect ${each.key}" description = "Quick connect for user ${each.key}" quick_connect_config { quick_connect_type = "USER" user_config { user_id = each.value } } }

AWS
answered 2 months ago

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.

Guidelines for Answering Questions