accounts
Creates, updates, deletes, gets or lists an accounts
resource.
Overview
Name | accounts |
Type | Resource |
Id | snowflake.account.accounts |
Fields
The following fields are returned by SELECT
queries:
- list_accounts
Snowflake account object.
Name | Datatype | Description |
---|---|---|
name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
admin_name | string | Name of the account administrator. |
consumption_billing_entity_name | string | Name of the consumption billing entity. |
first_name | string | First name of the account administrator. |
last_name | string | Last name of the account administrator. |
marketplace_consumer_billing_entity_name | string | Name of the marketplace consumer billing entity. |
marketplace_provider_billing_entity_name | string | Name of the marketplace provider billing entity. |
organization_name | string | Name of the organization. |
account_locator | string | System-assigned identifier of the acccount. |
account_locator_url | string | Legacy Snowflake account URL syntax that includes the region_name and account_locator. |
account_old_url_last_used | string (date-time) | If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL. |
account_old_url_saved_on | string (date-time) | If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved. |
account_url | string | Preferred Snowflake account URL that includes the values of organization_name and account_name. |
admin_password | string (password) | Password for the account administrator. |
admin_rsa_public_key | string (password) | RSA public key for the account administrator. |
admin_user_type | string | User type of the account administrator. |
comment | string | Optional comment in which to store information related to the account. |
created_on | string (date-time) | Date and time the account was created. |
dropped_on | string (date-time) | Date and time the account was dropped. |
edition | string | Snowflake Edition of the account. |
email | string | Email address of the account administrator. |
is_events_account | boolean | Indicates whether an account is an events account. For more information, see Set up logging and event sharing for an application. |
is_org_admin | boolean | Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. |
managed_accounts | integer (int64) | Indicates how many managed accounts have been created by the account. |
moved_on | string (date-time) | Date and time when the account was moved to a different organization. |
moved_to_organization | string | If the account was moved to a different organization, provides the name of that organization. |
must_change_password | boolean | Indicates whether the account administrator must change the password at the next login. |
old_account_url | string | If the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed |
organization_URL_expiration_on | string (date-time) | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account. |
organization_old_url | string | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed. |
organization_old_url_last_used | string (date-time) | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL. |
organization_old_url_saved_on | string (date-time) | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved. |
polaris | boolean | Indicates whether the account is a Polaris account. |
region | string | Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). |
region_group | string | Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. |
restored_on | string (date-time) | Date and time when the account was last restored. |
retention_time | integer | Number of days that historical data is retained for Time Travel. |
scheduled_deletion_time | string (date-time) | Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_accounts | select | endpoint | like , showLimit , history | Lists the accessible accounts. |
create_account | insert | endpoint | Creates a account. You must provide the full account definition when creating a account. | |
delete_account | delete | name , gracePeriodInDays , endpoint | ifExists | Deletes the specified account. If you enable the ifExists parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful. |
undrop_account | exec | name , endpoint | Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). |
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 |
---|---|---|
endpoint | string | Organization and Account Name (default: orgid-acctid) |
gracePeriodInDays | integer | Specifies the number of days during which the account can be restored (“undropped”). The minimum is 3 days and the maximum is 90 days. |
name | string | Identifier (i.e. name) for the resource. |
history | boolean | Optionally includes dropped accounts that have not yet been purged. |
ifExists | boolean | Query parameter that specifies how to handle the request for a resource that does not exist: - true : The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false : The endpoint throws an error if the resource doesn't exist. |
like | string | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. |
showLimit | integer | Query parameter to limit the maximum number of rows returned by a command. |
SELECT
examples
- list_accounts
Lists the accessible accounts.
SELECT
name,
admin_name,
consumption_billing_entity_name,
first_name,
last_name,
marketplace_consumer_billing_entity_name,
marketplace_provider_billing_entity_name,
organization_name,
account_locator,
account_locator_url,
account_old_url_last_used,
account_old_url_saved_on,
account_url,
admin_password,
admin_rsa_public_key,
admin_user_type,
comment,
created_on,
dropped_on,
edition,
email,
is_events_account,
is_org_admin,
managed_accounts,
moved_on,
moved_to_organization,
must_change_password,
old_account_url,
organization_URL_expiration_on,
organization_old_url,
organization_old_url_last_used,
organization_old_url_saved_on,
polaris,
region,
region_group,
restored_on,
retention_time,
scheduled_deletion_time
FROM snowflake.account.accounts
WHERE endpoint = '{{ endpoint }}' -- required
AND like = '{{ like }}'
AND showLimit = '{{ showLimit }}'
AND history = '{{ history }}';
INSERT
examples
- create_account
- Manifest
Creates a account. You must provide the full account definition when creating a account.
INSERT INTO snowflake.account.accounts (
data__name,
data__region_group,
data__region,
data__edition,
data__comment,
data__admin_name,
data__admin_password,
data__admin_rsa_public_key,
data__admin_user_type,
data__first_name,
data__last_name,
data__email,
data__must_change_password,
data__polaris,
endpoint
)
SELECT
'{{ name }}' --required,
'{{ region_group }}',
'{{ region }}',
'{{ edition }}' --required,
'{{ comment }}',
'{{ admin_name }}' --required,
'{{ admin_password }}',
'{{ admin_rsa_public_key }}',
'{{ admin_user_type }}',
'{{ first_name }}',
'{{ last_name }}',
'{{ email }}' --required,
{{ must_change_password }},
{{ polaris }},
'{{ endpoint }}'
;
# Description fields are for documentation purposes
- name: accounts
props:
- name: endpoint
value: string
description: Required parameter for the accounts resource.
- name: name
value: string
description: >
A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
- name: region_group
value: string
description: >
Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups.
- name: region
value: string
description: >
Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account).
- name: edition
value: string
description: >
Snowflake Edition of the account.
valid_values: ['STANDARD', 'ENTERPRISE', 'BUSINESS_CRITICAL']
- name: comment
value: string
description: >
Optional comment in which to store information related to the account.
- name: admin_name
value: string
description: >
Name of the account administrator.
- name: admin_password
value: string
description: >
Password for the account administrator.
- name: admin_rsa_public_key
value: string
description: >
RSA public key for the account administrator.
- name: admin_user_type
value: string
description: >
User type of the account administrator.
- name: first_name
value: string
description: >
First name of the account administrator.
- name: last_name
value: string
description: >
Last name of the account administrator.
- name: email
value: string
description: >
Email address of the account administrator.
- name: must_change_password
value: boolean
description: >
Indicates whether the account administrator must change the password at the next login.
default: false
- name: polaris
value: boolean
description: >
Indicates whether the account is a Polaris account.
default: false
DELETE
examples
- delete_account
Deletes the specified account. If you enable the ifExists
parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful.
DELETE FROM snowflake.account.accounts
WHERE name = '{{ name }}' --required
AND gracePeriodInDays = '{{ gracePeriodInDays }}' --required
AND endpoint = '{{ endpoint }}' --required
AND ifExists = '{{ ifExists }}';
Lifecycle Methods
- undrop_account
Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period).
EXEC snowflake.account.accounts.undrop_account
@name='{{ name }}' --required,
@endpoint='{{ endpoint }}' --required;