SecurityGroupRule
Create a SecurityGroupRule Resource
new SecurityGroupRule(name: string, args: SecurityGroupRuleArgs, opts?: CustomResourceOptions);def SecurityGroupRule(resource_name, opts=None, cidr_ip=None, description=None, ip_protocol=None, nic_type=None, policy=None, port_range=None, priority=None, security_group_id=None, source_group_owner_account=None, source_security_group_id=None, type=None, __props__=None);func NewSecurityGroupRule(ctx *Context, name string, args SecurityGroupRuleArgs, opts ...ResourceOption) (*SecurityGroupRule, error)public SecurityGroupRule(string name, SecurityGroupRuleArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
SecurityGroupRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The SecurityGroupRule resource accepts the following input properties:
- Ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- Security
Group stringId The security group to apply this rule to.
- Type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).- Cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- Description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- Nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- Policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- Port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- Priority int
Authorization policy priority, with parameter values:
1-100, default value: 1.- Source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- Source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.
- Ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- Security
Group stringId The security group to apply this rule to.
- Type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).- Cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- Description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- Nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- Policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- Port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- Priority int
Authorization policy priority, with parameter values:
1-100, default value: 1.- Source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- Source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.
- ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- security
Group stringId The security group to apply this rule to.
- type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).- cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- priority number
Authorization policy priority, with parameter values:
1-100, default value: 1.- source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.
- ip_
protocol str The protocol. Can be
tcp,udp,icmp,greorall.- security_
group_ strid The security group to apply this rule to.
- type str
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).- cidr_
ip str The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- description str
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- nic_
type str Network type, can be either
internetorintranet, the default value isinternet.- policy str
Authorization policy, can be either
acceptordrop, the default value isaccept.- port_
range str The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- priority float
Authorization policy priority, with parameter values:
1-100, default value: 1.- source_
group_ strowner_ account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- source_
security_ strgroup_ id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityGroupRule resource produces the following output properties:
Look up an 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): SecurityGroupRulestatic get(resource_name, id, opts=None, cidr_ip=None, description=None, ip_protocol=None, nic_type=None, policy=None, port_range=None, priority=None, security_group_id=None, source_group_owner_account=None, source_security_group_id=None, type=None, __props__=None);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)- 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.
The following state arguments are supported:
- Cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- Description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- Ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- Nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- Policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- Port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- Priority int
Authorization policy priority, with parameter values:
1-100, default value: 1.- Security
Group stringId The security group to apply this rule to.
- Source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- Source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.- Type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).
- Cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- Description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- Ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- Nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- Policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- Port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- Priority int
Authorization policy priority, with parameter values:
1-100, default value: 1.- Security
Group stringId The security group to apply this rule to.
- Source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- Source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.- Type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).
- cidr
Ip string The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- description string
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- ip
Protocol string The protocol. Can be
tcp,udp,icmp,greorall.- nic
Type string Network type, can be either
internetorintranet, the default value isinternet.- policy string
Authorization policy, can be either
acceptordrop, the default value isaccept.- port
Range string The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- priority number
Authorization policy priority, with parameter values:
1-100, default value: 1.- security
Group stringId The security group to apply this rule to.
- source
Group stringOwner Account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- source
Security stringGroup Id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.- type string
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).
- cidr_
ip str The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.
- description str
The description of the security group rule. The description can be up to 1 to 512 characters in length. Defaults to null.
- ip_
protocol str The protocol. Can be
tcp,udp,icmp,greorall.- nic_
type str Network type, can be either
internetorintranet, the default value isinternet.- policy str
Authorization policy, can be either
acceptordrop, the default value isaccept.- port_
range str The range of port numbers relevant to the IP protocol. Default to “-1/-1”. When the protocol is tcp or udp, each side port number range from 1 to 65535 and ‘-1/-1’ will be invalid. For example,
1/200means that the range of the port numbers is 1-200. Other protocols’ ‘port_range’ can only be “-1/-1”, and other values will be invalid.- priority float
Authorization policy priority, with parameter values:
1-100, default value: 1.- security_
group_ strid The security group to apply this rule to.
- source_
group_ strowner_ account The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid if
cidr_iphas already been set.- source_
security_ strgroup_ id The target security group ID within the same region. If this field is specified, the
nic_typecan only selectintranet.- type str
The type of rule being created. Valid options are
ingress(inbound) oregress(outbound).
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.