@Generated(value="jsii-pacmak/1.71.0 (build f1f58ae)", date="2022-12-07T17:24:48.918Z") @Stability(value=Stable) public class ServerlessCluster extends Resource implements IServerlessCluster
Example:
Vpc vpc;
Code code;
ServerlessCluster cluster = ServerlessCluster.Builder.create(this, "AnotherCluster")
.engine(DatabaseClusterEngine.AURORA_MYSQL)
.vpc(vpc) // this parameter is optional for serverless Clusters
.enableDataApi(true)
.build();
Function fn = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(code)
.environment(Map.of(
"CLUSTER_ARN", cluster.getClusterArn(),
"SECRET_ARN", cluster.getSecret().getSecretArn()))
.build();
cluster.grantDataApiAccess(fn);
| Modifier and Type | Class and Description |
|---|---|
static class |
ServerlessCluster.Builder
A fluent builder for
ServerlessCluster. |
software.amazon.jsii.JsiiObject.InitializationModeIServerlessCluster.Jsii$Default, IServerlessCluster.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
ServerlessCluster(software.constructs.Construct scope,
String id,
ServerlessClusterProps props) |
protected |
ServerlessCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ServerlessCluster(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
SecretRotation |
addRotationMultiUser(String id,
RotationMultiUserOptions options)
Adds the multi user rotation to this cluster.
|
SecretRotation |
addRotationSingleUser()
Adds the single user rotation of the master password to this cluster.
|
SecretRotation |
addRotationSingleUser(RotationSingleUserOptions options)
Adds the single user rotation of the master password to this cluster.
|
SecretAttachmentTargetProps |
asSecretAttachmentTarget()
Renders the secret attachment target specifications.
|
static IServerlessCluster |
fromServerlessClusterAttributes(software.constructs.Construct scope,
String id,
ServerlessClusterAttributes attrs)
Import an existing DatabaseCluster from properties.
|
String |
getClusterArn()
The ARN of the cluster.
|
Endpoint |
getClusterEndpoint()
The endpoint to use for read/write operations.
|
String |
getClusterIdentifier()
Identifier of the cluster.
|
Endpoint |
getClusterReadEndpoint()
The endpoint to use for read/write operations.
|
Connections |
getConnections()
Access to the network connections.
|
protected Boolean |
getEnableDataApi() |
protected CfnDBClusterProps |
getNewCfnProps() |
ISecret |
getSecret()
The secret attached to this cluster.
|
protected List<ISecurityGroup> |
getSecurityGroups() |
Grant |
grantDataApiAccess(IGrantable grantee)
Grant the given identity to access to the Data API, including read access to the secret attached to the cluster if present.
|
protected void |
setEnableDataApi(Boolean value) |
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected ServerlessCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected ServerlessCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public ServerlessCluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
ServerlessClusterProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static IServerlessCluster fromServerlessClusterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServerlessClusterAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationMultiUser(@NotNull String id, @NotNull RotationMultiUserOptions options)
id - This parameter is required.options - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser(@Nullable RotationSingleUserOptions options)
options - @Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser()
@Stability(value=Stable) @NotNull public SecretAttachmentTargetProps asSecretAttachmentTarget()
asSecretAttachmentTarget in interface ISecretAttachmentTarget@Stability(value=Stable) @NotNull public Grant grantDataApiAccess(@NotNull IGrantable grantee)
grantDataApiAccess in interface IServerlessClustergrantee - The principal to grant access to. This parameter is required.@Stability(value=Stable) @NotNull public String getClusterArn()
getClusterArn in interface IServerlessCluster@Stability(value=Stable) @NotNull public Endpoint getClusterEndpoint()
getClusterEndpoint in interface IServerlessCluster@Stability(value=Stable) @NotNull public String getClusterIdentifier()
getClusterIdentifier in interface IServerlessCluster@Stability(value=Stable) @NotNull public Endpoint getClusterReadEndpoint()
getClusterReadEndpoint in interface IServerlessCluster@Stability(value=Stable) @NotNull public Connections getConnections()
getConnections in interface IConnectable@Stability(value=Stable) @NotNull protected CfnDBClusterProps getNewCfnProps()
@Stability(value=Stable) @NotNull protected List<ISecurityGroup> getSecurityGroups()
@Stability(value=Stable) @Nullable public ISecret getSecret()
@Stability(value=Stable) @Nullable protected Boolean getEnableDataApi()
@Stability(value=Stable)
protected void setEnableDataApi(@Nullable
Boolean value)
Copyright © 2022. All rights reserved.