Class SecGroupRule
Manages a V2 neutron security group rule resource within OpenStack. Unlike Nova security groups, neutron separates the group from the rules and also allows an admin to target a specific tenant_id.
Example Usage
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var secgroup1 = new OpenStack.Networking.SecGroup("secgroup1", new OpenStack.Networking.SecGroupArgs
{
Description = "My neutron security group",
});
var secgroupRule1 = new OpenStack.Networking.SecGroupRule("secgroupRule1", new OpenStack.Networking.SecGroupRuleArgs
{
Direction = "ingress",
Ethertype = "IPv4",
PortRangeMax = 22,
PortRangeMin = 22,
Protocol = "tcp",
RemoteIpPrefix = "0.0.0.0/0",
SecurityGroupId = secgroup1.Id,
});
}
}
Inherited Members
Namespace: Pulumi.OpenStack.Networking
Assembly: Pulumi.OpenStack.dll
Syntax
public class SecGroupRule : CustomResource
Constructors
View SourceSecGroupRule(String, SecGroupRuleArgs, CustomResourceOptions)
Create a SecGroupRule resource with the given unique name, arguments, and options.
Declaration
public SecGroupRule(string name, SecGroupRuleArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SecGroupRuleArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
A description of the rule. Changing this creates a new security group rule.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Direction
The direction of the rule, valid values are ingress or egress. Changing this creates a new security group rule.
Declaration
public Output<string> Direction { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ethertype
The layer 3 protocol type, valid values are IPv4 or IPv6. Changing this creates a new security group rule.
Declaration
public Output<string> Ethertype { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PortRangeMax
The higher part of the allowed port range, valid integer value needs to be between 1 and 65535. Changing this creates a new security group rule.
Declaration
public Output<int> PortRangeMax { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
PortRangeMin
The lower part of the allowed port range, valid integer value needs to be between 1 and 65535. Changing this creates a new security group rule.
Declaration
public Output<int> PortRangeMin { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Protocol
The layer 4 protocol type, valid values are following. Changing this creates a new security group rule. This is required if you want to specify a port range.
- tcp
- udp
- icmp
- ah
- dccp
- egp
- esp
- gre
- igmp
- ipv6-encap
- ipv6-frag
- ipv6-icmp
- ipv6-nonxt
- ipv6-opts
- ipv6-route
- ospf
- pgm
- rsvp
- sctp
- udplite
- vrrp
Declaration
public Output<string> Protocol { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region in which to obtain the V2 networking client.
A networking client is needed to create a port. If omitted, the
region argument of the provider is used. Changing this creates a new
security group rule.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RemoteGroupId
The remote group id, the value needs to be an Openstack ID of a security group in the same tenant. Changing this creates a new security group rule.
Declaration
public Output<string> RemoteGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RemoteIpPrefix
The remote CIDR, the value needs to be a valid CIDR (i.e. 192.168.0.0/16). Changing this creates a new security group rule.
Declaration
public Output<string> RemoteIpPrefix { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecurityGroupId
The security group id the rule should belong to, the value needs to be an Openstack ID of a security group in the same tenant. Changing this creates a new security group rule.
Declaration
public Output<string> SecurityGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TenantId
The owner of the security group. Required if admin wants to create a port for another tenant. Changing this creates a new security group rule.
Declaration
public Output<string> TenantId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, SecGroupRuleState, CustomResourceOptions)
Get an existing SecGroupRule resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static SecGroupRule Get(string name, Input<string> id, SecGroupRuleState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SecGroupRuleState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| SecGroupRule |