tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.SecurityGroupRule
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
Create SecurityGroupRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityGroupRule(name: string, args: SecurityGroupRuleArgs, opts?: CustomResourceOptions);
@overload
def SecurityGroupRule(resource_name: str,
args: SecurityGroupRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityGroupRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
policy: Optional[str] = None,
security_group_id: Optional[str] = None,
type: Optional[str] = None,
address_template: Optional[SecurityGroupRuleAddressTemplateArgs] = None,
cidr_ip: Optional[str] = None,
description: Optional[str] = None,
ip_protocol: Optional[str] = None,
policy_index: Optional[float] = None,
port_range: Optional[str] = None,
protocol_template: Optional[SecurityGroupRuleProtocolTemplateArgs] = None,
security_group_rule_id: Optional[str] = None,
source_sgid: Optional[str] = None)
func NewSecurityGroupRule(ctx *Context, name string, args SecurityGroupRuleArgs, opts ...ResourceOption) (*SecurityGroupRule, error)
public SecurityGroupRule(string name, SecurityGroupRuleArgs args, CustomResourceOptions? opts = null)
public SecurityGroupRule(String name, SecurityGroupRuleArgs args)
public SecurityGroupRule(String name, SecurityGroupRuleArgs args, CustomResourceOptions options)
type: tencentcloud:SecurityGroupRule
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 SecurityGroupRuleArgs
- 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 SecurityGroupRuleArgs
- 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 SecurityGroupRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGroupRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityGroupRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
SecurityGroupRule 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 SecurityGroupRule resource accepts the following input properties:
- Policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - Security
Group stringId - ID of the security group to be queried.
- Type string
- Type of the security group rule. Valid values:
ingress
andegress
. - Address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - Cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - Description string
- Description of the security group rule.
- Ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - Policy
Index double - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- Port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - Protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - Security
Group stringRule Id - Source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
- Policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - Security
Group stringId - ID of the security group to be queried.
- Type string
- Type of the security group rule. Valid values:
ingress
andegress
. - Address
Template SecurityGroup Rule Address Template Args - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - Cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - Description string
- Description of the security group rule.
- Ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - Policy
Index float64 - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- Port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - Protocol
Template SecurityGroup Rule Protocol Template Args - ID of the address template, and conflict with
ip_protocol
,port_range
. - Security
Group stringRule Id - Source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
- policy String
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - security
Group StringId - ID of the security group to be queried.
- type String
- Type of the security group rule. Valid values:
ingress
andegress
. - address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip String - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description String
- Description of the security group rule.
- ip
Protocol String - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy
Index Double - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range String - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group StringRule Id - source
Sgid String - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
- policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - security
Group stringId - ID of the security group to be queried.
- type string
- Type of the security group rule. Valid values:
ingress
andegress
. - address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description string
- Description of the security group rule.
- ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy
Index number - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group stringRule Id - source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
- policy str
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - security_
group_ strid - ID of the security group to be queried.
- type str
- Type of the security group rule. Valid values:
ingress
andegress
. - address_
template SecurityGroup Rule Address Template Args - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr_
ip str - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description str
- Description of the security group rule.
- ip_
protocol str - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy_
index float - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port_
range str - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol_
template SecurityGroup Rule Protocol Template Args - ID of the address template, and conflict with
ip_protocol
,port_range
. - security_
group_ strrule_ id - source_
sgid str - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
- policy String
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - security
Group StringId - ID of the security group to be queried.
- type String
- Type of the security group rule. Valid values:
ingress
andegress
. - address
Template Property Map - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip String - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description String
- Description of the security group rule.
- ip
Protocol String - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy
Index Number - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range String - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template Property Map - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group StringRule Id - source
Sgid String - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityGroupRule 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 SecurityGroupRule Resource
Get an existing SecurityGroupRule 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?: SecurityGroupRuleState, opts?: CustomResourceOptions): SecurityGroupRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_template: Optional[SecurityGroupRuleAddressTemplateArgs] = None,
cidr_ip: Optional[str] = None,
description: Optional[str] = None,
ip_protocol: Optional[str] = None,
policy: Optional[str] = None,
policy_index: Optional[float] = None,
port_range: Optional[str] = None,
protocol_template: Optional[SecurityGroupRuleProtocolTemplateArgs] = None,
security_group_id: Optional[str] = None,
security_group_rule_id: Optional[str] = None,
source_sgid: Optional[str] = None,
type: Optional[str] = None) -> SecurityGroupRule
func GetSecurityGroupRule(ctx *Context, name string, id IDInput, state *SecurityGroupRuleState, opts ...ResourceOption) (*SecurityGroupRule, error)
public static SecurityGroupRule Get(string name, Input<string> id, SecurityGroupRuleState? state, CustomResourceOptions? opts = null)
public static SecurityGroupRule get(String name, Output<String> id, SecurityGroupRuleState state, CustomResourceOptions options)
resources: _: type: tencentcloud:SecurityGroupRule 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.
- Address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - Cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - Description string
- Description of the security group rule.
- Ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - Policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - Policy
Index double - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- Port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - Protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - Security
Group stringId - ID of the security group to be queried.
- Security
Group stringRule Id - Source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - Type string
- Type of the security group rule. Valid values:
ingress
andegress
.
- Address
Template SecurityGroup Rule Address Template Args - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - Cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - Description string
- Description of the security group rule.
- Ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - Policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - Policy
Index float64 - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- Port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - Protocol
Template SecurityGroup Rule Protocol Template Args - ID of the address template, and conflict with
ip_protocol
,port_range
. - Security
Group stringId - ID of the security group to be queried.
- Security
Group stringRule Id - Source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - Type string
- Type of the security group rule. Valid values:
ingress
andegress
.
- address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip String - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description String
- Description of the security group rule.
- ip
Protocol String - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy String
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - policy
Index Double - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range String - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group StringId - ID of the security group to be queried.
- security
Group StringRule Id - source
Sgid String - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - type String
- Type of the security group rule. Valid values:
ingress
andegress
.
- address
Template SecurityGroup Rule Address Template - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip string - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description string
- Description of the security group rule.
- ip
Protocol string - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy string
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - policy
Index number - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range string - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template SecurityGroup Rule Protocol Template - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group stringId - ID of the security group to be queried.
- security
Group stringRule Id - source
Sgid string - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - type string
- Type of the security group rule. Valid values:
ingress
andegress
.
- address_
template SecurityGroup Rule Address Template Args - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr_
ip str - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description str
- Description of the security group rule.
- ip_
protocol str - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy str
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - policy_
index float - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port_
range str - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol_
template SecurityGroup Rule Protocol Template Args - ID of the address template, and conflict with
ip_protocol
,port_range
. - security_
group_ strid - ID of the security group to be queried.
- security_
group_ strrule_ id - source_
sgid str - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - type str
- Type of the security group rule. Valid values:
ingress
andegress
.
- address
Template Property Map - ID of the address template, and confilicts with
source_sgid
andcidr_ip
. - cidr
Ip String - An IP address network or segment, and conflict with
source_sgid
andaddress_template
. - description String
- Description of the security group rule.
- ip
Protocol String - Type of IP protocol. Valid values:
TCP
,UDP
,ICMP
,ICMPv6
andALL
. Default to all types protocol, and conflicts withprotocol_template
. - policy String
- Rule policy of security group. Valid values:
ACCEPT
andDROP
. - policy
Index Number - The security group rule index number, the value of which dynamically changes as the security group rule changes.
- port
Range String - Range of the port. The available value can be one, multiple or one segment. E.g.
80
,80,90
and80-90
. Default to all ports, and confilicts withprotocol_template
. - protocol
Template Property Map - ID of the address template, and conflict with
ip_protocol
,port_range
. - security
Group StringId - ID of the security group to be queried.
- security
Group StringRule Id - source
Sgid String - ID of the nested security group, and conflicts with
cidr_ip
andaddress_template
. - type String
- Type of the security group rule. Valid values:
ingress
andegress
.
Supporting Types
SecurityGroupRuleAddressTemplate, SecurityGroupRuleAddressTemplateArgs
- Group
Id string - Address template group ID, conflicts with
template_id
. - Template
Id string - Address template ID, conflicts with
group_id
.
- Group
Id string - Address template group ID, conflicts with
template_id
. - Template
Id string - Address template ID, conflicts with
group_id
.
- group
Id String - Address template group ID, conflicts with
template_id
. - template
Id String - Address template ID, conflicts with
group_id
.
- group
Id string - Address template group ID, conflicts with
template_id
. - template
Id string - Address template ID, conflicts with
group_id
.
- group_
id str - Address template group ID, conflicts with
template_id
. - template_
id str - Address template ID, conflicts with
group_id
.
- group
Id String - Address template group ID, conflicts with
template_id
. - template
Id String - Address template ID, conflicts with
group_id
.
SecurityGroupRuleProtocolTemplate, SecurityGroupRuleProtocolTemplateArgs
- Group
Id string - Address template group ID, conflicts with
template_id
. - Template
Id string - Address template ID, conflicts with
group_id
.
- Group
Id string - Address template group ID, conflicts with
template_id
. - Template
Id string - Address template ID, conflicts with
group_id
.
- group
Id String - Address template group ID, conflicts with
template_id
. - template
Id String - Address template ID, conflicts with
group_id
.
- group
Id string - Address template group ID, conflicts with
template_id
. - template
Id string - Address template ID, conflicts with
group_id
.
- group_
id str - Address template group ID, conflicts with
template_id
. - template_
id str - Address template ID, conflicts with
group_id
.
- group
Id String - Address template group ID, conflicts with
template_id
. - template
Id String - Address template ID, conflicts with
group_id
.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack