managed_accounts
Creates, updates, deletes, gets or lists a managed_accounts resource.
Overview
| Name | managed_accounts |
| Type | Resource |
| Id | snowflake.account.managed_accounts |
Fields
The following fields are returned by SELECT queries:
- list
Snowflake account object.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the account. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
admin_name | string | Name of the account administrator. |
account_locator_url | string | Account URL that is used to connect to the account, in the legacy account locator format. |
account_type | string | Type of the account. (READER) (default: READER) |
admin_password | string (password) | Password for the account administrator. |
cloud | string | Cloud in which the managed account is located. For reader accounts, this is always the same as the cloud for the provider account. |
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. |
locator | string | Legacy identifier for the account. |
region | string | Region in which the managed account is located. For reader accounts, this is always the same as the region for the provider account. |
url | string | Account 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | endpoint | like | Lists the accessible managed accounts. |
create | insert | endpoint, name, admin_name, admin_password, account_type | Creates a managed account. You must provide the full managed account definition when creating a managed account. | |
delete | delete | name, endpoint | 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. |
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 identifier (orgname-accountname) (default: orgname-accountname) |
name | string | Identifier (i.e. name) for the resource. |
like | string | Parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. |
SELECT examples
- list
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.account.managed_accounts
WHERE endpoint = '{{ endpoint }}' -- required
AND "like" = '{{ like }}'
;
INSERT examples
- create
- Manifest
Creates a managed account. You must provide the full managed account definition when creating a managed account.
INSERT INTO snowflake.account.managed_accounts (
name,
comment,
admin_name,
admin_password,
account_type,
endpoint
)
SELECT
'{{ name }}' /* required */,
'{{ comment }}',
'{{ admin_name }}' /* required */,
'{{ admin_password }}' /* required */,
'{{ account_type }}' /* required */,
'{{ endpoint }}'
RETURNING
status
;
# Description fields are for documentation purposes
- name: managed_accounts
props:
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the managed_accounts resource.
- name: name
value: "{{ name }}"
description: |
Name of the account.
- name: comment
value: "{{ comment }}"
description: |
Optional comment in which to store information related to the account.
- name: admin_name
value: "{{ admin_name }}"
description: |
Name of the account administrator.
- name: admin_password
value: "{{ admin_password }}"
description: |
Password for the account administrator.
- name: account_type
value: "{{ account_type }}"
description: |
Type of the account.
valid_values: ['READER']
default: READER
DELETE examples
- delete
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.account.managed_accounts
WHERE name = '{{ name }}' --required
AND endpoint = '{{ endpoint }}' --required
;