Skip to content

Resource: awsConnectPhoneNumber

Provides an Amazon Connect Phone Number resource. For more information see Amazon Connect: Getting Started

Example Usage

Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.connectPhoneNumber.ConnectPhoneNumber(this, "example", {
  countryCode: "US",
  tags: {
    hello: "world",
  },
  targetArn: "${aws_connect_instance.example.arn}",
  type: "DID",
});

Description

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.connectPhoneNumber.ConnectPhoneNumber(this, "example", {
  countryCode: "US",
  description: "example description",
  targetArn: "${aws_connect_instance.example.arn}",
  type: "DID",
});

Prefix to filter phone numbers

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.connectPhoneNumber.ConnectPhoneNumber(this, "example", {
  countryCode: "US",
  prefix: "+18005",
  targetArn: "${aws_connect_instance.example.arn}",
  type: "DID",
});

Argument Reference

The following arguments are supported:

  • countryCode - (Required, Forces new resource) The ISO country code. For a list of Valid values, refer to PhoneNumberCountryCode.
  • description - (Optional, Forces new resource) The description of the phone number.
  • prefix - (Optional, Forces new resource) The prefix of the phone number that is used to filter available phone numbers. If provided, it must contain + as part of the country code. Do not specify this argument when importing the resource.
  • tags - (Optional) Tags to apply to the Phone Number. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • targetArn - (Required) The Amazon Resource Name (ARN) for Amazon Connect instances that phone numbers are claimed to.
  • type - (Required, Forces new resource) The type of phone number. Valid Values: TOLL_FREE | did.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The ARN of the phone number.
  • phoneNumber - The phone number. Phone numbers are formatted [+] [countryCode] [subscriberNumberIncludingAreaCode].
  • id - The identifier of the phone number.
  • status - A block that specifies status of the phone number. Documented below.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

status

The status configuration block supports the following attributes:

  • message - The status message.
  • status - The status of the phone number. Valid Values: claimed | IN_PROGRESS | failed.

Timeouts

Configuration options:

  • create - (Default 2M)
  • update - (Default 2M)
  • delete - (Default 2M)

Import

Amazon Connect Phone Numbers can be imported using its id e.g.,

$ terraform import aws_connect_phone_number.example 12345678-abcd-1234-efgh-9876543210ab