phone_numbers
Creates, updates, deletes, gets or lists a phone_numbers resource.
Overview
| Name | phone_numbers |
| Type | Resource |
| Id | aws.chime.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 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 capabilities. |
country | string | The phone number 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>) |
phone_number_id | string | The phone number ID. |
product_type | string | The phone number product type. (BusinessCalling, VoiceConnector, SipMediaApplicationDialIn) |
status | string | The phone number status. (AcquireInProgress, AcquireFailed, Unassigned, Assigned, ReleaseInProgress, DeleteInProgress, ReleaseFailed, DeleteFailed) |
type | string | The phone number 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 to use to retrieve 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 account, Amazon Chime user, Amazon Chime Voice Connector, or Amazon Chime Voice Connector group. |
update_phone_number | update | phone_number_id, region | Updates phone number details, such as product type or calling 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 or the calling name in one action. For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime 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 Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion 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 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 | Moves a phone number from the Deletion queue back into the phone number Inventory. |
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 phone number. |
region | string | AWS region (default: us-east-1) |
filter-name | string | The filter to use to limit the number of results. |
filter-value | string | The value to use for the filter. |
max-results | integer | The maximum number of results to return in a single call. |
next-token | string | The token to use to retrieve the next page of results. |
product-type | string | The phone number product type. |
status | string | The phone number status. |
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,
phone_number_id,
product_type,
status,
type,
updated_timestamp
FROM aws.chime.phone_numbers
WHERE phone_number_id = '{{ phone_number_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the phone numbers for the specified Amazon Chime account, Amazon Chime user, Amazon Chime Voice Connector, or Amazon Chime Voice Connector group.
SELECT
next_token,
phone_numbers
FROM aws.chime.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 or calling 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 or the calling name in one action. For toll-free numbers, you cannot use the Amazon Chime Business Calling product type. For numbers outside the U.S., you must use the Amazon Chime 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.phone_numbers
SET
ProductType = '{{ ProductType }}',
CallingName = '{{ CallingName }}'
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 Voice Connectors before it can be deleted. Deleted phone numbers remain in the Deletion queue for 7 days before they are deleted permanently.
DELETE FROM aws.chime.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 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.phone_numbers.batch_delete_phone_number
@region='{{ region }}' --required
@@json=
'{
"PhoneNumberIds": "{{ PhoneNumberIds }}"
}'
;
Moves a phone number from the Deletion queue back into the phone number Inventory.
EXEC aws.chime.phone_numbers.restore_phone_number
@phone_number_id='{{ phone_number_id }}' --required,
@region='{{ region }}' --required
;