hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.8k stars 9.15k forks source link

[New Data Source]: Amazon Connect Instance Phone Numbers #27394

Open schuylr opened 1 year ago

schuylr commented 1 year ago

Description

The porting process for getting existing numbers into Amazon Connect will have phone numbers externally provisioned into the Amazon Connect instance without flows being associated with them. Since porting requests can be done in batches of potentially 25 numbers at a time, it can be difficult to do a terraform import one by one for each phone number by the phone number ID. It will be ideal to use Terraform definitions to set up the associated contact flows to the provisioned phone numbers in the Amazon Connect instance.

This data source proposes to simplify the process for Terraform operators in order to get all provisioned phone numbers on the Connect instance using familiar mechanisms so they can generate appropriate HCL and run terraform import commands.

Requested Resource(s) and/or Data Source(s)

aws_connect_instance_phone_number aws_connect_instance_phone_numbers

Potential Terraform Configuration

resource "aws_connect_instance" "test" {
  identity_management_type = "CONNECT_MANAGED"
  inbound_calls_enabled    = true
  instance_alias           = "friendly-name-connect"
  outbound_calls_enabled   = true
}

data source "aws_connect_instance_phone_numbers" "test" {
  phone_number_country_codes = ["US", "CA"]
  phone_number_prefix        = "+1555"
  phone_number_types         = ["DID", "TOLL_FREE"]
  target_arn                 = aws_connect_instance.test.arn
}

data source "aws_connect_instance_phone_number" "test" {
  id = aws_connect_instance_phone_numbers.test[0].id
}

References

https://docs.aws.amazon.com/connect/latest/adminguide/about-porting.html#step4-porting https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html

Would you like to implement a fix?

Yes

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 4 days ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!