Skip to main content

phone_numbers

Creates, updates, deletes or gets a phone_number resource or lists phone_numbers in a region

Overview

Namephone_numbers
TypeResource
DescriptionResource Type definition for AWS::Connect::PhoneNumber
Idawscc.connect.phone_numbers

Fields

NameDatatypeDescription
target_arnstringThe ARN of the target the phone number is claimed to.
phone_number_arnstringThe phone number ARN
descriptionstringThe description of the phone number.
typestringThe phone number type
country_codestringThe phone number country code.
prefixstringThe phone number prefix.
addressstringThe phone number e164 address.
tagsarrayOne or more tags.
source_phone_number_arnstringThe source phone number arn.
regionstringAWS region.

For more information, see AWS::Connect::PhoneNumber.

Methods

NameResourceAccessible byRequired Params
create_resourcephone_numbersINSERTTargetArn, region
delete_resourcephone_numbersDELETEIdentifier, region
update_resourcephone_numbersUPDATEIdentifier, PatchDocument, region
list_resourcesphone_numbers_list_onlySELECTregion
get_resourcephone_numbersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual phone_number.

SELECT
region,
target_arn,
phone_number_arn,
description,
type,
country_code,
prefix,
address,
tags,
source_phone_number_arn
FROM awscc.connect.phone_numbers
WHERE
region = '{{ region }}' AND
Identifier = '{{ phone_number_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new phone_number resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.connect.phone_numbers (
TargetArn,
region
)
SELECT
'{{ target_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a phone_number resource, using stack-deploy.

/*+ update */
UPDATE awscc.connect.phone_numbers
SET PatchDocument = string('{{ {
"TargetArn": target_arn,
"Description": description,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ phone_number_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.connect.phone_numbers
WHERE
Identifier = '{{ phone_number_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the phone_numbers resource, the following permissions are required:

connect:ClaimPhoneNumber,
connect:SearchAvailablePhoneNumbers,
connect:DescribePhoneNumber,
connect:TagResource,
connect:ImportPhoneNumber,
sms-voice:DescribePhoneNumbers,
social-messaging:GetLinkedWhatsAppBusinessAccountPhoneNumber,
social-messaging:TagResource