1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CynosdbSecurityGroup
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.CynosdbSecurityGroup

Explore with Pulumi AI

Provides a resource to create a cynosdb security_group

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const test = new tencentcloud.CynosdbSecurityGroup("test", {
    clusterId: "cynosdbmysql-bws8h88b",
    instanceGroupType: "RO",
    securityGroupIds: ["sg-baxfiao5"],
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

test = tencentcloud.CynosdbSecurityGroup("test",
    cluster_id="cynosdbmysql-bws8h88b",
    instance_group_type="RO",
    security_group_ids=["sg-baxfiao5"])
Copy
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.NewCynosdbSecurityGroup(ctx, "test", &tencentcloud.CynosdbSecurityGroupArgs{
			ClusterId:         pulumi.String("cynosdbmysql-bws8h88b"),
			InstanceGroupType: pulumi.String("RO"),
			SecurityGroupIds: pulumi.StringArray{
				pulumi.String("sg-baxfiao5"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var test = new Tencentcloud.CynosdbSecurityGroup("test", new()
    {
        ClusterId = "cynosdbmysql-bws8h88b",
        InstanceGroupType = "RO",
        SecurityGroupIds = new[]
        {
            "sg-baxfiao5",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CynosdbSecurityGroup;
import com.pulumi.tencentcloud.CynosdbSecurityGroupArgs;
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 test = new CynosdbSecurityGroup("test", CynosdbSecurityGroupArgs.builder()
            .clusterId("cynosdbmysql-bws8h88b")
            .instanceGroupType("RO")
            .securityGroupIds("sg-baxfiao5")
            .build());

    }
}
Copy
resources:
  test:
    type: tencentcloud:CynosdbSecurityGroup
    properties:
      clusterId: cynosdbmysql-bws8h88b
      instanceGroupType: RO
      securityGroupIds:
        - sg-baxfiao5
Copy

Create CynosdbSecurityGroup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new CynosdbSecurityGroup(name: string, args: CynosdbSecurityGroupArgs, opts?: CustomResourceOptions);
@overload
def CynosdbSecurityGroup(resource_name: str,
                         args: CynosdbSecurityGroupArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def CynosdbSecurityGroup(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cluster_id: Optional[str] = None,
                         instance_group_type: Optional[str] = None,
                         security_group_ids: Optional[Sequence[str]] = None,
                         cynosdb_security_group_id: Optional[str] = None)
func NewCynosdbSecurityGroup(ctx *Context, name string, args CynosdbSecurityGroupArgs, opts ...ResourceOption) (*CynosdbSecurityGroup, error)
public CynosdbSecurityGroup(string name, CynosdbSecurityGroupArgs args, CustomResourceOptions? opts = null)
public CynosdbSecurityGroup(String name, CynosdbSecurityGroupArgs args)
public CynosdbSecurityGroup(String name, CynosdbSecurityGroupArgs args, CustomResourceOptions options)
type: tencentcloud:CynosdbSecurityGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CynosdbSecurityGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CynosdbSecurityGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CynosdbSecurityGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CynosdbSecurityGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CynosdbSecurityGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CynosdbSecurityGroup 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 CynosdbSecurityGroup resource accepts the following input properties:

ClusterId This property is required. string
Cluster id.
InstanceGroupType This property is required. string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
SecurityGroupIds This property is required. List<string>
A list of security group IDs to be modified, an array of one or more security group IDs.
CynosdbSecurityGroupId string
ID of the resource.
ClusterId This property is required. string
Cluster id.
InstanceGroupType This property is required. string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
SecurityGroupIds This property is required. []string
A list of security group IDs to be modified, an array of one or more security group IDs.
CynosdbSecurityGroupId string
ID of the resource.
clusterId This property is required. String
Cluster id.
instanceGroupType This property is required. String
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds This property is required. List<String>
A list of security group IDs to be modified, an array of one or more security group IDs.
cynosdbSecurityGroupId String
ID of the resource.
clusterId This property is required. string
Cluster id.
instanceGroupType This property is required. string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds This property is required. string[]
A list of security group IDs to be modified, an array of one or more security group IDs.
cynosdbSecurityGroupId string
ID of the resource.
cluster_id This property is required. str
Cluster id.
instance_group_type This property is required. str
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
security_group_ids This property is required. Sequence[str]
A list of security group IDs to be modified, an array of one or more security group IDs.
cynosdb_security_group_id str
ID of the resource.
clusterId This property is required. String
Cluster id.
instanceGroupType This property is required. String
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds This property is required. List<String>
A list of security group IDs to be modified, an array of one or more security group IDs.
cynosdbSecurityGroupId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the CynosdbSecurityGroup 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 CynosdbSecurityGroup Resource

Get an existing CynosdbSecurityGroup 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?: CynosdbSecurityGroupState, opts?: CustomResourceOptions): CynosdbSecurityGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        cynosdb_security_group_id: Optional[str] = None,
        instance_group_type: Optional[str] = None,
        security_group_ids: Optional[Sequence[str]] = None) -> CynosdbSecurityGroup
func GetCynosdbSecurityGroup(ctx *Context, name string, id IDInput, state *CynosdbSecurityGroupState, opts ...ResourceOption) (*CynosdbSecurityGroup, error)
public static CynosdbSecurityGroup Get(string name, Input<string> id, CynosdbSecurityGroupState? state, CustomResourceOptions? opts = null)
public static CynosdbSecurityGroup get(String name, Output<String> id, CynosdbSecurityGroupState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:CynosdbSecurityGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
ClusterId string
Cluster id.
CynosdbSecurityGroupId string
ID of the resource.
InstanceGroupType string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
SecurityGroupIds List<string>
A list of security group IDs to be modified, an array of one or more security group IDs.
ClusterId string
Cluster id.
CynosdbSecurityGroupId string
ID of the resource.
InstanceGroupType string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
SecurityGroupIds []string
A list of security group IDs to be modified, an array of one or more security group IDs.
clusterId String
Cluster id.
cynosdbSecurityGroupId String
ID of the resource.
instanceGroupType String
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds List<String>
A list of security group IDs to be modified, an array of one or more security group IDs.
clusterId string
Cluster id.
cynosdbSecurityGroupId string
ID of the resource.
instanceGroupType string
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds string[]
A list of security group IDs to be modified, an array of one or more security group IDs.
cluster_id str
Cluster id.
cynosdb_security_group_id str
ID of the resource.
instance_group_type str
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
security_group_ids Sequence[str]
A list of security group IDs to be modified, an array of one or more security group IDs.
clusterId String
Cluster id.
cynosdbSecurityGroupId String
ID of the resource.
instanceGroupType String
Instance group type. Available values: -HA - HA group; -RO - Read-only group; -ALL - HA and RO group.
securityGroupIds List<String>
A list of security group IDs to be modified, an array of one or more security group IDs.

Import

cynosdb security_group can be imported using the id, e.g.

$ pulumi import tencentcloud:index/cynosdbSecurityGroup:CynosdbSecurityGroup security_group ${cluster_id}#${instance_group_type}
Copy

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.