namespaces
Creates, updates, deletes or gets a namespace resource or lists namespaces in a region
Overview
| Name | namespaces |
| Type | Resource |
| Description | Definition of AWS::RedshiftServerless::Namespace Resource Type |
| Id | awscc.redshiftserverless.namespaces |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
admin_password_secret_kms_key_id | string | The ID of the AWS 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. |
admin_user_password | string | The password associated with the admin user for the namespace that is being created. Password must be at least 8 characters in length, should be any printable ASCII character. Must contain at least one lowercase letter, one uppercase letter and one decimal digit. You can't use adminUserPassword if manageAdminPassword is true. |
admin_username | string | The user name associated with the admin user for the namespace that is being created. Only alphanumeric characters and underscores are allowed. It should start with an alphabet. |
db_name | string | The database name associated for the namespace that is being created. Only alphanumeric characters and underscores are allowed. It should start with an alphabet. |
default_iam_role_arn | string | The default IAM role ARN for the namespace that is being created. |
iam_roles | array | A list of AWS Identity and Access Management (IAM) roles that can be used by the namespace to access other AWS services. You must supply the IAM roles in their Amazon Resource Name (ARN) format. The Default role limit for each request is 10. |
kms_key_id | string | The AWS Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the namespace. |
log_exports | array | The collection of log types to be exported provided by the customer. Should only be one of the three supported log types: userlog, useractivitylog and connectionlog |
manage_admin_password | boolean | If true, Amazon Redshift uses AWS 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. |
namespace | object | Definition of Namespace resource. |
namespace_name | string | A unique identifier for the namespace. You use this identifier to refer to the namespace for any subsequent namespace operations such as deleting or modifying. All alphabetical characters must be lower case. Namespace name should be unique for all namespaces within an AWS account. |
tags | array | The list of tags for the namespace. |
final_snapshot_name | string | The name of the namespace the source snapshot was created from. Please specify the name if needed before deleting namespace |
final_snapshot_retention_period | integer | The number of days to retain automated snapshot in the destination region after they are copied from the source region. If the value is -1, the manual snapshot is retained indefinitely. The value must be either -1 or an integer between 1 and 3,653. |
namespace_resource_policy | object | The resource policy document that will be attached to the namespace. |
redshift_idc_application_arn | string | The ARN for the Redshift application that integrates with IAM Identity Center. |
snapshot_copy_configurations | array | The snapshot copy configurations for the namespace. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
namespace | object | Definition of Namespace resource. |
namespace_name | string | A unique identifier for the namespace. You use this identifier to refer to the namespace for any subsequent namespace operations such as deleting or modifying. All alphabetical characters must be lower case. Namespace name should be unique for all namespaces within an AWS account. |
region | string | AWS region. |
For more information, see AWS::RedshiftServerless::Namespace.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | namespaces | INSERT | NamespaceName, region |
delete_resource | namespaces | DELETE | Identifier, region |
update_resource | namespaces | UPDATE | Identifier, PatchDocument, region |
list_resources | namespaces_list_only | SELECT | region |
get_resource | namespaces | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual namespace.
SELECT
region,
admin_password_secret_kms_key_id,
admin_user_password,
admin_username,
db_name,
default_iam_role_arn,
iam_roles,
kms_key_id,
log_exports,
manage_admin_password,
namespace,
namespace_name,
tags,
final_snapshot_name,
final_snapshot_retention_period,
namespace_resource_policy,
redshift_idc_application_arn,
snapshot_copy_configurations
FROM awscc.redshiftserverless.namespaces
WHERE
region = 'us-east-1' AND
Identifier = '{{ namespace_name }}';
Lists all namespaces in a region.
SELECT
region,
namespace_name
FROM awscc.redshiftserverless.namespaces_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new namespace resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.redshiftserverless.namespaces (
NamespaceName,
region
)
SELECT
'{{ namespace_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.redshiftserverless.namespaces (
AdminPasswordSecretKmsKeyId,
AdminUserPassword,
AdminUsername,
DbName,
DefaultIamRoleArn,
IamRoles,
KmsKeyId,
LogExports,
ManageAdminPassword,
NamespaceName,
Tags,
FinalSnapshotName,
FinalSnapshotRetentionPeriod,
NamespaceResourcePolicy,
RedshiftIdcApplicationArn,
SnapshotCopyConfigurations,
region
)
SELECT
'{{ admin_password_secret_kms_key_id }}',
'{{ admin_user_password }}',
'{{ admin_username }}',
'{{ db_name }}',
'{{ default_iam_role_arn }}',
'{{ iam_roles }}',
'{{ kms_key_id }}',
'{{ log_exports }}',
'{{ manage_admin_password }}',
'{{ namespace_name }}',
'{{ tags }}',
'{{ final_snapshot_name }}',
'{{ final_snapshot_retention_period }}',
'{{ namespace_resource_policy }}',
'{{ redshift_idc_application_arn }}',
'{{ snapshot_copy_configurations }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: namespace
props:
- name: admin_password_secret_kms_key_id
value: '{{ admin_password_secret_kms_key_id }}'
- name: admin_user_password
value: '{{ admin_user_password }}'
- name: admin_username
value: '{{ admin_username }}'
- name: db_name
value: '{{ db_name }}'
- name: default_iam_role_arn
value: '{{ default_iam_role_arn }}'
- name: iam_roles
value:
- '{{ iam_roles[0] }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: log_exports
value:
- '{{ log_exports[0] }}'
- name: manage_admin_password
value: '{{ manage_admin_password }}'
- name: namespace_name
value: '{{ namespace_name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: final_snapshot_name
value: '{{ final_snapshot_name }}'
- name: final_snapshot_retention_period
value: '{{ final_snapshot_retention_period }}'
- name: namespace_resource_policy
value: {}
- name: redshift_idc_application_arn
value: '{{ redshift_idc_application_arn }}'
- name: snapshot_copy_configurations
value:
- destination_region: '{{ destination_region }}'
destination_kms_key_id: '{{ destination_kms_key_id }}'
snapshot_retention_period: '{{ snapshot_retention_period }}'
UPDATE example
Use the following StackQL query and manifest file to update a namespace resource, using stack-deploy.
/*+ update */
UPDATE awscc.redshiftserverless.namespaces
SET PatchDocument = string('{{ {
"AdminPasswordSecretKmsKeyId": admin_password_secret_kms_key_id,
"AdminUserPassword": admin_user_password,
"AdminUsername": admin_username,
"DbName": db_name,
"DefaultIamRoleArn": default_iam_role_arn,
"IamRoles": iam_roles,
"KmsKeyId": kms_key_id,
"LogExports": log_exports,
"ManageAdminPassword": manage_admin_password,
"Tags": tags,
"FinalSnapshotName": final_snapshot_name,
"FinalSnapshotRetentionPeriod": final_snapshot_retention_period,
"NamespaceResourcePolicy": namespace_resource_policy,
"RedshiftIdcApplicationArn": redshift_idc_application_arn,
"SnapshotCopyConfigurations": snapshot_copy_configurations
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ namespace_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.redshiftserverless.namespaces
WHERE
Identifier = '{{ namespace_name }}' AND
region = 'us-east-1';
Permissions
To operate on the namespaces resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:CreateServiceLinkedRole,
iam:PassRole,
kms:TagResource,
kms:UntagResource,
kms:ScheduleKeyDeletion,
kms:CancelKeyDeletion,
kms:Encrypt,
kms:Decrypt,
kms:DescribeKey,
kms:GenerateDataKeyPair,
kms:GenerateDataKey,
kms:CreateGrant,
kms:ListGrants,
kms:RevokeGrant,
kms:RetireGrant,
redshift-serverless:CreateNamespace,
redshift-serverless:GetNamespace,
redshift-serverless:ListSnapshotCopyConfigurations,
redshift-serverless:CreateSnapshotCopyConfiguration,
redshift-serverless:ListTagsForResource,
redshift-serverless:TagResource,
redshift:GetResourcePolicy,
redshift:PutResourcePolicy,
secretsmanager:CreateSecret,
secretsmanager:TagResource,
secretsmanager:RotateSecret,
secretsmanager:DescribeSecret
iam:PassRole,
redshift-serverless:GetNamespace,
redshift-serverless:ListTagsForResource,
redshift:GetResourcePolicy,
redshift-serverless:ListSnapshotCopyConfigurations
iam:PassRole,
kms:TagResource,
kms:UntagResource,
kms:ScheduleKeyDeletion,
kms:CancelKeyDeletion,
kms:Encrypt,
kms:Decrypt,
kms:DescribeKey,
kms:CreateGrant,
kms:ListGrants,
kms:RevokeGrant,
kms:RetireGrant,
kms:GenerateDataKeyPair,
kms:GenerateDataKey,
redshift-serverless:UpdateNamespace,
redshift-serverless:GetNamespace,
redshift-serverless:ListSnapshotCopyConfigurations,
redshift-serverless:CreateSnapshotCopyConfiguration,
redshift-serverless:UpdateSnapshotCopyConfiguration,
redshift-serverless:DeleteSnapshotCopyConfiguration,
redshift-serverless:ListTagsForResource,
redshift-serverless:TagResource,
redshift-serverless:UntagResource,
redshift:GetResourcePolicy,
redshift:PutResourcePolicy,
redshift:DeleteResourcePolicy,
secretsmanager:CreateSecret,
secretsmanager:TagResource,
secretsmanager:RotateSecret,
secretsmanager:DescribeSecret,
secretsmanager:UpdateSecret,
secretsmanager:DeleteSecret
iam:PassRole,
redshift-serverless:DeleteNamespace,
redshift-serverless:GetNamespace,
redshift-serverless:ListTagsForResource,
redshift-serverless:UntagResource,
kms:RetireGrant,
secretsmanager:DescribeSecret,
secretsmanager:DeleteSecret,
redshift:DeleteResourcePolicy
iam:PassRole,
redshift-serverless:ListNamespaces,
redshift-serverless:ListTagsForResource