tencentcloud.PostgresqlSecurityGroupConfig
Explore with Pulumi AI
Provides a resource to create a postgresql security_group_config
Example Usage
Set security group for the sepcified postgres instance
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const securityGroupConfig = new tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig", {
securityGroupIdSets: [
local.sg_id,
local.sg_id2,
],
dbInstanceId: local.pgsql_id,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
security_group_config = tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig",
security_group_id_sets=[
local["sg_id"],
local["sg_id2"],
],
db_instance_id=local["pgsql_id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewPostgresqlSecurityGroupConfig(ctx, "securityGroupConfig", &tencentcloud.PostgresqlSecurityGroupConfigArgs{
SecurityGroupIdSets: pulumi.StringArray{
local.Sg_id,
local.Sg_id2,
},
DbInstanceId: pulumi.Any(local.Pgsql_id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var securityGroupConfig = new Tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig", new()
{
SecurityGroupIdSets = new[]
{
local.Sg_id,
local.Sg_id2,
},
DbInstanceId = local.Pgsql_id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlSecurityGroupConfig;
import com.pulumi.tencentcloud.PostgresqlSecurityGroupConfigArgs;
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 securityGroupConfig = new PostgresqlSecurityGroupConfig("securityGroupConfig", PostgresqlSecurityGroupConfigArgs.builder()
.securityGroupIdSets(
local.sg_id(),
local.sg_id2())
.dbInstanceId(local.pgsql_id())
.build());
}
}
resources:
securityGroupConfig:
type: tencentcloud:PostgresqlSecurityGroupConfig
properties:
securityGroupIdSets:
- ${local.sg_id}
- ${local.sg_id2}
dbInstanceId: ${local.pgsql_id}
Set security group for the specified readonly group
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const group = new tencentcloud.PostgresqlReadonlyGroup("group", {
masterDbInstanceId: local.pgsql_id,
projectId: 0,
subnetId: local.subnet_id,
vpcId: local.vpc_id,
replayLagEliminate: 1,
replayLatencyEliminate: 1,
maxReplayLag: 100,
maxReplayLatency: 512,
minDelayEliminateReserve: 1,
});
const securityGroupConfig = new tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig", {
securityGroupIdSets: [
local.sg_id,
local.sg_id2,
],
readOnlyGroupId: group.postgresqlReadonlyGroupId,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
group = tencentcloud.PostgresqlReadonlyGroup("group",
master_db_instance_id=local["pgsql_id"],
project_id=0,
subnet_id=local["subnet_id"],
vpc_id=local["vpc_id"],
replay_lag_eliminate=1,
replay_latency_eliminate=1,
max_replay_lag=100,
max_replay_latency=512,
min_delay_eliminate_reserve=1)
security_group_config = tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig",
security_group_id_sets=[
local["sg_id"],
local["sg_id2"],
],
read_only_group_id=group.postgresql_readonly_group_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
group, err := tencentcloud.NewPostgresqlReadonlyGroup(ctx, "group", &tencentcloud.PostgresqlReadonlyGroupArgs{
MasterDbInstanceId: pulumi.Any(local.Pgsql_id),
ProjectId: pulumi.Float64(0),
SubnetId: pulumi.Any(local.Subnet_id),
VpcId: pulumi.Any(local.Vpc_id),
ReplayLagEliminate: pulumi.Float64(1),
ReplayLatencyEliminate: pulumi.Float64(1),
MaxReplayLag: pulumi.Float64(100),
MaxReplayLatency: pulumi.Float64(512),
MinDelayEliminateReserve: pulumi.Float64(1),
})
if err != nil {
return err
}
_, err = tencentcloud.NewPostgresqlSecurityGroupConfig(ctx, "securityGroupConfig", &tencentcloud.PostgresqlSecurityGroupConfigArgs{
SecurityGroupIdSets: pulumi.StringArray{
local.Sg_id,
local.Sg_id2,
},
ReadOnlyGroupId: group.PostgresqlReadonlyGroupId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var @group = new Tencentcloud.PostgresqlReadonlyGroup("group", new()
{
MasterDbInstanceId = local.Pgsql_id,
ProjectId = 0,
SubnetId = local.Subnet_id,
VpcId = local.Vpc_id,
ReplayLagEliminate = 1,
ReplayLatencyEliminate = 1,
MaxReplayLag = 100,
MaxReplayLatency = 512,
MinDelayEliminateReserve = 1,
});
var securityGroupConfig = new Tencentcloud.PostgresqlSecurityGroupConfig("securityGroupConfig", new()
{
SecurityGroupIdSets = new[]
{
local.Sg_id,
local.Sg_id2,
},
ReadOnlyGroupId = @group.PostgresqlReadonlyGroupId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlReadonlyGroup;
import com.pulumi.tencentcloud.PostgresqlReadonlyGroupArgs;
import com.pulumi.tencentcloud.PostgresqlSecurityGroupConfig;
import com.pulumi.tencentcloud.PostgresqlSecurityGroupConfigArgs;
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 group = new PostgresqlReadonlyGroup("group", PostgresqlReadonlyGroupArgs.builder()
.masterDbInstanceId(local.pgsql_id())
.projectId(0)
.subnetId(local.subnet_id())
.vpcId(local.vpc_id())
.replayLagEliminate(1)
.replayLatencyEliminate(1)
.maxReplayLag(100)
.maxReplayLatency(512)
.minDelayEliminateReserve(1)
.build());
var securityGroupConfig = new PostgresqlSecurityGroupConfig("securityGroupConfig", PostgresqlSecurityGroupConfigArgs.builder()
.securityGroupIdSets(
local.sg_id(),
local.sg_id2())
.readOnlyGroupId(group.postgresqlReadonlyGroupId())
.build());
}
}
resources:
group:
type: tencentcloud:PostgresqlReadonlyGroup
properties:
masterDbInstanceId: ${local.pgsql_id}
projectId: 0
subnetId: ${local.subnet_id}
vpcId: ${local.vpc_id}
replayLagEliminate: 1
replayLatencyEliminate: 1
maxReplayLag: 100
maxReplayLatency: 512
minDelayEliminateReserve: 1
securityGroupConfig:
type: tencentcloud:PostgresqlSecurityGroupConfig
properties:
securityGroupIdSets:
- ${local.sg_id}
- ${local.sg_id2}
readOnlyGroupId: ${group.postgresqlReadonlyGroupId}
Create PostgresqlSecurityGroupConfig Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostgresqlSecurityGroupConfig(name: string, args: PostgresqlSecurityGroupConfigArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlSecurityGroupConfig(resource_name: str,
args: PostgresqlSecurityGroupConfigArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostgresqlSecurityGroupConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
security_group_id_sets: Optional[Sequence[str]] = None,
db_instance_id: Optional[str] = None,
postgresql_security_group_config_id: Optional[str] = None,
read_only_group_id: Optional[str] = None)
func NewPostgresqlSecurityGroupConfig(ctx *Context, name string, args PostgresqlSecurityGroupConfigArgs, opts ...ResourceOption) (*PostgresqlSecurityGroupConfig, error)
public PostgresqlSecurityGroupConfig(string name, PostgresqlSecurityGroupConfigArgs args, CustomResourceOptions? opts = null)
public PostgresqlSecurityGroupConfig(String name, PostgresqlSecurityGroupConfigArgs args)
public PostgresqlSecurityGroupConfig(String name, PostgresqlSecurityGroupConfigArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlSecurityGroupConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PostgresqlSecurityGroupConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PostgresqlSecurityGroupConfigArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PostgresqlSecurityGroupConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresqlSecurityGroupConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresqlSecurityGroupConfigArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PostgresqlSecurityGroupConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PostgresqlSecurityGroupConfig resource accepts the following input properties:
- Security
Group List<string>Id Sets - Information of security groups in array.
- Db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- Postgresql
Security stringGroup Config Id - ID of the resource.
- Read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- Security
Group []stringId Sets - Information of security groups in array.
- Db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- Postgresql
Security stringGroup Config Id - ID of the resource.
- Read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group List<String>Id Sets - Information of security groups in array.
- db
Instance StringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security StringGroup Config Id - ID of the resource.
- read
Only StringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group string[]Id Sets - Information of security groups in array.
- db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security stringGroup Config Id - ID of the resource.
- read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security_
group_ Sequence[str]id_ sets - Information of security groups in array.
- db_
instance_ strid - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql_
security_ strgroup_ config_ id - ID of the resource.
- read_
only_ strgroup_ id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group List<String>Id Sets - Information of security groups in array.
- db
Instance StringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security StringGroup Config Id - ID of the resource.
- read
Only StringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresqlSecurityGroupConfig resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing PostgresqlSecurityGroupConfig Resource
Get an existing PostgresqlSecurityGroupConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PostgresqlSecurityGroupConfigState, opts?: CustomResourceOptions): PostgresqlSecurityGroupConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
db_instance_id: Optional[str] = None,
postgresql_security_group_config_id: Optional[str] = None,
read_only_group_id: Optional[str] = None,
security_group_id_sets: Optional[Sequence[str]] = None) -> PostgresqlSecurityGroupConfig
func GetPostgresqlSecurityGroupConfig(ctx *Context, name string, id IDInput, state *PostgresqlSecurityGroupConfigState, opts ...ResourceOption) (*PostgresqlSecurityGroupConfig, error)
public static PostgresqlSecurityGroupConfig Get(string name, Input<string> id, PostgresqlSecurityGroupConfigState? state, CustomResourceOptions? opts = null)
public static PostgresqlSecurityGroupConfig get(String name, Output<String> id, PostgresqlSecurityGroupConfigState state, CustomResourceOptions options)
resources: _: type: tencentcloud:PostgresqlSecurityGroupConfig get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- Postgresql
Security stringGroup Config Id - ID of the resource.
- Read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- Security
Group List<string>Id Sets - Information of security groups in array.
- Db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- Postgresql
Security stringGroup Config Id - ID of the resource.
- Read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- Security
Group []stringId Sets - Information of security groups in array.
- db
Instance StringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security StringGroup Config Id - ID of the resource.
- read
Only StringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group List<String>Id Sets - Information of security groups in array.
- db
Instance stringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security stringGroup Config Id - ID of the resource.
- read
Only stringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group string[]Id Sets - Information of security groups in array.
- db_
instance_ strid - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql_
security_ strgroup_ config_ id - ID of the resource.
- read_
only_ strgroup_ id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security_
group_ Sequence[str]id_ sets - Information of security groups in array.
- db
Instance StringId - Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored.
- postgresql
Security StringGroup Config Id - ID of the resource.
- read
Only StringGroup Id - RO group ID. Either this parameter or DBInstanceId must be passed in. To query the security groups associated with the RO groups, only pass in ReadOnlyGroupId.
- security
Group List<String>Id Sets - Information of security groups in array.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.