tencentcloud.PostgresqlParameters
Explore with Pulumi AI
Use this resource to create postgresql parameter.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const defaultAz = config.get("defaultAz") || "ap-guangzhou-3";
const gz3 = tencentcloud.getVpcSubnets({
availabilityZone: defaultAz,
isDefault: true,
});
const vpcId = gz3.then(gz3 => gz3.instanceLists?.[0]?.vpcId);
const subnetId = gz3.then(gz3 => gz3.instanceLists?.[0]?.subnetId);
const zone = tencentcloud.getAvailabilityZonesByProduct({
product: "postgres",
});
const test = new tencentcloud.PostgresqlInstance("test", {
availabilityZone: defaultAz,
chargeType: "POSTPAID_BY_HOUR",
period: 1,
vpcId: vpcId,
subnetId: subnetId,
engineVersion: "13.3",
rootPassword: "t1qaA2k1wgvfa3?ZZZ",
securityGroups: ["sg-5275dorp"],
charset: "LATIN1",
projectId: 0,
memory: 2,
storage: 20,
});
const postgresqlParameters = new tencentcloud.PostgresqlParameters("postgresqlParameters", {
dbInstanceId: test.postgresqlInstanceId,
paramLists: [{
expectedValue: "off",
name: "check_function_bodies",
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
default_az = config.get("defaultAz")
if default_az is None:
default_az = "ap-guangzhou-3"
gz3 = tencentcloud.get_vpc_subnets(availability_zone=default_az,
is_default=True)
vpc_id = gz3.instance_lists[0].vpc_id
subnet_id = gz3.instance_lists[0].subnet_id
zone = tencentcloud.get_availability_zones_by_product(product="postgres")
test = tencentcloud.PostgresqlInstance("test",
availability_zone=default_az,
charge_type="POSTPAID_BY_HOUR",
period=1,
vpc_id=vpc_id,
subnet_id=subnet_id,
engine_version="13.3",
root_password="t1qaA2k1wgvfa3?ZZZ",
security_groups=["sg-5275dorp"],
charset="LATIN1",
project_id=0,
memory=2,
storage=20)
postgresql_parameters = tencentcloud.PostgresqlParameters("postgresqlParameters",
db_instance_id=test.postgresql_instance_id,
param_lists=[{
"expected_value": "off",
"name": "check_function_bodies",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
defaultAz := "ap-guangzhou-3"
if param := cfg.Get("defaultAz"); param != "" {
defaultAz = param
}
gz3, err := tencentcloud.GetVpcSubnets(ctx, &tencentcloud.GetVpcSubnetsArgs{
AvailabilityZone: pulumi.StringRef(defaultAz),
IsDefault: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
vpcId := gz3.InstanceLists[0].VpcId
subnetId := gz3.InstanceLists[0].SubnetId
_, err = tencentcloud.GetAvailabilityZonesByProduct(ctx, &tencentcloud.GetAvailabilityZonesByProductArgs{
Product: "postgres",
}, nil)
if err != nil {
return err
}
test, err := tencentcloud.NewPostgresqlInstance(ctx, "test", &tencentcloud.PostgresqlInstanceArgs{
AvailabilityZone: pulumi.String(defaultAz),
ChargeType: pulumi.String("POSTPAID_BY_HOUR"),
Period: pulumi.Float64(1),
VpcId: pulumi.String(vpcId),
SubnetId: pulumi.String(subnetId),
EngineVersion: pulumi.String("13.3"),
RootPassword: pulumi.String("t1qaA2k1wgvfa3?ZZZ"),
SecurityGroups: pulumi.StringArray{
pulumi.String("sg-5275dorp"),
},
Charset: pulumi.String("LATIN1"),
ProjectId: pulumi.Float64(0),
Memory: pulumi.Float64(2),
Storage: pulumi.Float64(20),
})
if err != nil {
return err
}
_, err = tencentcloud.NewPostgresqlParameters(ctx, "postgresqlParameters", &tencentcloud.PostgresqlParametersArgs{
DbInstanceId: test.PostgresqlInstanceId,
ParamLists: tencentcloud.PostgresqlParametersParamListArray{
&tencentcloud.PostgresqlParametersParamListArgs{
ExpectedValue: pulumi.String("off"),
Name: pulumi.String("check_function_bodies"),
},
},
})
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 config = new Config();
var defaultAz = config.Get("defaultAz") ?? "ap-guangzhou-3";
var gz3 = Tencentcloud.GetVpcSubnets.Invoke(new()
{
AvailabilityZone = defaultAz,
IsDefault = true,
});
var vpcId = gz3.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.VpcId);
var subnetId = gz3.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.SubnetId);
var zone = Tencentcloud.GetAvailabilityZonesByProduct.Invoke(new()
{
Product = "postgres",
});
var test = new Tencentcloud.PostgresqlInstance("test", new()
{
AvailabilityZone = defaultAz,
ChargeType = "POSTPAID_BY_HOUR",
Period = 1,
VpcId = vpcId,
SubnetId = subnetId,
EngineVersion = "13.3",
RootPassword = "t1qaA2k1wgvfa3?ZZZ",
SecurityGroups = new[]
{
"sg-5275dorp",
},
Charset = "LATIN1",
ProjectId = 0,
Memory = 2,
Storage = 20,
});
var postgresqlParameters = new Tencentcloud.PostgresqlParameters("postgresqlParameters", new()
{
DbInstanceId = test.PostgresqlInstanceId,
ParamLists = new[]
{
new Tencentcloud.Inputs.PostgresqlParametersParamListArgs
{
ExpectedValue = "off",
Name = "check_function_bodies",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetVpcSubnetsArgs;
import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesByProductArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.PostgresqlParameters;
import com.pulumi.tencentcloud.PostgresqlParametersArgs;
import com.pulumi.tencentcloud.inputs.PostgresqlParametersParamListArgs;
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) {
final var config = ctx.config();
final var defaultAz = config.get("defaultAz").orElse("ap-guangzhou-3");
final var gz3 = TencentcloudFunctions.getVpcSubnets(GetVpcSubnetsArgs.builder()
.availabilityZone(defaultAz)
.isDefault(true)
.build());
final var vpcId = gz3.applyValue(getVpcSubnetsResult -> getVpcSubnetsResult.instanceLists()[0].vpcId());
final var subnetId = gz3.applyValue(getVpcSubnetsResult -> getVpcSubnetsResult.instanceLists()[0].subnetId());
final var zone = TencentcloudFunctions.getAvailabilityZonesByProduct(GetAvailabilityZonesByProductArgs.builder()
.product("postgres")
.build());
var test = new PostgresqlInstance("test", PostgresqlInstanceArgs.builder()
.availabilityZone(defaultAz)
.chargeType("POSTPAID_BY_HOUR")
.period(1)
.vpcId(vpcId)
.subnetId(subnetId)
.engineVersion("13.3")
.rootPassword("t1qaA2k1wgvfa3?ZZZ")
.securityGroups("sg-5275dorp")
.charset("LATIN1")
.projectId(0)
.memory(2)
.storage(20)
.build());
var postgresqlParameters = new PostgresqlParameters("postgresqlParameters", PostgresqlParametersArgs.builder()
.dbInstanceId(test.postgresqlInstanceId())
.paramLists(PostgresqlParametersParamListArgs.builder()
.expectedValue("off")
.name("check_function_bodies")
.build())
.build());
}
}
configuration:
defaultAz:
type: string
default: ap-guangzhou-3
resources:
test:
type: tencentcloud:PostgresqlInstance
properties:
availabilityZone: ${defaultAz}
chargeType: POSTPAID_BY_HOUR
period: 1
vpcId: ${vpcId}
subnetId: ${subnetId}
engineVersion: '13.3'
rootPassword: t1qaA2k1wgvfa3?ZZZ
securityGroups:
- sg-5275dorp
charset: LATIN1
projectId: 0
memory: 2
storage: 20
postgresqlParameters:
type: tencentcloud:PostgresqlParameters
properties:
dbInstanceId: ${test.postgresqlInstanceId}
paramLists:
- expectedValue: off
name: check_function_bodies
variables:
gz3:
fn::invoke:
function: tencentcloud:getVpcSubnets
arguments:
availabilityZone: ${defaultAz}
isDefault: true
vpcId: ${gz3.instanceLists[0].vpcId}
subnetId: ${gz3.instanceLists[0].subnetId}
zone:
fn::invoke:
function: tencentcloud:getAvailabilityZonesByProduct
arguments:
product: postgres
Create PostgresqlParameters Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PostgresqlParameters(name: string, args: PostgresqlParametersArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlParameters(resource_name: str,
args: PostgresqlParametersArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PostgresqlParameters(resource_name: str,
opts: Optional[ResourceOptions] = None,
db_instance_id: Optional[str] = None,
param_lists: Optional[Sequence[PostgresqlParametersParamListArgs]] = None,
postgresql_parameters_id: Optional[str] = None)
func NewPostgresqlParameters(ctx *Context, name string, args PostgresqlParametersArgs, opts ...ResourceOption) (*PostgresqlParameters, error)
public PostgresqlParameters(string name, PostgresqlParametersArgs args, CustomResourceOptions? opts = null)
public PostgresqlParameters(String name, PostgresqlParametersArgs args)
public PostgresqlParameters(String name, PostgresqlParametersArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlParameters
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 PostgresqlParametersArgs
- 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 PostgresqlParametersArgs
- 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 PostgresqlParametersArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresqlParametersArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresqlParametersArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PostgresqlParameters 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 PostgresqlParameters resource accepts the following input properties:
- Db
Instance stringId - Instance ID.
- Param
Lists List<PostgresqlParameters Param List> - Parameters to be modified and expected values.
- Postgresql
Parameters stringId - ID of the resource.
- Db
Instance stringId - Instance ID.
- Param
Lists []PostgresqlParameters Param List Args - Parameters to be modified and expected values.
- Postgresql
Parameters stringId - ID of the resource.
- db
Instance StringId - Instance ID.
- param
Lists List<PostgresqlParameters Param List> - Parameters to be modified and expected values.
- postgresql
Parameters StringId - ID of the resource.
- db
Instance stringId - Instance ID.
- param
Lists PostgresqlParameters Param List[] - Parameters to be modified and expected values.
- postgresql
Parameters stringId - ID of the resource.
- db_
instance_ strid - Instance ID.
- param_
lists Sequence[PostgresqlParameters Param List Args] - Parameters to be modified and expected values.
- postgresql_
parameters_ strid - ID of the resource.
- db
Instance StringId - Instance ID.
- param
Lists List<Property Map> - Parameters to be modified and expected values.
- postgresql
Parameters StringId - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the PostgresqlParameters 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 PostgresqlParameters Resource
Get an existing PostgresqlParameters 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?: PostgresqlParametersState, opts?: CustomResourceOptions): PostgresqlParameters
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
db_instance_id: Optional[str] = None,
param_lists: Optional[Sequence[PostgresqlParametersParamListArgs]] = None,
postgresql_parameters_id: Optional[str] = None) -> PostgresqlParameters
func GetPostgresqlParameters(ctx *Context, name string, id IDInput, state *PostgresqlParametersState, opts ...ResourceOption) (*PostgresqlParameters, error)
public static PostgresqlParameters Get(string name, Input<string> id, PostgresqlParametersState? state, CustomResourceOptions? opts = null)
public static PostgresqlParameters get(String name, Output<String> id, PostgresqlParametersState state, CustomResourceOptions options)
resources: _: type: tencentcloud:PostgresqlParameters 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.
- Param
Lists List<PostgresqlParameters Param List> - Parameters to be modified and expected values.
- Postgresql
Parameters stringId - ID of the resource.
- Db
Instance stringId - Instance ID.
- Param
Lists []PostgresqlParameters Param List Args - Parameters to be modified and expected values.
- Postgresql
Parameters stringId - ID of the resource.
- db
Instance StringId - Instance ID.
- param
Lists List<PostgresqlParameters Param List> - Parameters to be modified and expected values.
- postgresql
Parameters StringId - ID of the resource.
- db
Instance stringId - Instance ID.
- param
Lists PostgresqlParameters Param List[] - Parameters to be modified and expected values.
- postgresql
Parameters stringId - ID of the resource.
- db_
instance_ strid - Instance ID.
- param_
lists Sequence[PostgresqlParameters Param List Args] - Parameters to be modified and expected values.
- postgresql_
parameters_ strid - ID of the resource.
- db
Instance StringId - Instance ID.
- param
Lists List<Property Map> - Parameters to be modified and expected values.
- postgresql
Parameters StringId - ID of the resource.
Supporting Types
PostgresqlParametersParamList, PostgresqlParametersParamListArgs
- Expected
Value string - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - Name string
- Parameter name.
- Default
Value string - The default value of the parameter. Returned as a string.
- Param
Description stringCh - Parameter Chinese Description.
- Param
Description stringEn - Parameter English Description.
- Expected
Value string - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - Name string
- Parameter name.
- Default
Value string - The default value of the parameter. Returned as a string.
- Param
Description stringCh - Parameter Chinese Description.
- Param
Description stringEn - Parameter English Description.
- expected
Value String - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - name String
- Parameter name.
- default
Value String - The default value of the parameter. Returned as a string.
- param
Description StringCh - Parameter Chinese Description.
- param
Description StringEn - Parameter English Description.
- expected
Value string - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - name string
- Parameter name.
- default
Value string - The default value of the parameter. Returned as a string.
- param
Description stringCh - Parameter Chinese Description.
- param
Description stringEn - Parameter English Description.
- expected_
value str - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - name str
- Parameter name.
- default_
value str - The default value of the parameter. Returned as a string.
- param_
description_ strch - Parameter Chinese Description.
- param_
description_ stren - Parameter English Description.
- expected
Value String - The new value to which the parameter will be modified. When this parameter is used as an input parameter, its value must be a string, such as
0.1
(decimal),1000
(integer), andreplica
(enum). - name String
- Parameter name.
- default
Value String - The default value of the parameter. Returned as a string.
- param
Description StringCh - Parameter Chinese Description.
- param
Description StringEn - Parameter English Description.
Import
postgresql parameters can be imported, e.g.
$ pulumi import tencentcloud:index/postgresqlParameters:PostgresqlParameters example pgrogrp-lckioi2a
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.