Resource: awsRdsClusterEndpoint
Manages an RDS Aurora Cluster Endpoint. You can refer to the User Guide.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsRdsClusterDefault = new aws.rdsCluster.RdsCluster(this, "default", {
availabilityZones: ["us-west-2a", "us-west-2b", "us-west-2c"],
backupRetentionPeriod: 5,
clusterIdentifier: "aurora-cluster-demo",
databaseName: "mydb",
masterPassword: "bar",
masterUsername: "foo",
preferredBackupWindow: "07:00-09:00",
});
const awsRdsClusterInstanceTest1 =
new aws.rdsClusterInstance.RdsClusterInstance(this, "test1", {
applyImmediately: true,
clusterIdentifier: awsRdsClusterDefault.id,
engine: awsRdsClusterDefault.engine,
engineVersion: awsRdsClusterDefault.engineVersion,
identifier: "test1",
instanceClass: "db.t2.small",
});
const awsRdsClusterInstanceTest2 =
new aws.rdsClusterInstance.RdsClusterInstance(this, "test2", {
applyImmediately: true,
clusterIdentifier: awsRdsClusterDefault.id,
engine: awsRdsClusterDefault.engine,
engineVersion: awsRdsClusterDefault.engineVersion,
identifier: "test2",
instanceClass: "db.t2.small",
});
const awsRdsClusterInstanceTest3 =
new aws.rdsClusterInstance.RdsClusterInstance(this, "test3", {
applyImmediately: true,
clusterIdentifier: awsRdsClusterDefault.id,
engine: awsRdsClusterDefault.engine,
engineVersion: awsRdsClusterDefault.engineVersion,
identifier: "test3",
instanceClass: "db.t2.small",
});
new aws.rdsClusterEndpoint.RdsClusterEndpoint(this, "eligible", {
clusterEndpointIdentifier: "reader",
clusterIdentifier: awsRdsClusterDefault.id,
customEndpointType: "READER",
excludedMembers: [
awsRdsClusterInstanceTest1.id,
awsRdsClusterInstanceTest2.id,
],
});
new aws.rdsClusterEndpoint.RdsClusterEndpoint(this, "static", {
clusterEndpointIdentifier: "static",
clusterIdentifier: awsRdsClusterDefault.id,
customEndpointType: "READER",
staticMembers: [awsRdsClusterInstanceTest1.id, awsRdsClusterInstanceTest3.id],
});
Argument Reference
For more detailed documentation about each argument, refer to the AWS official documentation.
The following arguments are supported:
clusterIdentifier
- (Required, Forces new resources) The cluster identifier.clusterEndpointIdentifier
- (Required, Forces new resources) The identifier to use for the new endpoint. This parameter is stored as a lowercase string.customEndpointType
- (Required) The type of the endpoint. One of: READER , ANY .staticMembers
- (Optional) List of DB instance identifiers that are part of the custom endpoint group. Conflicts withexcludedMembers
.excludedMembers
- (Optional) List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty. Conflicts withstaticMembers
.tags
- (Optional) Key-value map of resource tags. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
arn
- Amazon Resource Name (ARN) of clusterid
- The RDS Cluster Endpoint Identifierendpoint
- A custom endpoint for the Aurora clustertagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block.
Import
RDS Clusters Endpoint can be imported using the clusterEndpointIdentifier
, e.g.,