DatabaseProxyEndpointOptions

class aws_cdk.aws_rds.DatabaseProxyEndpointOptions(*, vpc, db_proxy_endpoint_name=None, security_groups=None, target_role=None, vpc_subnets=None)

Bases: object

Options for a new DatabaseProxyEndpoint.

Parameters:
  • vpc (IVpc) – The VPC of the DB proxy endpoint.

  • db_proxy_endpoint_name (Optional[str]) – The name of the DB proxy endpoint. Default: - a CDK generated name

  • security_groups (Optional[Sequence[ISecurityGroup]]) – The VPC security groups to associate with the new proxy endpoint. Default: - Default security group for the VPC

  • target_role (Optional[ProxyEndpointTargetRole]) – A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. Default: - ProxyEndpointTargetRole.READ_WRITE

  • vpc_subnets (Union[SubnetSelection, Dict[str, Any], None]) – The subnets of DB proxy endpoint. Default: - the VPC default strategy if not specified.

ExampleMetadata:

infused

Example:

# 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
)

Attributes

db_proxy_endpoint_name

The name of the DB proxy endpoint.

Default:
  • a CDK generated name

security_groups

The VPC security groups to associate with the new proxy endpoint.

Default:
  • Default security group for the VPC

target_role

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

Default:
  • ProxyEndpointTargetRole.READ_WRITE

vpc

The VPC of the DB proxy endpoint.

vpc_subnets

The subnets of DB proxy endpoint.

Default:
  • the VPC default strategy if not specified.