Class ProxyTarget
Proxy target: Instance or Cluster.
Inheritance
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ProxyTarget : DeputyBase
Syntax (vb)
Public Class ProxyTarget
Inherits DeputyBase
Remarks
A target group is a collection of databases that the proxy can connect to. Currently, you can specify only one RDS DB instance or Aurora DB cluster.
ExampleMetadata: infused
Examples
Vpc vpc;
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps {
Version = AuroraMysqlEngineVersion.VER_3_03_0
}),
Writer = ClusterInstance.Provisioned("writer"),
Vpc = vpc
});
var proxy = new DatabaseProxy(this, "Proxy", new DatabaseProxyProps {
ProxyTarget = ProxyTarget.FromCluster(cluster),
Secrets = new [] { cluster.Secret },
Vpc = vpc
});
var role = new Role(this, "DBProxyRole", new RoleProps { AssumedBy = new AccountPrincipal(Account) });
proxy.GrantConnect(role, "admin");
Synopsis
Constructors
ProxyTarget(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ProxyTarget(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(DatabaseProxy) | Bind this target to the specified database proxy. |
FromCluster(IDatabaseCluster) | From cluster. |
FromInstance(IDatabaseInstance) | From instance. |
Constructors
ProxyTarget(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ProxyTarget(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ProxyTarget(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ProxyTarget(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(DatabaseProxy)
Bind this target to the specified database proxy.
public virtual IProxyTargetConfig Bind(DatabaseProxy proxy)
Parameters
- proxy DatabaseProxy
Returns
FromCluster(IDatabaseCluster)
From cluster.
public static ProxyTarget FromCluster(IDatabaseCluster cluster)
Parameters
- cluster IDatabaseCluster
RDS database cluster.
Returns
FromInstance(IDatabaseInstance)
From instance.
public static ProxyTarget FromInstance(IDatabaseInstance instance)
Parameters
- instance IDatabaseInstance
RDS database instance.
Returns