Proxy Target
Provides an RDS DB proxy target resource.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.Proxy;
import com.pulumi.aws.rds.ProxyArgs;
import com.pulumi.aws.rds.inputs.ProxyAuthArgs;
import com.pulumi.aws.rds.ProxyDefaultTargetGroup;
import com.pulumi.aws.rds.ProxyDefaultTargetGroupArgs;
import com.pulumi.aws.rds.inputs.ProxyDefaultTargetGroupConnectionPoolConfigArgs;
import com.pulumi.aws.rds.ProxyTarget;
import com.pulumi.aws.rds.ProxyTargetArgs;
import java.util.List;
import java.util.ArrayList;
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 exampleProxy = new Proxy("exampleProxy", ProxyArgs.builder()
.debugLogging(false)
.engineFamily("MYSQL")
.idleClientTimeout(1800)
.requireTls(true)
.roleArn(aws_iam_role.example().arn())
.vpcSecurityGroupIds(aws_security_group.example().id())
.vpcSubnetIds(aws_subnet.example().id())
.auths(ProxyAuthArgs.builder()
.authScheme("SECRETS")
.description("example")
.iamAuth("DISABLED")
.secretArn(aws_secretsmanager_secret.example().arn())
.build())
.tags(Map.ofEntries(
Map.entry("Name", "example"),
Map.entry("Key", "value")
))
.build());
var exampleProxyDefaultTargetGroup = new ProxyDefaultTargetGroup("exampleProxyDefaultTargetGroup", ProxyDefaultTargetGroupArgs.builder()
.dbProxyName(exampleProxy.name())
.connectionPoolConfig(ProxyDefaultTargetGroupConnectionPoolConfigArgs.builder()
.connectionBorrowTimeout(120)
.initQuery("SET x=1, y=2")
.maxConnectionsPercent(100)
.maxIdleConnectionsPercent(50)
.sessionPinningFilters("EXCLUDE_VARIABLE_SETS")
.build())
.build());
var exampleProxyTarget = new ProxyTarget("exampleProxyTarget", ProxyTargetArgs.builder()
.dbInstanceIdentifier(aws_db_instance.example().id())
.dbProxyName(exampleProxy.name())
.targetGroupName(exampleProxyDefaultTargetGroup.name())
.build());
}
}
Content copied to clipboard
Import
RDS DB Proxy Targets can be imported using the db_proxy_name
, target_group_name
, target type (e.g., RDS_INSTANCE
or TRACKED_CLUSTER
), and resource identifier separated by forward slashes (/
), e.g., Instances
$ pulumi import aws:rds/proxyTarget:ProxyTarget example example-proxy/default/RDS_INSTANCE/example-instance
Content copied to clipboard
Provisioned Clusters
$ pulumi import aws:rds/proxyTarget:ProxyTarget example example-proxy/default/TRACKED_CLUSTER/example-cluster
Content copied to clipboard
Properties
Link copied to clipboard
DB cluster identifier. NOTE: Either db_instance_identifier
or db_cluster_identifier
should be specified and both should not be specified together
Link copied to clipboard
DB instance identifier.
Link copied to clipboard
The name of the DB proxy.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Identifier representing the DB Instance or DB Cluster target.
Link copied to clipboard
The name of the target group.
Link copied to clipboard
DB Cluster identifier for the DB Instance target. Not returned unless manually importing an RDS_INSTANCE
target that is part of a DB Cluster.