namespaces
Creates, updates, deletes, gets or lists a namespaces resource.
Overview
| Name | namespaces |
| Type | Resource |
| Id | aws.redshift_serverless.namespaces |
Fields
The following fields are returned by SELECT queries:
- get_namespace
- list_namespaces
| Name | Datatype | Description |
|---|---|---|
admin_password_secret_arn | string | The Amazon Resource Name (ARN) for the namespace's admin user credentials secret. |
admin_password_secret_kms_key_id | string | The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. |
admin_username | string | The username of the administrator for the first database created in the namespace. |
catalog_arn | string | The Amazon Resource Name (ARN) of the Glue Data Catalog associated with the namespace enabled with Amazon Redshift federated permissions. |
creation_date | string (date-time) | The date of when the namespace was created. |
db_name | string | The name of the first database created in the namespace. |
default_iam_role_arn | string | The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. |
iam_roles | array | A list of IAM roles to associate with the namespace. |
kms_key_id | string | The ID of the Amazon Web Services Key Management Service key used to encrypt your data. |
lakehouse_registration_status | string | The status of the lakehouse registration for the namespace. Indicates whether the namespace is successfully registered with Amazon Redshift federated permissions. |
log_exports | array | The types of logs the namespace can export. Available export types are User log, Connection log, and User activity log. |
namespace_arn | string | The Amazon Resource Name (ARN) associated with a namespace. |
namespace_id | string | The unique identifier of a namespace. |
namespace_name | string | The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved word. A list of reserved words can be found in Reserved Words in the Amazon Redshift Database Developer Guide. (pattern: <code>^[a-z0-9-]+$</code>) |
s_3_table_publish_status | object | The current Amazon S3 Tables log-publishing status for the namespace. Not returned when S3 Tables publishing has never been configured for the namespace. |
status | string | The status of the namespace. (AVAILABLE, MODIFYING, DELETING) |
| Name | Datatype | Description |
|---|---|---|
admin_password_secret_arn | string | The Amazon Resource Name (ARN) for the namespace's admin user credentials secret. |
admin_password_secret_kms_key_id | string | The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. |
admin_username | string | The username of the administrator for the first database created in the namespace. |
catalog_arn | string | The Amazon Resource Name (ARN) of the Glue Data Catalog associated with the namespace enabled with Amazon Redshift federated permissions. |
creation_date | string (date-time) | The date of when the namespace was created. |
db_name | string | The name of the first database created in the namespace. |
default_iam_role_arn | string | The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. |
iam_roles | array | A list of IAM roles to associate with the namespace. |
kms_key_id | string | The ID of the Amazon Web Services Key Management Service key used to encrypt your data. |
lakehouse_registration_status | string | The status of the lakehouse registration for the namespace. Indicates whether the namespace is successfully registered with Amazon Redshift federated permissions. |
log_exports | array | The types of logs the namespace can export. Available export types are User log, Connection log, and User activity log. |
namespace_arn | string | The Amazon Resource Name (ARN) associated with a namespace. |
namespace_id | string | The unique identifier of a namespace. |
namespace_name | string | The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved word. A list of reserved words can be found in Reserved Words in the Amazon Redshift Database Developer Guide. (pattern: <code>^[a-z0-9-]+$</code>) |
s_3_table_publish_status | object | The current Amazon S3 Tables log-publishing status for the namespace. Not returned when S3 Tables publishing has never been configured for the namespace. |
status | string | The status of the namespace. (AVAILABLE, MODIFYING, DELETING) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_namespace | select | region | Returns information about a namespace in Amazon Redshift Serverless. | |
list_namespaces | select | region | Returns information about a list of specified namespaces. | |
create_namespace | insert | region, namespaceName | Creates a namespace in Amazon Redshift Serverless. | |
update_namespace | update | region, namespaceName | Updates a namespace with the specified settings. Unless required, you can't update multiple parameters in one request. For example, you must specify both adminUsername and adminUserPassword to update either field, but you can't update both kmsKeyId and logExports in a single request. Similarly, an S3 Tables log-publishing update (a request where logDestinationType is s3table) cannot be combined with any other namespace configuration change and must be submitted as its own request. | |
delete_namespace | delete | region | Deletes a namespace from Amazon Redshift Serverless. Before you delete the namespace, you can create a final snapshot that has all of the data within the namespace. | |
restore_from_snapshot | exec | region, namespaceName, workgroupName | Restores a namespace from a snapshot. | |
restore_table_from_snapshot | exec | region, namespaceName, newTableName, snapshotName, sourceDatabaseName, sourceTableName, workgroupName | Restores a table from a snapshot to your Amazon Redshift Serverless instance. You can't use this operation to restore tables with interleaved sort keys. | |
update_lakehouse_configuration | exec | region, namespaceName | Modifies the lakehouse configuration for a namespace. This operation allows you to manage Amazon Redshift federated permissions and Amazon Web Services IAM Identity Center trusted identity propagation. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_namespace
- list_namespaces
Returns information about a namespace in Amazon Redshift Serverless.
SELECT
admin_password_secret_arn,
admin_password_secret_kms_key_id,
admin_username,
catalog_arn,
creation_date,
db_name,
default_iam_role_arn,
iam_roles,
kms_key_id,
lakehouse_registration_status,
log_exports,
namespace_arn,
namespace_id,
namespace_name,
s_3_table_publish_status,
status
FROM aws.redshift_serverless.namespaces
WHERE region = '{{ region }}' -- required
;
Returns information about a list of specified namespaces.
SELECT
admin_password_secret_arn,
admin_password_secret_kms_key_id,
admin_username,
catalog_arn,
creation_date,
db_name,
default_iam_role_arn,
iam_roles,
kms_key_id,
lakehouse_registration_status,
log_exports,
namespace_arn,
namespace_id,
namespace_name,
s_3_table_publish_status,
status
FROM aws.redshift_serverless.namespaces
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_namespace
- Manifest
Creates a namespace in Amazon Redshift Serverless.
INSERT INTO aws.redshift_serverless.namespaces (
adminPasswordSecretKmsKeyId,
adminUserPassword,
adminUsername,
dbName,
defaultIamRoleArn,
iamRoles,
kmsKeyId,
logExports,
manageAdminPassword,
namespaceName,
redshiftIdcApplicationArn,
tags,
region
)
SELECT
'{{ adminPasswordSecretKmsKeyId }}',
'{{ adminUserPassword }}',
'{{ adminUsername }}',
'{{ dbName }}',
'{{ defaultIamRoleArn }}',
'{{ iamRoles }}',
'{{ kmsKeyId }}',
'{{ logExports }}',
{{ manageAdminPassword }},
'{{ namespaceName }}' /* required */,
'{{ redshiftIdcApplicationArn }}',
'{{ tags }}',
'{{ region }}'
RETURNING
namespace
;
# Description fields are for documentation purposes
- name: namespaces
props:
- name: region
value: "{{ region }}"
description: Required parameter for the namespaces resource.
- name: adminPasswordSecretKmsKeyId
value: "{{ adminPasswordSecretKmsKeyId }}"
description: |
The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if manageAdminPassword is true.
- name: adminUserPassword
value: "{{ adminUserPassword }}"
description: |
The password of the administrator for the first database created in the namespace. You can't use adminUserPassword if manageAdminPassword is true.
- name: adminUsername
value: "{{ adminUsername }}"
description: |
The username of the administrator for the first database created in the namespace.
- name: dbName
value: "{{ dbName }}"
description: |
The name of the first database created in the namespace.
- name: defaultIamRoleArn
value: "{{ defaultIamRoleArn }}"
description: |
The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
- name: iamRoles
value:
- "{{ iamRoles }}"
description: |
A list of IAM roles to associate with the namespace.
- name: kmsKeyId
value: "{{ kmsKeyId }}"
description: |
The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
- name: logExports
value:
- "{{ logExports }}"
description: |
The types of logs the namespace can export. Available export types are userlog, connectionlog, and useractivitylog.
- name: manageAdminPassword
value: {{ manageAdminPassword }}
description: |
If true, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use adminUserPassword if manageAdminPassword is true. If manageAdminPassword is false or not set, Amazon Redshift uses adminUserPassword for the admin user account's password.
- name: namespaceName
value: "{{ namespaceName }}"
description: |
The name of the namespace.
- name: redshiftIdcApplicationArn
value: "{{ redshiftIdcApplicationArn }}"
description: |
The ARN for the Redshift application that integrates with IAM Identity Center.
- name: tags
description: |
A list of tag instances.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_namespace
Updates a namespace with the specified settings. Unless required, you can't update multiple parameters in one request. For example, you must specify both adminUsername and adminUserPassword to update either field, but you can't update both kmsKeyId and logExports in a single request. Similarly, an S3 Tables log-publishing update (a request where logDestinationType is s3table) cannot be combined with any other namespace configuration change and must be submitted as its own request.
UPDATE aws.redshift_serverless.namespaces
SET
adminPasswordSecretKmsKeyId = '{{ adminPasswordSecretKmsKeyId }}',
adminUserPassword = '{{ adminUserPassword }}',
adminUsername = '{{ adminUsername }}',
defaultIamRoleArn = '{{ defaultIamRoleArn }}',
iamRoles = '{{ iamRoles }}',
kmsKeyId = '{{ kmsKeyId }}',
logDestinationType = '{{ logDestinationType }}',
logExports = '{{ logExports }}',
manageAdminPassword = {{ manageAdminPassword }},
namespaceName = '{{ namespaceName }}',
s3TableAction = '{{ s3TableAction }}',
s3TableGranularity = '{{ s3TableGranularity }}',
s3TableKmsKeyId = '{{ s3TableKmsKeyId }}',
s3TableNames = '{{ s3TableNames }}'
WHERE
region = '{{ region }}' --required
AND namespaceName = '{{ namespaceName }}' --required
RETURNING
namespace;
DELETE examples
- delete_namespace
Deletes a namespace from Amazon Redshift Serverless. Before you delete the namespace, you can create a final snapshot that has all of the data within the namespace.
DELETE FROM aws.redshift_serverless.namespaces
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- restore_from_snapshot
- restore_table_from_snapshot
- update_lakehouse_configuration
Restores a namespace from a snapshot.
EXEC aws.redshift_serverless.namespaces.restore_from_snapshot
@region='{{ region }}' --required
@@json=
'{
"adminPasswordSecretKmsKeyId": "{{ adminPasswordSecretKmsKeyId }}",
"maintainIntegration": {{ maintainIntegration }},
"manageAdminPassword": {{ manageAdminPassword }},
"namespaceName": "{{ namespaceName }}",
"ownerAccount": "{{ ownerAccount }}",
"snapshotArn": "{{ snapshotArn }}",
"snapshotName": "{{ snapshotName }}",
"workgroupName": "{{ workgroupName }}"
}'
;
Restores a table from a snapshot to your Amazon Redshift Serverless instance. You can't use this operation to restore tables with interleaved sort keys.
EXEC aws.redshift_serverless.namespaces.restore_table_from_snapshot
@region='{{ region }}' --required
@@json=
'{
"activateCaseSensitiveIdentifier": {{ activateCaseSensitiveIdentifier }},
"namespaceName": "{{ namespaceName }}",
"newTableName": "{{ newTableName }}",
"snapshotName": "{{ snapshotName }}",
"sourceDatabaseName": "{{ sourceDatabaseName }}",
"sourceSchemaName": "{{ sourceSchemaName }}",
"sourceTableName": "{{ sourceTableName }}",
"targetDatabaseName": "{{ targetDatabaseName }}",
"targetSchemaName": "{{ targetSchemaName }}",
"workgroupName": "{{ workgroupName }}"
}'
;
Modifies the lakehouse configuration for a namespace. This operation allows you to manage Amazon Redshift federated permissions and Amazon Web Services IAM Identity Center trusted identity propagation.
EXEC aws.redshift_serverless.namespaces.update_lakehouse_configuration
@region='{{ region }}' --required
@@json=
'{
"catalogName": "{{ catalogName }}",
"dryRun": {{ dryRun }},
"lakehouseIdcApplicationArn": "{{ lakehouseIdcApplicationArn }}",
"lakehouseIdcRegistration": "{{ lakehouseIdcRegistration }}",
"lakehouseRegistration": "{{ lakehouseRegistration }}",
"namespaceName": "{{ namespaceName }}"
}'
;