Skip to main content

namespaces

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

Overview

Namenamespaces
TypeResource
Idaws.redshift_serverless.namespaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
admin_password_secret_arnstringThe Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
admin_password_secret_kms_key_idstringThe ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret.
admin_usernamestringThe username of the administrator for the first database created in the namespace.
catalog_arnstringThe Amazon Resource Name (ARN) of the Glue Data Catalog associated with the namespace enabled with Amazon Redshift federated permissions.
creation_datestring (date-time)The date of when the namespace was created.
db_namestringThe name of the first database created in the namespace.
default_iam_role_arnstringThe Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
iam_rolesarrayA list of IAM roles to associate with the namespace.
kms_key_idstringThe ID of the Amazon Web Services Key Management Service key used to encrypt your data.
lakehouse_registration_statusstringThe status of the lakehouse registration for the namespace. Indicates whether the namespace is successfully registered with Amazon Redshift federated permissions.
log_exportsarrayThe types of logs the namespace can export. Available export types are User log, Connection log, and User activity log.
namespace_arnstringThe Amazon Resource Name (ARN) associated with a namespace.
namespace_idstringThe unique identifier of a namespace.
namespace_namestringThe 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_statusobjectThe current Amazon S3 Tables log-publishing status for the namespace. Not returned when S3 Tables publishing has never been configured for the namespace.
statusstringThe status of the namespace. (AVAILABLE, MODIFYING, DELETING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_namespaceselectregionReturns information about a namespace in Amazon Redshift Serverless.
list_namespacesselectregionReturns information about a list of specified namespaces.
create_namespaceinsertregion, namespaceNameCreates a namespace in Amazon Redshift Serverless.
update_namespaceupdateregion, namespaceNameUpdates 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_namespacedeleteregionDeletes 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_snapshotexecregion, namespaceName, workgroupNameRestores a namespace from a snapshot.
restore_table_from_snapshotexecregion, namespaceName, newTableName, snapshotName, sourceDatabaseName, sourceTableName, workgroupNameRestores 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_configurationexecregion, namespaceNameModifies 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}"
}'
;