Class ServerlessCluster
Create an Aurora Serverless Cluster.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public class ServerlessCluster : Resource, IServerlessCluster, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
Syntax (vb)
Public Class ServerlessCluster
Inherits Resource
Implements IServerlessCluster, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
Remarks
Resource: AWS::RDS::DBCluster
ExampleMetadata: infused
Examples
Vpc vpc;
Code code;
var cluster = new ServerlessCluster(this, "AnotherCluster", new ServerlessClusterProps {
Engine = DatabaseClusterEngine.AURORA_MYSQL,
Vpc = vpc, // this parameter is optional for serverless Clusters
EnableDataApi = true
});
var fn = new Function(this, "MyFunction", new FunctionProps {
Runtime = Runtime.NODEJS_14_X,
Handler = "index.handler",
Code = code,
Environment = new Dictionary<string, string> {
{ "CLUSTER_ARN", cluster.ClusterArn },
{ "SECRET_ARN", cluster.Secret.SecretArn }
}
});
cluster.GrantDataApiAccess(fn);
Synopsis
Constructors
ServerlessCluster(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ServerlessCluster(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ServerlessCluster(Construct, String, IServerlessClusterProps) |
Properties
ClusterArn | The ARN of the cluster. |
ClusterEndpoint | The endpoint to use for read/write operations. |
ClusterIdentifier | Identifier of the cluster. |
ClusterReadEndpoint | The endpoint to use for read/write operations. |
Connections | Access to the network connections. |
EnableDataApi | |
NewCfnProps | |
Secret | The secret attached to this cluster. |
SecurityGroups |
Methods
AddRotationMultiUser(String, IRotationMultiUserOptions) | Adds the multi user rotation to this cluster. |
AddRotationSingleUser(IRotationSingleUserOptions) | Adds the single user rotation of the master password to this cluster. |
AsSecretAttachmentTarget() | Renders the secret attachment target specifications. |
FromServerlessClusterAttributes(Construct, String, IServerlessClusterAttributes) | Import an existing DatabaseCluster from properties. |
GrantDataApiAccess(IGrantable) | Grant the given identity to access to the Data API, including read access to the secret attached to the cluster if present. |
Constructors
ServerlessCluster(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ServerlessCluster(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ServerlessCluster(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ServerlessCluster(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ServerlessCluster(Construct, String, IServerlessClusterProps)
public ServerlessCluster(Construct scope, string id, IServerlessClusterProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IServerlessClusterProps
Properties
ClusterArn
The ARN of the cluster.
public virtual string ClusterArn { get; }
Property Value
System.String
ClusterEndpoint
The endpoint to use for read/write operations.
public virtual Endpoint ClusterEndpoint { get; }
Property Value
ClusterIdentifier
Identifier of the cluster.
public virtual string ClusterIdentifier { get; }
Property Value
System.String
ClusterReadEndpoint
The endpoint to use for read/write operations.
public virtual Endpoint ClusterReadEndpoint { get; }
Property Value
Connections
Access to the network connections.
public virtual Connections_ Connections { get; }
Property Value
EnableDataApi
protected virtual Nullable<bool> EnableDataApi { get; set; }
Property Value
System.Nullable<System.Boolean>
NewCfnProps
Secret
SecurityGroups
Methods
AddRotationMultiUser(String, IRotationMultiUserOptions)
Adds the multi user rotation to this cluster.
public virtual SecretRotation AddRotationMultiUser(string id, IRotationMultiUserOptions options)
Parameters
- id System.String
- options IRotationMultiUserOptions
Returns
AddRotationSingleUser(IRotationSingleUserOptions)
Adds the single user rotation of the master password to this cluster.
public virtual SecretRotation AddRotationSingleUser(IRotationSingleUserOptions options = null)
Parameters
- options IRotationSingleUserOptions
Returns
AsSecretAttachmentTarget()
Renders the secret attachment target specifications.
public virtual ISecretAttachmentTargetProps AsSecretAttachmentTarget()
Returns
FromServerlessClusterAttributes(Construct, String, IServerlessClusterAttributes)
Import an existing DatabaseCluster from properties.
public static IServerlessCluster FromServerlessClusterAttributes(Construct scope, string id, IServerlessClusterAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IServerlessClusterAttributes
Returns
GrantDataApiAccess(IGrantable)
Grant the given identity to access to the Data API, including read access to the secret attached to the cluster if present.
public virtual Grant GrantDataApiAccess(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant access to.
Returns