Skip to content
v2.278.0

DatabaseClusterLookupOptions Struct ​

Properties for looking up an existing DatabaseCluster.

Example ​

ts
declare const myUserRole: iam.Role;

const clusterFromLookup = rds.DatabaseCluster.fromLookup(this, 'ClusterFromLookup', {
  clusterIdentifier: 'my-cluster-id',
});

// Grant a connection
clusterFromLookup.grantConnect(myUserRole, 'my-user-id');
python
# my_user_role: iam.Role


cluster_from_lookup = rds.DatabaseCluster.from_lookup(self, "ClusterFromLookup",
    cluster_identifier="my-cluster-id"
)

# Grant a connection
cluster_from_lookup.grant_connect(my_user_role, "my-user-id")
java
Role myUserRole;


IDatabaseCluster clusterFromLookup = DatabaseCluster.fromLookup(this, "ClusterFromLookup", DatabaseClusterLookupOptions.builder()
        .clusterIdentifier("my-cluster-id")
        .build());

// Grant a connection
clusterFromLookup.grantConnect(myUserRole, "my-user-id");
csharp
// Install: dotnet add package Amazon.CDK.Lib
Role myUserRole;


var clusterFromLookup = DatabaseCluster.FromLookup(this, "ClusterFromLookup", new DatabaseClusterLookupOptions {
    ClusterIdentifier = "my-cluster-id"
});

// Grant a connection
clusterFromLookup.GrantConnect(myUserRole, "my-user-id");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myUserRole Role


clusterFromLookup := rds.DatabaseCluster_FromLookup(this, jsii.String("ClusterFromLookup"), &DatabaseClusterLookupOptions{
	ClusterIdentifier: jsii.String("my-cluster-id"),
})

// Grant a connection
clusterFromLookup.GrantConnect(myUserRole, jsii.String("my-user-id"))

Properties ​

clusterIdentifierstringcluster_identifierstrclusterIdentifierStringClusterIdentifierstringClusterIdentifier*string required #
The cluster identifier of the DatabaseCluster.