phone_numbers
Creates, updates, deletes or gets a phone_number resource or lists phone_numbers in a region
Overview
| Name | phone_numbers |
| Type | Resource |
| Description | Resource Type definition for AWS::Connect::PhoneNumber |
| Id | awscc.connect.phone_numbers |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
target_arn | string | The ARN of the target the phone number is claimed to. |
phone_number_arn | string | The phone number ARN |
description | string | The description of the phone number. |
type | string | The phone number type |
country_code | string | The phone number country code. |
prefix | string | The phone number prefix. |
address | string | The phone number e164 address. |
tags | array | One or more tags. |
source_phone_number_arn | string | The source phone number arn. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
phone_number_arn | string | The phone number ARN |
region | string | AWS region. |
For more information, see AWS::Connect::PhoneNumber.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | phone_numbers | INSERT | TargetArn, region |
delete_resource | phone_numbers | DELETE | Identifier, region |
update_resource | phone_numbers | UPDATE | Identifier, PatchDocument, region |
list_resources | phone_numbers_list_only | SELECT | region |
get_resource | phone_numbers | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all phone_numbers in a region.
SELECT
region,
phone_number_arn
FROM awscc.connect.phone_numbers_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new phone_number resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.connect.phone_numbers (
TargetArn,
region
)
SELECT
'{{ target_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.connect.phone_numbers (
TargetArn,
Description,
Type,
CountryCode,
Prefix,
Tags,
SourcePhoneNumberArn,
region
)
SELECT
'{{ target_arn }}',
'{{ description }}',
'{{ type }}',
'{{ country_code }}',
'{{ prefix }}',
'{{ tags }}',
'{{ source_phone_number_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: phone_number
props:
- name: target_arn
value: '{{ target_arn }}'
- name: description
value: '{{ description }}'
- name: type
value: '{{ type }}'
- name: country_code
value: '{{ country_code }}'
- name: prefix
value: '{{ prefix }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: source_phone_number_arn
value: '{{ source_phone_number_arn }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Delete
- Update
- List
connect:ClaimPhoneNumber,
connect:SearchAvailablePhoneNumbers,
connect:DescribePhoneNumber,
connect:TagResource,
connect:ImportPhoneNumber,
sms-voice:DescribePhoneNumbers,
social-messaging:GetLinkedWhatsAppBusinessAccountPhoneNumber,
social-messaging:TagResource
connect:DescribePhoneNumber
connect:ReleasePhoneNumber,
connect:UntagResource
connect:UpdatePhoneNumber,
connect:UpdatePhoneNumberMetadata,
connect:DescribePhoneNumber,
connect:TagResource,
connect:UntagResource
connect:ListPhoneNumbersV2