Skip to content
v2.277.0

DatabaseProxyEndpointOptions Struct ​

Options for a new DatabaseProxyEndpoint.

Example ​

ts
declare const vpc: ec2.Vpc;
declare const secrets: secretsmanager.Secret[];
declare const dbInstance: rds.DatabaseInstance;

const proxy = dbInstance.addProxy('Proxy', {
  secrets,
  vpc,
});

// Add a reader endpoint
proxy.addEndpoint('ProxyEndpoint', {
  vpc,
  targetRole: rds.ProxyEndpointTargetRole.READ_ONLY,
});
python
# vpc: ec2.Vpc
# secrets: List[secretsmanager.Secret[]]
# db_instance: rds.DatabaseInstance


proxy = db_instance.add_proxy("Proxy",
    secrets=secrets,
    vpc=vpc
)

# Add a reader endpoint
proxy.add_endpoint("ProxyEndpoint",
    vpc=vpc,
    target_role=rds.ProxyEndpointTargetRole.READ_ONLY
)
java
Vpc vpc;
Secret[] secrets;
DatabaseInstance dbInstance;


DatabaseProxy proxy = dbInstance.addProxy("Proxy", DatabaseProxyOptions.builder()
        .secrets(secrets)
        .vpc(vpc)
        .build());

// Add a reader endpoint
proxy.addEndpoint("ProxyEndpoint", DatabaseProxyEndpointOptions.builder()
        .vpc(vpc)
        .targetRole(ProxyEndpointTargetRole.READ_ONLY)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;
Secret[] secrets;
DatabaseInstance dbInstance;


var proxy = dbInstance.AddProxy("Proxy", new DatabaseProxyOptions {
    Secrets = secrets,
    Vpc = vpc
});

// Add a reader endpoint
proxy.AddEndpoint("ProxyEndpoint", new DatabaseProxyEndpointOptions {
    Vpc = vpc,
    TargetRole = ProxyEndpointTargetRole.READ_ONLY
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc
var secrets []Secret
var dbInstance DatabaseInstance


proxy := dbInstance.AddProxy(jsii.String("Proxy"), &DatabaseProxyOptions{
	Secrets: Secrets,
	Vpc: Vpc,
})

// Add a reader endpoint
proxy.AddEndpoint(jsii.String("ProxyEndpoint"), &DatabaseProxyEndpointOptions{
	Vpc: Vpc,
	TargetRole: rds.ProxyEndpointTargetRole_READ_ONLY,
})

Properties ​

dbProxyEndpointNameoptionalstringdb_proxy_endpoint_nameoptionalstrdbProxyEndpointNameoptionalStringDbProxyEndpointNameoptionalstringDbProxyEndpointNameoptional*string #
The name of the DB proxy endpoint.

Default: a CDK generated name

securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup #
The VPC security groups to associate with the new proxy endpoint.

Default: Default security group for the VPC

targetRoleoptionalProxyEndpointTargetRoletarget_roleoptionalProxyEndpointTargetRoletargetRoleoptionalProxyEndpointTargetRoleTargetRoleoptionalProxyEndpointTargetRoleTargetRoleoptionalProxyEndpointTargetRole #
A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.

Default: ProxyEndpointTargetRole.READ_WRITE

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc required #
The VPC of the DB proxy endpoint.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection #
The subnets of DB proxy endpoint.

Default: the VPC default strategy if not specified.