Package com.pulumi.gcp.compute
Class OrganizationSecurityPolicyRule
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.compute.OrganizationSecurityPolicyRule
-
public class OrganizationSecurityPolicyRule extends com.pulumi.resources.CustomResource
A rule for the OrganizationSecurityPolicy. To get more information about OrganizationSecurityPolicyRule, see: * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies/addRule) * How-to Guides * [Creating firewall rules](https://cloud.google.com/vpc/docs/using-firewall-policies#create-rules) ## Example Usage ### Organization Security Policy Rule Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.OrganizationSecurityPolicy; import com.pulumi.gcp.compute.OrganizationSecurityPolicyArgs; import com.pulumi.gcp.compute.OrganizationSecurityPolicyRule; import com.pulumi.gcp.compute.OrganizationSecurityPolicyRuleArgs; import com.pulumi.gcp.compute.inputs.OrganizationSecurityPolicyRuleMatchArgs; import com.pulumi.gcp.compute.inputs.OrganizationSecurityPolicyRuleMatchConfigArgs; import com.pulumi.resources.CustomResourceOptions; 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 policyOrganizationSecurityPolicy = new OrganizationSecurityPolicy("policyOrganizationSecurityPolicy", OrganizationSecurityPolicyArgs.builder() .displayName("tf-test") .parent("organizations/123456789") .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var policyOrganizationSecurityPolicyRule = new OrganizationSecurityPolicyRule("policyOrganizationSecurityPolicyRule", OrganizationSecurityPolicyRuleArgs.builder() .policyId(policyOrganizationSecurityPolicy.id()) .action("allow") .direction("INGRESS") .enableLogging(true) .match(OrganizationSecurityPolicyRuleMatchArgs.builder() .config(OrganizationSecurityPolicyRuleMatchConfigArgs.builder() .srcIpRanges( "192.168.0.0/16", "10.0.0.0/8") .layer4Configs( OrganizationSecurityPolicyRuleMatchConfigLayer4ConfigArgs.builder() .ipProtocol("tcp") .ports("22") .build(), OrganizationSecurityPolicyRuleMatchConfigLayer4ConfigArgs.builder() .ipProtocol("icmp") .build()) .build()) .build()) .priority(100) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); } } ``` ## Import OrganizationSecurityPolicyRule can be imported using any of these accepted formats: ```sh $ pulumi import gcp:compute/organizationSecurityPolicyRule:OrganizationSecurityPolicyRule default {{policy_id}}/priority/{{priority}} ```
-
-
Constructor Summary
Constructors Constructor Description OrganizationSecurityPolicyRule(java.lang.String name)
OrganizationSecurityPolicyRule(java.lang.String name, OrganizationSecurityPolicyRuleArgs args)
OrganizationSecurityPolicyRule(java.lang.String name, OrganizationSecurityPolicyRuleArgs 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.lang.String>
action()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
description()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
direction()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
enableLogging()
static OrganizationSecurityPolicyRule
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OrganizationSecurityPolicyRuleState 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<OrganizationSecurityPolicyRuleMatch>
match()
com.pulumi.core.Output<java.lang.String>
policyId()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
preview()
com.pulumi.core.Output<java.lang.Integer>
priority()
com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>
targetResources()
com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>
targetServiceAccounts()
-
-
-
Constructor Detail
-
OrganizationSecurityPolicyRule
public OrganizationSecurityPolicyRule(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
OrganizationSecurityPolicyRule
public OrganizationSecurityPolicyRule(java.lang.String name, OrganizationSecurityPolicyRuleArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
OrganizationSecurityPolicyRule
public OrganizationSecurityPolicyRule(java.lang.String name, OrganizationSecurityPolicyRuleArgs 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
-
action
public com.pulumi.core.Output<java.lang.String> action()
- Returns:
- The Action to perform when the client connection triggers the rule. Can currently be either "allow", "deny" or "goto_next".
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- A description of the rule.
-
direction
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> direction()
- Returns:
- The direction in which this rule applies. If unspecified an INGRESS rule is created. Possible values are: `INGRESS`, `EGRESS`.
-
enableLogging
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableLogging()
- Returns:
- Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver.
-
match
public com.pulumi.core.Output<OrganizationSecurityPolicyRuleMatch> match()
- Returns:
- A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
-
policyId
public com.pulumi.core.Output<java.lang.String> policyId()
- Returns:
- The ID of the OrganizationSecurityPolicy this rule applies to.
-
preview
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> preview()
- Returns:
- If set to true, the specified action is not enforced.
-
priority
public com.pulumi.core.Output<java.lang.Integer> priority()
- Returns:
- An integer indicating the priority of a rule in the list. The priority must be a value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
-
targetResources
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetResources()
- Returns:
- A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
-
targetServiceAccounts
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> targetServiceAccounts()
- Returns:
- A list of service accounts indicating the sets of instances that are applied with this rule.
-
get
public static OrganizationSecurityPolicyRule get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable OrganizationSecurityPolicyRuleState 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.
-
-