ClusterEndpoint class

Manages an RDS Aurora Cluster Custom Endpoint. You can refer to the User Guide.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const _default = new aws.rds.Cluster("default", {
    clusterIdentifier: "aurora-cluster-demo",
    availabilityZones: [
        "us-west-2a",
        "us-west-2b",
        "us-west-2c",
    ],
    databaseName: "mydb",
    masterUsername: "foo",
    masterPassword: "bar",
    backupRetentionPeriod: 5,
    preferredBackupWindow: "07:00-09:00",
});
const test1 = new aws.rds.ClusterInstance("test1", {
    applyImmediately: true,
    clusterIdentifier: _default.id,
    identifier: "test1",
    instanceClass: aws.rds.InstanceType.T2_Small,
    engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
    engineVersion: _default.engineVersion,
});
const test2 = new aws.rds.ClusterInstance("test2", {
    applyImmediately: true,
    clusterIdentifier: _default.id,
    identifier: "test2",
    instanceClass: aws.rds.InstanceType.T2_Small,
    engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
    engineVersion: _default.engineVersion,
});
const test3 = new aws.rds.ClusterInstance("test3", {
    applyImmediately: true,
    clusterIdentifier: _default.id,
    identifier: "test3",
    instanceClass: aws.rds.InstanceType.T2_Small,
    engine: _default.engine.apply((x) => aws.rds.EngineType[x]),
    engineVersion: _default.engineVersion,
});
const eligible = new aws.rds.ClusterEndpoint("eligible", {
    clusterIdentifier: _default.id,
    clusterEndpointIdentifier: "reader",
    customEndpointType: "READER",
    excludedMembers: [
        test1.id,
        test2.id,
    ],
});
const static = new aws.rds.ClusterEndpoint("static", {
    clusterIdentifier: _default.id,
    clusterEndpointIdentifier: "static",
    customEndpointType: "READER",
    staticMembers: [
        test1.id,
        test3.id,
    ],
});
import pulumi
import pulumi_aws as aws

default = aws.rds.Cluster("default",
    cluster_identifier="aurora-cluster-demo",
    availability_zones=[
        "us-west-2a",
        "us-west-2b",
        "us-west-2c",
    ],
    database_name="mydb",
    master_username="foo",
    master_password="bar",
    backup_retention_period=5,
    preferred_backup_window="07:00-09:00")
test1 = aws.rds.ClusterInstance("test1",
    apply_immediately=True,
    cluster_identifier=default.id,
    identifier="test1",
    instance_class=aws.rds.InstanceType.T2_SMALL,
    engine=default.engine.apply(lambda x: aws.rds.EngineType(x)),
    engine_version=default.engine_version)
test2 = aws.rds.ClusterInstance("test2",
    apply_immediately=True,
    cluster_identifier=default.id,
    identifier="test2",
    instance_class=aws.rds.InstanceType.T2_SMALL,
    engine=default.engine.apply(lambda x: aws.rds.EngineType(x)),
    engine_version=default.engine_version)
test3 = aws.rds.ClusterInstance("test3",
    apply_immediately=True,
    cluster_identifier=default.id,
    identifier="test3",
    instance_class=aws.rds.InstanceType.T2_SMALL,
    engine=default.engine.apply(lambda x: aws.rds.EngineType(x)),
    engine_version=default.engine_version)
eligible = aws.rds.ClusterEndpoint("eligible",
    cluster_identifier=default.id,
    cluster_endpoint_identifier="reader",
    custom_endpoint_type="READER",
    excluded_members=[
        test1.id,
        test2.id,
    ])
static = aws.rds.ClusterEndpoint("static",
    cluster_identifier=default.id,
    cluster_endpoint_identifier="static",
    custom_endpoint_type="READER",
    static_members=[
        test1.id,
        test3.id,
    ])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var @default = new Aws.Rds.Cluster("default", new()
    {
        ClusterIdentifier = "aurora-cluster-demo",
        AvailabilityZones = new[]
        {
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
        },
        DatabaseName = "mydb",
        MasterUsername = "foo",
        MasterPassword = "bar",
        BackupRetentionPeriod = 5,
        PreferredBackupWindow = "07:00-09:00",
    });

    var test1 = new Aws.Rds.ClusterInstance("test1", new()
    {
        ApplyImmediately = true,
        ClusterIdentifier = @default.Id,
        Identifier = "test1",
        InstanceClass = Aws.Rds.InstanceType.T2_Small,
        Engine = @default.Engine.Apply(System.Enum.Parse<Aws.Rds.EngineType>),
        EngineVersion = @default.EngineVersion,
    });

    var test2 = new Aws.Rds.ClusterInstance("test2", new()
    {
        ApplyImmediately = true,
        ClusterIdentifier = @default.Id,
        Identifier = "test2",
        InstanceClass = Aws.Rds.InstanceType.T2_Small,
        Engine = @default.Engine.Apply(System.Enum.Parse<Aws.Rds.EngineType>),
        EngineVersion = @default.EngineVersion,
    });

    var test3 = new Aws.Rds.ClusterInstance("test3", new()
    {
        ApplyImmediately = true,
        ClusterIdentifier = @default.Id,
        Identifier = "test3",
        InstanceClass = Aws.Rds.InstanceType.T2_Small,
        Engine = @default.Engine.Apply(System.Enum.Parse<Aws.Rds.EngineType>),
        EngineVersion = @default.EngineVersion,
    });

    var eligible = new Aws.Rds.ClusterEndpoint("eligible", new()
    {
        ClusterIdentifier = @default.Id,
        ClusterEndpointIdentifier = "reader",
        CustomEndpointType = "READER",
        ExcludedMembers = new[]
        {
            test1.Id,
            test2.Id,
        },
    });

    var @static = new Aws.Rds.ClusterEndpoint("static", new()
    {
        ClusterIdentifier = @default.Id,
        ClusterEndpointIdentifier = "static",
        CustomEndpointType = "READER",
        StaticMembers = new[]
        {
            test1.Id,
            test3.Id,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := rds.NewCluster(ctx, "default", &rds.ClusterArgs{
			ClusterIdentifier: pulumi.String("aurora-cluster-demo"),
			AvailabilityZones: pulumi.StringArray{
				pulumi.String("us-west-2a"),
				pulumi.String("us-west-2b"),
				pulumi.String("us-west-2c"),
			},
			DatabaseName:          pulumi.String("mydb"),
			MasterUsername:        pulumi.String("foo"),
			MasterPassword:        pulumi.String("bar"),
			BackupRetentionPeriod: pulumi.Int(5),
			PreferredBackupWindow: pulumi.String("07:00-09:00"),
		})
		if err != nil {
			return err
		}
		test1, err := rds.NewClusterInstance(ctx, "test1", &rds.ClusterInstanceArgs{
			ApplyImmediately:  pulumi.Bool(true),
			ClusterIdentifier: _default.ID().ToIDOutput().ToStringOutput(),
			Identifier:        pulumi.String("test1"),
			InstanceClass:     pulumi.String(rds.InstanceType_T2_Small),
			Engine:            _default.Engine.ApplyT(func(x *string) rds.EngineType { return rds.EngineType(*x) }).(rds.EngineTypeOutput),
			EngineVersion:     _default.EngineVersion,
		})
		if err != nil {
			return err
		}
		test2, err := rds.NewClusterInstance(ctx, "test2", &rds.ClusterInstanceArgs{
			ApplyImmediately:  pulumi.Bool(true),
			ClusterIdentifier: _default.ID().ToIDOutput().ToStringOutput(),
			Identifier:        pulumi.String("test2"),
			InstanceClass:     pulumi.String(rds.InstanceType_T2_Small),
			Engine:            _default.Engine.ApplyT(func(x *string) rds.EngineType { return rds.EngineType(*x) }).(rds.EngineTypeOutput),
			EngineVersion:     _default.EngineVersion,
		})
		if err != nil {
			return err
		}
		test3, err := rds.NewClusterInstance(ctx, "test3", &rds.ClusterInstanceArgs{
			ApplyImmediately:  pulumi.Bool(true),
			ClusterIdentifier: _default.ID().ToIDOutput().ToStringOutput(),
			Identifier:        pulumi.String("test3"),
			InstanceClass:     pulumi.String(rds.InstanceType_T2_Small),
			Engine:            _default.Engine.ApplyT(func(x *string) rds.EngineType { return rds.EngineType(*x) }).(rds.EngineTypeOutput),
			EngineVersion:     _default.EngineVersion,
		})
		if err != nil {
			return err
		}
		_, err = rds.NewClusterEndpoint(ctx, "eligible", &rds.ClusterEndpointArgs{
			ClusterIdentifier:         _default.ID().ToIDOutput().ToStringOutput(),
			ClusterEndpointIdentifier: pulumi.String("reader"),
			CustomEndpointType:        pulumi.String("READER"),
			ExcludedMembers: pulumi.StringArray{
				test1.ID().ToIDOutput().ToStringOutput(),
				test2.ID().ToIDOutput().ToStringOutput(),
			},
		})
		if err != nil {
			return err
		}
		_, err = rds.NewClusterEndpoint(ctx, "static", &rds.ClusterEndpointArgs{
			ClusterIdentifier:         _default.ID().ToIDOutput().ToStringOutput(),
			ClusterEndpointIdentifier: pulumi.String("static"),
			CustomEndpointType:        pulumi.String("READER"),
			StaticMembers: pulumi.StringArray{
				test1.ID().ToIDOutput().ToStringOutput(),
				test3.ID().ToIDOutput().ToStringOutput(),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_rds_cluster" "default" {
  cluster_identifier      = "aurora-cluster-demo"
  availability_zones      = ["us-west-2a", "us-west-2b", "us-west-2c"]
  database_name           = "mydb"
  master_username         = "foo"
  master_password         = "bar"
  backup_retention_period = 5
  preferred_backup_window = "07:00-09:00"
}
resource "aws_rds_clusterinstance" "test1" {
  apply_immediately  = true
  cluster_identifier = aws_rds_cluster.default.id
  identifier         = "test1"
  instance_class     = "db.t2.small"
  engine             = aws_rds_cluster.default.engine
  engine_version     = aws_rds_cluster.default.engine_version
}
resource "aws_rds_clusterinstance" "test2" {
  apply_immediately  = true
  cluster_identifier = aws_rds_cluster.default.id
  identifier         = "test2"
  instance_class     = "db.t2.small"
  engine             = aws_rds_cluster.default.engine
  engine_version     = aws_rds_cluster.default.engine_version
}
resource "aws_rds_clusterinstance" "test3" {
  apply_immediately  = true
  cluster_identifier = aws_rds_cluster.default.id
  identifier         = "test3"
  instance_class     = "db.t2.small"
  engine             = aws_rds_cluster.default.engine
  engine_version     = aws_rds_cluster.default.engine_version
}
resource "aws_rds_clusterendpoint" "eligible" {
  cluster_identifier          = aws_rds_cluster.default.id
  cluster_endpoint_identifier = "reader"
  custom_endpoint_type        = "READER"
  excluded_members            = [aws_rds_clusterinstance.test1.id, aws_rds_clusterinstance.test2.id]
}
resource "aws_rds_clusterendpoint" "static" {
  cluster_identifier          = aws_rds_cluster.default.id
  cluster_endpoint_identifier = "static"
  custom_endpoint_type        = "READER"
  static_members              = [aws_rds_clusterinstance.test1.id, aws_rds_clusterinstance.test3.id]
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Cluster;
import com.pulumi.aws.rds.ClusterArgs;
import com.pulumi.aws.rds.ClusterInstance;
import com.pulumi.aws.rds.ClusterInstanceArgs;
import com.pulumi.aws.rds.ClusterEndpoint;
import com.pulumi.aws.rds.ClusterEndpointArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var default_ = new Cluster("default", ClusterArgs.builder()
            .clusterIdentifier("aurora-cluster-demo")
            .availabilityZones(
                "us-west-2a",
                "us-west-2b",
                "us-west-2c")
            .databaseName("mydb")
            .masterUsername("foo")
            .masterPassword("bar")
            .backupRetentionPeriod(5)
            .preferredBackupWindow("07:00-09:00")
            .build());

        var test1 = new ClusterInstance("test1", ClusterInstanceArgs.builder()
            .applyImmediately(true)
            .clusterIdentifier(default_.id())
            .identifier("test1")
            .instanceClass("db.t2.small")
            .engine(default_.engine())
            .engineVersion(default_.engineVersion())
            .build());

        var test2 = new ClusterInstance("test2", ClusterInstanceArgs.builder()
            .applyImmediately(true)
            .clusterIdentifier(default_.id())
            .identifier("test2")
            .instanceClass("db.t2.small")
            .engine(default_.engine())
            .engineVersion(default_.engineVersion())
            .build());

        var test3 = new ClusterInstance("test3", ClusterInstanceArgs.builder()
            .applyImmediately(true)
            .clusterIdentifier(default_.id())
            .identifier("test3")
            .instanceClass("db.t2.small")
            .engine(default_.engine())
            .engineVersion(default_.engineVersion())
            .build());

        var eligible = new ClusterEndpoint("eligible", ClusterEndpointArgs.builder()
            .clusterIdentifier(default_.id())
            .clusterEndpointIdentifier("reader")
            .customEndpointType("READER")
            .excludedMembers(
                test1.id(),
                test2.id())
            .build());

        var static_ = new ClusterEndpoint("static", ClusterEndpointArgs.builder()
            .clusterIdentifier(default_.id())
            .clusterEndpointIdentifier("static")
            .customEndpointType("READER")
            .staticMembers(
                test1.id(),
                test3.id())
            .build());

    }
}
resources:
  default:
    type: aws:rds:Cluster
    properties:
      clusterIdentifier: aurora-cluster-demo
      availabilityZones:
        - us-west-2a
        - us-west-2b
        - us-west-2c
      databaseName: mydb
      masterUsername: foo
      masterPassword: bar
      backupRetentionPeriod: 5
      preferredBackupWindow: 07:00-09:00
  test1:
    type: aws:rds:ClusterInstance
    properties:
      applyImmediately: true
      clusterIdentifier: ${default.id}
      identifier: test1
      instanceClass: db.t2.small
      engine: ${default.engine}
      engineVersion: ${default.engineVersion}
  test2:
    type: aws:rds:ClusterInstance
    properties:
      applyImmediately: true
      clusterIdentifier: ${default.id}
      identifier: test2
      instanceClass: db.t2.small
      engine: ${default.engine}
      engineVersion: ${default.engineVersion}
  test3:
    type: aws:rds:ClusterInstance
    properties:
      applyImmediately: true
      clusterIdentifier: ${default.id}
      identifier: test3
      instanceClass: db.t2.small
      engine: ${default.engine}
      engineVersion: ${default.engineVersion}
  eligible:
    type: aws:rds:ClusterEndpoint
    properties:
      clusterIdentifier: ${default.id}
      clusterEndpointIdentifier: reader
      customEndpointType: READER
      excludedMembers:
        - ${test1.id}
        - ${test2.id}
  static:
    type: aws:rds:ClusterEndpoint
    properties:
      clusterIdentifier: ${default.id}
      clusterEndpointIdentifier: static
      customEndpointType: READER
      staticMembers:
        - ${test1.id}
        - ${test3.id}

Import

Using pulumi import, import RDS Clusters Endpoint using the clusterEndpointIdentifier. For example:

$ pulumi import aws:rds/clusterEndpoint:ClusterEndpoint custom_reader aurora-prod-cluster-custom-reader

Constructors

ClusterEndpoint(String name, {ClusterEndpointArgs? args, CustomResourceOptions? options})
Creates a new ClusterEndpoint. name The Pulumi resource name. args Arguments used to configure this ClusterEndpoint. The set of arguments for ClusterEndpoint. options Resource options controlling this resource's behavior.
ClusterEndpoint.reference(String urn)
Creates a typed reference to an existing ClusterEndpoint resource.

Properties

arn ↔ Output<String>
ARN of cluster
latefinal
childResources → Set<Resource>
finalinherited
clusterEndpointIdentifier ↔ Output<String>
The identifier to use for the new endpoint. This parameter is stored as a lowercase string.
latefinal
clusterIdentifier ↔ Output<String>
The cluster identifier.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
customEndpointType ↔ Output<String>
The type of the endpoint. One of: READER , ANY .
latefinal
endpoint ↔ Output<String>
A custom endpoint for the Aurora cluster
latefinal
excludedMembers ↔ Output<List<String>?>
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 with staticMembers.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
staticMembers ↔ Output<List<String>?>
List of DB instance identifiers that are part of the custom endpoint group. Conflicts with excludedMembers.
latefinal
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. .If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ClusterEndpointState? state, CustomResourceOptions? options}) → ClusterEndpoint
Gets an existing ClusterEndpoint resource's state with the given name and id.