Skip to main content

managed_accounts

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

Overview

Namemanaged_accounts
TypeResource
Idsnowflake.managed_account.managed_accounts

Fields

The following fields are returned by SELECT queries:

Snowflake account object.

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. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
admin_namestringName of the account administrator.
account_locator_urlstringAccount URL that is used to connect to the account, in the legacy account locator format.
account_typestringType of the account. (default: READER)
admin_passwordstring (password)Password for the account administrator.
cloudstringCloud in which the managed account is located. For reader accounts, this is always the same as the cloud for the provider account.
commentstringOptional comment in which to store information related to the account.
created_onstring (date-time)Date and time the account was created.
locatorstringLegacy identifier for the account.
regionstringRegion in which the managed account is located. For reader accounts, this is always the same as the region for the provider account.
urlstringAccount URL that is used to connect to the account, in the account name format. The account identifier in this format follows the pattern <orgname>-<account_name>.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_managed_accountsselectendpointlikeLists the accessible managed accounts.
create_managed_accountinsertendpointCreates a managed account. You must provide the full managed account definition when creating a managed account.
delete_managed_accountdeletename, endpointRemoves a managed account, including all objects created in the account, and immediately restricts access to the account. Currently used by data providers to create reader accounts for their consumers. For more details, see Manage reader accounts.

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.

NameDatatypeDescription
endpointstringOrganization and Account Name (default: orgid-acctid)
namestringIdentifier (i.e. name) for the resource.
likestringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.

SELECT examples

Lists the accessible managed accounts.

SELECT
name,
admin_name,
account_locator_url,
account_type,
admin_password,
cloud,
comment,
created_on,
locator,
region,
url
FROM snowflake.managed_account.managed_accounts
WHERE endpoint = '{{ endpoint }}' -- required
AND like = '{{ like }}';

INSERT examples

Creates a managed account. You must provide the full managed account definition when creating a managed account.

INSERT INTO snowflake.managed_account.managed_accounts (
data__name,
data__comment,
data__admin_name,
data__admin_password,
data__account_type,
endpoint
)
SELECT
'{{ name }}' --required,
'{{ comment }}',
'{{ admin_name }}' --required,
'{{ admin_password }}' --required,
'{{ account_type }}' --required,
'{{ endpoint }}'
;

DELETE examples

Removes a managed account, including all objects created in the account, and immediately restricts access to the account. Currently used by data providers to create reader accounts for their consumers. For more details, see Manage reader accounts.

DELETE FROM snowflake.managed_account.managed_accounts
WHERE name = '{{ name }}' --required
AND endpoint = '{{ endpoint }}' --required;