Skip to main content

accounts

Creates, updates, deletes, gets or lists a accounts resource.

Overview

Nameaccounts
TypeResource
Idsnowflake.account.accounts

Fields

NameDatatypeDescription
namestringA 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.
account_locatorstringSystem-assigned identifier of the acccount.
account_locator_urlstringLegacy Snowflake account URL syntax that includes the region_name and account_locator.
account_old_url_last_usedstringIf 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_onstringIf the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved.
account_urlstringPreferred Snowflake account URL that includes the values of organization_name and account_name.
admin_namestringName of the account administrator.
admin_passwordstringPassword for the account administrator.
admin_rsa_public_keystringRSA public key for the account administrator.
admin_user_typestringUser type of the account administrator.
commentstringOptional comment in which to store information related to the account.
consumption_billing_entity_namestringName of the consumption billing entity.
created_onstringDate and time the account was created.
dropped_onstringDate and time the account was dropped.
editionstringSnowflake Edition of the account.
emailstringEmail address of the account administrator.
first_namestringFirst name of the account administrator.
is_events_accountbooleanIndicates whether an account is an events account. For more information, see Set up logging and event sharing for an application.
is_org_adminbooleanIndicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled.
last_namestringLast name of the account administrator.
managed_accountsintegerIndicates how many managed accounts have been created by the account.
marketplace_consumer_billing_entity_namestringName of the marketplace consumer billing entity.
marketplace_provider_billing_entity_namestringName of the marketplace provider billing entity.
moved_onstringDate and time when the account was moved to a different organization.
moved_to_organizationstringIf the account was moved to a different organization, provides the name of that organization.
must_change_passwordbooleanIndicates whether the account administrator must change the password at the next login.
old_account_urlstringIf 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_onstringIf 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_namestringName of the organization.
organization_old_urlstringIf 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_usedstringIf 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_onstringIf 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.
polarisbooleanIndicates whether the account is a Polaris account.
regionstringSnowflake 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_groupstringRegion group where the account is located. Note - This column is only displayed for organizations that span multiple region groups.
restored_onstringDate and time when the account was last restored.
retention_timeintegerNumber of days that historical data is retained for Time Travel.
scheduled_deletion_timestringDate and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time.

Methods

NameAccessible byRequired ParamsDescription
list_accountsSELECTendpointLists the accessible accounts.
create_accountINSERTdata__admin_name, data__edition, data__email, data__name, endpointCreates a account. You must provide the full account definition when creating a account.
delete_accountDELETEgracePeriodInDays, name, endpointDeletes 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_accountEXECname, endpointRestores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period).

SELECT examples

Lists the accessible accounts.

SELECT
name,
account_locator,
account_locator_url,
account_old_url_last_used,
account_old_url_saved_on,
account_url,
admin_name,
admin_password,
admin_rsa_public_key,
admin_user_type,
comment,
consumption_billing_entity_name,
created_on,
dropped_on,
edition,
email,
first_name,
is_events_account,
is_org_admin,
last_name,
managed_accounts,
marketplace_consumer_billing_entity_name,
marketplace_provider_billing_entity_name,
moved_on,
moved_to_organization,
must_change_password,
old_account_url,
organization_URL_expiration_on,
organization_name,
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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new accounts resource.

/*+ create */
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 }}',
'{{ region_group }}',
'{{ region }}',
'{{ edition }}',
'{{ comment }}',
'{{ admin_name }}',
'{{ admin_password }}',
'{{ admin_rsa_public_key }}',
'{{ admin_user_type }}',
'{{ first_name }}',
'{{ last_name }}',
'{{ email }}',
'{{ must_change_password }}',
'{{ polaris }}',
'{{ endpoint }}'
;

DELETE example

Deletes the specified accounts resource.

/*+ delete */
DELETE FROM snowflake.account.accounts
WHERE gracePeriodInDays = '{{ gracePeriodInDays }}'
AND name = '{{ name }}'
AND endpoint = '{{ endpoint }}';