- Newest
- Most votes
- Most comments
This link covers an option using for_each: https://developer.hashicorp.com/terraform/language/meta-arguments/for_each
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 } } }
Relevant content
- asked 3 years ago
- asked 3 months ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 22 days ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago