Package com.pulumi.openstack.networking
Class SecGroupRule
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.openstack.networking.SecGroupRule
-
public class SecGroupRule extends com.pulumi.resources.CustomResourceManages 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 ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.networking.SecGroup; import com.pulumi.openstack.networking.SecGroupArgs; import com.pulumi.openstack.networking.SecGroupRule; import com.pulumi.openstack.networking.SecGroupRuleArgs; 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 secgroup1 = new SecGroup("secgroup1", SecGroupArgs.builder() .description("My neutron security group") .build()); var secgroupRule1 = new SecGroupRule("secgroupRule1", SecGroupRuleArgs.builder() .direction("ingress") .ethertype("IPv4") .protocol("tcp") .portRangeMin(22) .portRangeMax(22) .remoteIpPrefix("0.0.0.0/0") .securityGroupId(secgroup1.id()) .build()); } } ``` ## Import Security Group Rules can be imported using the `id`, e.g. ```sh $ pulumi import openstack:networking/secGroupRule:SecGroupRule secgroup_rule_1 aeb68ee3-6e9d-4256-955c-9584a6212745 ```
-
-
Constructor Summary
Constructors Constructor Description SecGroupRule(java.lang.String name)SecGroupRule(java.lang.String name, SecGroupRuleArgs args)SecGroupRule(java.lang.String name, SecGroupRuleArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.String>>description()com.pulumi.core.Output<java.lang.String>direction()com.pulumi.core.Output<java.lang.String>ethertype()static SecGroupRuleget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SecGroupRuleState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.Integer>portRangeMax()com.pulumi.core.Output<java.lang.Integer>portRangeMin()com.pulumi.core.Output<java.lang.String>protocol()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>remoteGroupId()com.pulumi.core.Output<java.lang.String>remoteIpPrefix()com.pulumi.core.Output<java.lang.String>securityGroupId()com.pulumi.core.Output<java.lang.String>tenantId()
-
-
-
Constructor Detail
-
SecGroupRule
public SecGroupRule(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
SecGroupRule
public SecGroupRule(java.lang.String name, SecGroupRuleArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
SecGroupRule
public SecGroupRule(java.lang.String name, SecGroupRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- A description of the rule. Changing this creates a new security group rule.
-
direction
public com.pulumi.core.Output<java.lang.String> direction()
- Returns:
- The direction of the rule, valid values are __ingress__ or __egress__. Changing this creates a new security group rule.
-
ethertype
public com.pulumi.core.Output<java.lang.String> ethertype()
- Returns:
- The layer 3 protocol type, valid values are __IPv4__ or __IPv6__. Changing this creates a new security group rule.
-
portRangeMax
public com.pulumi.core.Output<java.lang.Integer> portRangeMax()
- Returns:
- 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.
-
portRangeMin
public com.pulumi.core.Output<java.lang.Integer> portRangeMin()
- Returns:
- 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.
-
protocol
public com.pulumi.core.Output<java.lang.String> protocol()
- Returns:
- 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__
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- 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.
-
remoteGroupId
public com.pulumi.core.Output<java.lang.String> remoteGroupId()
- Returns:
- 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.
-
remoteIpPrefix
public com.pulumi.core.Output<java.lang.String> remoteIpPrefix()
- Returns:
- 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.
-
securityGroupId
public com.pulumi.core.Output<java.lang.String> securityGroupId()
- Returns:
- 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.
-
tenantId
public com.pulumi.core.Output<java.lang.String> tenantId()
- Returns:
- 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.
-
get
public static SecGroupRule get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable SecGroupRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-