phone_numbers
Creates, updates, deletes, gets or lists a phone_numbers resource.
Overview
| Name | phone_numbers |
| Type | Resource |
| Id | aws.chime_sdk_voice.phone_numbers |
Fields
The following fields are returned by SELECT queries:
- get_phone_number
- list_phone_numbers
| Name | Datatype | Description |
|---|---|---|
associations | array | The phone number's associations. |
calling_name | string | The outbound calling name associated with the phone number. (pattern: <code>^$|^[a-zA-Z0-9 ]{2,15}$</code>) |
calling_name_status | string | The outbound calling name status. (Unassigned, UpdateInProgress, UpdateSucceeded, UpdateFailed) |
capabilities | object | The phone number's capabilities. |
country | string | The phone number's country. Format: ISO 3166-1 alpha-2. (pattern: <code>[A-Z]{2}</code>) |
created_timestamp | string (date-time) | The phone number creation timestamp, in ISO 8601 format. |
deletion_timestamp | string (date-time) | The deleted phone number timestamp, in ISO 8601 format. |
e164_phone_number | string | The phone number, in E.164 format. (pattern: <code>^+?[1-9]\d{1,14}$</code>) |
name | string | The name of the phone number. (pattern: <code>^$|^[a-zA-Z0-9,._-]+(\s+[a-zA-Z0-9,._-]+)*$</code>) |
order_id | string | The phone number's order ID. (pattern: <code>[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}</code>) |
phone_number_arn | string | (pattern: <code>.\S.</code>) |
phone_number_id | string | The phone number's ID. (pattern: <code>.\S.</code>) |
product_type | string | The phone number's product type. (VoiceConnector, SipMediaApplicationDialIn) |
status | string | The phone number's status. (Cancelled, PortinCancelRequested, PortinInProgress, AcquireInProgress, AcquireFailed, Unassigned, Assigned, ReleaseInProgress, DeleteInProgress, ReleaseFailed, DeleteFailed) |
type | string | The phone number's type. (Local, TollFree) |
updated_timestamp | string (date-time) | The updated phone number timestamp, in ISO 8601 format. |
| Name | Datatype | Description |
|---|---|---|
next_token | string | The token used to return the next page of results. |
phone_numbers | array | The phone number details. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_phone_number | select | phone_number_id, region | Retrieves details for the specified phone number ID, such as associations, capabilities, and product type. | |
list_phone_numbers | select | region | status, product-type, filter-name, filter-value, max-results, next-token | Lists the phone numbers for the specified Amazon Chime SDK account, Amazon Chime SDK user, Amazon Chime SDK Voice Connector, or Amazon Chime SDK Voice Connector group. |
update_phone_number | update | phone_number_id, region | Updates phone number details, such as product type, calling name, or phone number name for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type, calling name, or phone number name in one action. For numbers outside the U.S., you must use the Amazon Chime SDK SIP Media Application Dial-In product type. Updates to outbound calling names can take 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update. | |
delete_phone_number | delete | phone_number_id, region | Moves the specified phone number into the Deletion queue. A phone number must be disassociated from any users or Amazon Chime SDK Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue queue for 7 days before they are deleted permanently. | |
batch_delete_phone_number | exec | region, PhoneNumberIds | Moves phone numbers into the Deletion queue. Phone numbers must be disassociated from any users or Amazon Chime SDK Voice Connectors before they can be deleted. Phone numbers remain in the Deletion queue for 7 days before they are deleted permanently. | |
restore_phone_number | exec | phone_number_id, region | Restores a deleted phone number. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
phone_number_id | string | The ID of the phone number being restored. |
region | string | AWS region (default: us-east-1) |
filter-name | string | The filter to limit the number of results. |
filter-value | string | The filter value. |
max-results | integer | The maximum number of results to return in a single call. |
next-token | string | The token used to return the next page of results. |
product-type | string | The phone number product types. |
status | string | The status of your organization's phone numbers. |
SELECT examples
- get_phone_number
- list_phone_numbers
Retrieves details for the specified phone number ID, such as associations, capabilities, and product type.
SELECT
associations,
calling_name,
calling_name_status,
capabilities,
country,
created_timestamp,
deletion_timestamp,
e164_phone_number,
name,
order_id,
phone_number_arn,
phone_number_id,
product_type,
status,
type,
updated_timestamp
FROM aws.chime_sdk_voice.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the phone numbers for the specified Amazon Chime SDK account, Amazon Chime SDK user, Amazon Chime SDK Voice Connector, or Amazon Chime SDK Voice Connector group.
SELECT
next_token,
phone_numbers
FROM aws.chime_sdk_voice.phone_numbers
WHERE region = '{{ region }}' -- required
AND status = '{{ status }}'
AND `product-type` = '{{ product-type }}'
AND `filter-name` = '{{ filter-name }}'
AND `filter-value` = '{{ filter-value }}'
AND `max-results` = '{{ max-results }}'
AND `next-token` = '{{ next-token }}'
;
UPDATE examples
- update_phone_number
Updates phone number details, such as product type, calling name, or phone number name for the specified phone number ID. You can update one phone number detail at a time. For example, you can update either the product type, calling name, or phone number name in one action. For numbers outside the U.S., you must use the Amazon Chime SDK SIP Media Application Dial-In product type. Updates to outbound calling names can take 72 hours to complete. Pending updates to outbound calling names must be complete before you can request another update.
UPDATE aws.chime_sdk_voice.phone_numbers
SET
ProductType = '{{ ProductType }}',
CallingName = '{{ CallingName }}',
Name = '{{ Name }}'
WHERE
phone_number_id = '{{ phone_number_id }}' --required
AND region = '{{ region }}' --required
RETURNING
phone_number;
DELETE examples
- delete_phone_number
Moves the specified phone number into the Deletion queue. A phone number must be disassociated from any users or Amazon Chime SDK Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue queue for 7 days before they are deleted permanently.
DELETE FROM aws.chime_sdk_voice.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- batch_delete_phone_number
- restore_phone_number
Moves phone numbers into the Deletion queue. Phone numbers must be disassociated from any users or Amazon Chime SDK Voice Connectors before they can be deleted. Phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.
EXEC aws.chime_sdk_voice.phone_numbers.batch_delete_phone_number
@region='{{ region }}' --required
@@json=
'{
"PhoneNumberIds": "{{ PhoneNumberIds }}"
}'
;
Restores a deleted phone number.
EXEC aws.chime_sdk_voice.phone_numbers.restore_phone_number
@phone_number_id='{{ phone_number_id }}' --required,
@region='{{ region }}' --required
;