Cluster

class aws_cdk.aws_dsql_alpha.Cluster(scope, id, *, cluster_name=None, deletion_protection=None, removal_policy=None)

Bases: Resource

(experimental) Create an Aurora DSQL cluster.

Stability:

experimental

Resource:

AWS::DSQL::Cluster

ExampleMetadata:

infused

Example:

cluster = dsql.Cluster(self, "Cluster",
    cluster_name="my-dsql-cluster",
    deletion_protection=True
)
Parameters:
  • scope (Construct)

  • id (str)

  • cluster_name (Optional[str]) – (experimental) The name of the DSQL cluster. This is applied via the Name tag. Default: - No name specified.

  • deletion_protection (Optional[bool]) – (experimental) Specifies whether this cluster can be deleted. If deletionProtection is enabled, the cluster cannot be deleted unless it is modified and deletionProtection is disabled. deletionProtection protects clusters from being accidentally deleted. Default: - true if removalPolicy is RETAIN, undefined otherwise.

  • removal_policy (Optional[RemovalPolicy]) – (experimental) The removal policy to apply when the cluster is removed or replaced during a stack update, or when the stack is deleted. Default: - Retain cluster.

Stability:

experimental

Methods

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy)

Return type:

None

grant(grantee, *actions)

(experimental) Grant the given identity the specified actions.

Parameters:
Stability:

experimental

Return type:

Grant

grant_connect(grantee)

(experimental) Grant the given identity permission to connect to the database.

[disable-awslint:no-grants]

Parameters:

grantee (IGrantable)

Stability:

experimental

Return type:

Grant

grant_connect_admin(grantee)

(experimental) Grant the given identity permission to connect to the database with admin role.

[disable-awslint:no-grants]

Parameters:

grantee (IGrantable)

Stability:

experimental

Return type:

Grant

to_string()

Returns a string representation of this construct.

Return type:

str

with_(*mixins)

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

mixins (IMixin)

Return type:

IConstruct

Attributes

cluster_arn

(experimental) Arn of the cluster.

Stability:

experimental

cluster_endpoint

(experimental) Connection endpoint for the cluster.

Stability:

experimental

cluster_identifier

(experimental) Identifier of the cluster.

Stability:

experimental

env

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

node

The tree node.

stack

The stack in which this resource is defined.

vpc_endpoint_service_name

(experimental) VPC endpoint service name for the cluster.

Stability:

experimental

Static Methods

classmethod from_cluster_attributes(scope, id, *, cluster_endpoint, cluster_identifier, vpc_endpoint_service_name)

(experimental) Import an existing Cluster from attributes.

Parameters:
  • scope (Construct)

  • id (str)

  • cluster_endpoint (str) – (experimental) Connection endpoint for the cluster.

  • cluster_identifier (str) – (experimental) Identifier of the cluster.

  • vpc_endpoint_service_name (str) – (experimental) VPC endpoint service name for the cluster.

Stability:

experimental

Return type:

ICluster

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod is_owned_resource(construct)

Returns true if the construct was created by CDK, and false otherwise.

Parameters:

construct (IConstruct)

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct)

Return type:

bool