class DatabaseProxyEndpoint (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.RDS.DatabaseProxyEndpoint |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsrds#DatabaseProxyEndpoint |
![]() | software.amazon.awscdk.services.rds.DatabaseProxyEndpoint |
![]() | aws_cdk.aws_rds.DatabaseProxyEndpoint |
![]() | aws-cdk-lib » aws_rds » DatabaseProxyEndpoint |
Implements
IConstruct
, IDependable
, IResource
, IDatabase
RDS Database Proxy Endpoint.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
declare const databaseProxy: rds.DatabaseProxy;
declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const databaseProxyEndpoint = new rds.DatabaseProxyEndpoint(this, 'MyDatabaseProxyEndpoint', {
dbProxy: databaseProxy,
vpc: vpc,
// the properties below are optional
dbProxyEndpointName: 'dbProxyEndpointName',
securityGroups: [securityGroup],
targetRole: rds.ProxyEndpointTargetRole.READ_WRITE,
vpcSubnets: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnets: [subnet],
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
});
Initializer
new DatabaseProxyEndpoint(scope: Construct, id: string, props: DatabaseProxyEndpointProps)
Parameters
- scope
Construct
- id
string
- props
Database
Proxy Endpoint Props
Construct Props
Name | Type | Description |
---|---|---|
db | IDatabase | The DB proxy associated with the DB proxy endpoint. |
vpc | IVpc | The VPC of the DB proxy endpoint. |
db | string | The name of the DB proxy endpoint. |
security | ISecurity [] | The VPC security groups to associate with the new proxy endpoint. |
target | Proxy | A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. |
vpc | Subnet | The subnets of DB proxy endpoint. |
dbProxy
Type:
IDatabase
The DB proxy associated with the DB proxy endpoint.
vpc
Type:
IVpc
The VPC of the DB proxy endpoint.
dbProxyEndpointName?
Type:
string
(optional, default: a CDK generated name)
The name of the DB proxy endpoint.
securityGroups?
Type:
ISecurity
[]
(optional, default: Default security group for the VPC)
The VPC security groups to associate with the new proxy endpoint.
targetRole?
Type:
Proxy
(optional, default: ProxyEndpointTargetRole.READ_WRITE)
A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.
vpcSubnets?
Type:
Subnet
(optional, default: the VPC default strategy if not specified.)
The subnets of DB proxy endpoint.
Properties
Name | Type | Description |
---|---|---|
db | string | DB Proxy Endpoint ARN. |
db | string | DB Proxy Endpoint Name. |
endpoint | string | The endpoint that you can use to connect to the DB proxy. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
dbProxyEndpointArn
Type:
string
DB Proxy Endpoint ARN.
dbProxyEndpointName
Type:
string
DB Proxy Endpoint Name.
endpoint
Type:
string
The endpoint that you can use to connect to the DB proxy.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import an existing database proxy endpoint. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromDatabaseProxyEndpointAttributes(scope, id, attrs)
public static fromDatabaseProxyEndpointAttributes(scope: Construct, id: string, attrs: DatabaseProxyEndpointAttributes): IDatabaseProxyEndpoint
Parameters
- scope
Construct
- id
string
- attrs
Database
Proxy Endpoint Attributes
Returns
Import an existing database proxy endpoint.