Skip to content
GitHubXDiscord

PhoneNumber

The PhoneNumber resource allows you to manage AWS Connect PhoneNumbers for your Amazon Connect instances, enabling you to assign phone numbers to your contact center for handling communications.

Create a basic phone number with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const basicPhoneNumber = await AWS.Connect.PhoneNumber("basicPhoneNumber", {
TargetArn: "arn:aws:connect:us-west-2:123456789012:instance/abcdefgh-ijkl-mnop-qrst-uvwxyz123456",
Type: "TOLL_FREE",
Description: "Basic toll-free number for customer support"
});

Configure a phone number with additional optional settings such as prefix and country code.

const advancedPhoneNumber = await AWS.Connect.PhoneNumber("advancedPhoneNumber", {
TargetArn: "arn:aws:connect:us-west-2:123456789012:instance/abcdefgh-ijkl-mnop-qrst-uvwxyz123456",
Type: "DIRECT_DIAL",
Description: "Direct dial number for sales department",
Prefix: "+1",
CountryCode: "US"
});

Adopt an existing phone number instead of failing when it already exists.

const adoptExistingPhoneNumber = await AWS.Connect.PhoneNumber("adoptExistingPhoneNumber", {
TargetArn: "arn:aws:connect:us-west-2:123456789012:instance/abcdefgh-ijkl-mnop-qrst-uvwxyz123456",
Type: "TOLL_FREE",
Description: "Adopting existing toll-free number",
adopt: true
});

Create a phone number with tags for better resource organization.

const taggedPhoneNumber = await AWS.Connect.PhoneNumber("taggedPhoneNumber", {
TargetArn: "arn:aws:connect:us-west-2:123456789012:instance/abcdefgh-ijkl-mnop-qrst-uvwxyz123456",
Type: "DIRECT_DIAL",
Description: "Tagged number for marketing team",
Tags: [
{ Key: "Department", Value: "Marketing" },
{ Key: "Environment", Value: "Production" }
]
});