1. Packages
  2. Zscaler Private Access (ZPA)
  3. API Docs
  4. PolicyAccessReorderRule
Zscaler Private Access v0.0.10 published on Tuesday, Apr 9, 2024 by Zscaler

zpa.PolicyAccessReorderRule

Explore with Pulumi AI

zpa logo
Zscaler Private Access v0.0.10 published on Tuesday, Apr 9, 2024 by Zscaler

    The zpa_policy_access_rule_reorder is a dedicated resource to manage and update rule_orders in any of the supported ZPA Policy Access types Zscaler Private Access cloud.

    ⚠️ WARNING:: The attribute rule_order is now deprecated in favor of this resource for all ZPA policy types.

    Example Usage

    1

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.PolicyAccessRule;
    import com.pulumi.zpa.PolicyAccessRuleArgs;
    import com.pulumi.zpa.PolicyAccessReorderRule;
    import com.pulumi.zpa.PolicyAccessReorderRuleArgs;
    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 example001 = new PolicyAccessRule("example001", PolicyAccessRuleArgs.builder()        
                .description("example001")
                .action("ALLOW")
                .operator("AND")
                .policySetId(data.zpa_policy_type().access_policy().id())
                .build());
    
            var example002 = new PolicyAccessRule("example002", PolicyAccessRuleArgs.builder()        
                .description("example002")
                .action("ALLOW")
                .operator("AND")
                .policySetId(data.zpa_policy_type().access_policy().id())
                .build());
    
            final var ruleOrders =         
                Map.ofEntries(
                    Map.entry("id", example001.id()),
                    Map.entry("order", 1)
                ),
                Map.ofEntries(
                    Map.entry("id", example002.id()),
                    Map.entry("order", 2)
                );
    
            var accessPolicyReorder = new PolicyAccessReorderRule("accessPolicyReorder", PolicyAccessReorderRuleArgs.builder()        
                .policySetId(data.zpa_policy_type().access_policy().id())
                .policyType("ACCESS_POLICY")
                .dynamic(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build());
    
        }
    }
    
    resources:
      example001:
        type: zpa:PolicyAccessRule
        properties:
          description: example001
          action: ALLOW
          operator: AND
          policySetId: ${data.zpa_policy_type.access_policy.id}
      example002:
        type: zpa:PolicyAccessRule
        properties:
          description: example002
          action: ALLOW
          operator: AND
          policySetId: ${data.zpa_policy_type.access_policy.id}
      accessPolicyReorder:
        type: zpa:PolicyAccessReorderRule
        properties:
          policySetId: ${data.zpa_policy_type.access_policy.id}
          policyType: ACCESS_POLICY
          dynamic:
            - forEach: ${ruleOrders}
              content:
                - id: ${rules.value.id}
                  order: ${rules.value.order}
    variables:
      ruleOrders:
        - id: ${example001.id}
          order: 1
        - id: ${example002.id}
          order: 2
    

    2

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zpa.PolicyAccessRule;
    import com.pulumi.zpa.PolicyAccessRuleArgs;
    import com.pulumi.zpa.PolicyAccessReorderRule;
    import com.pulumi.zpa.PolicyAccessReorderRuleArgs;
    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 example001 = new PolicyAccessRule("example001", PolicyAccessRuleArgs.builder()        
                .description("example001")
                .action("ALLOW")
                .operator("AND")
                .build());
    
            var example002 = new PolicyAccessRule("example002", PolicyAccessRuleArgs.builder()        
                .description("example002")
                .action("ALLOW")
                .operator("AND")
                .build());
    
            // Define a map with rule names as keys and their desired order as values.
            final var ruleOrderMap = Map.ofEntries(
                Map.entry("example001", 1),
                Map.entry("example002", 2)
            );
    
            final var ruleOrders =         
                Map.ofEntries(
                    Map.entry("id", example001.id()),
                    Map.entry("order", ruleOrderMap["example001"])
                ),
                Map.ofEntries(
                    Map.entry("id", example002.id()),
                    Map.entry("order", ruleOrderMap["example002"])
                );
    
            var accessPolicyReorder = new PolicyAccessReorderRule("accessPolicyReorder", PolicyAccessReorderRuleArgs.builder()        
                .policyType("ACCESS_POLICY")
                .dynamic(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build());
    
        }
    }
    
    Coming soon!
    

    Create PolicyAccessReorderRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PolicyAccessReorderRule(name: string, args: PolicyAccessReorderRuleArgs, opts?: CustomResourceOptions);
    @overload
    def PolicyAccessReorderRule(resource_name: str,
                                args: PolicyAccessReorderRuleArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def PolicyAccessReorderRule(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                policy_type: Optional[str] = None,
                                rules: Optional[Sequence[PolicyAccessReorderRuleRuleArgs]] = None)
    func NewPolicyAccessReorderRule(ctx *Context, name string, args PolicyAccessReorderRuleArgs, opts ...ResourceOption) (*PolicyAccessReorderRule, error)
    public PolicyAccessReorderRule(string name, PolicyAccessReorderRuleArgs args, CustomResourceOptions? opts = null)
    public PolicyAccessReorderRule(String name, PolicyAccessReorderRuleArgs args)
    public PolicyAccessReorderRule(String name, PolicyAccessReorderRuleArgs args, CustomResourceOptions options)
    
    type: zpa:PolicyAccessReorderRule
    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 PolicyAccessReorderRuleArgs
    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 PolicyAccessReorderRuleArgs
    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 PolicyAccessReorderRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyAccessReorderRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyAccessReorderRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var policyAccessReorderRuleResource = new Zpa.PolicyAccessReorderRule("policyAccessReorderRuleResource", new()
    {
        PolicyType = "string",
        Rules = new[]
        {
            new Zpa.Inputs.PolicyAccessReorderRuleRuleArgs
            {
                Id = "string",
                Order = "string",
            },
        },
    });
    
    example, err := zpa.NewPolicyAccessReorderRule(ctx, "policyAccessReorderRuleResource", &zpa.PolicyAccessReorderRuleArgs{
    	PolicyType: pulumi.String("string"),
    	Rules: zpa.PolicyAccessReorderRuleRuleArray{
    		&zpa.PolicyAccessReorderRuleRuleArgs{
    			Id:    pulumi.String("string"),
    			Order: pulumi.String("string"),
    		},
    	},
    })
    
    var policyAccessReorderRuleResource = new PolicyAccessReorderRule("policyAccessReorderRuleResource", PolicyAccessReorderRuleArgs.builder()        
        .policyType("string")
        .rules(PolicyAccessReorderRuleRuleArgs.builder()
            .id("string")
            .order("string")
            .build())
        .build());
    
    policy_access_reorder_rule_resource = zpa.PolicyAccessReorderRule("policyAccessReorderRuleResource",
        policy_type="string",
        rules=[zpa.PolicyAccessReorderRuleRuleArgs(
            id="string",
            order="string",
        )])
    
    const policyAccessReorderRuleResource = new zpa.PolicyAccessReorderRule("policyAccessReorderRuleResource", {
        policyType: "string",
        rules: [{
            id: "string",
            order: "string",
        }],
    });
    
    type: zpa:PolicyAccessReorderRule
    properties:
        policyType: string
        rules:
            - id: string
              order: string
    

    PolicyAccessReorderRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PolicyAccessReorderRule resource accepts the following input properties:

    PolicyType string
    Rules []PolicyAccessReorderRuleRuleArgs
    List of rules and their orders
    policyType String
    rules List<PolicyAccessReorderRuleRule>
    List of rules and their orders
    policyType string
    rules PolicyAccessReorderRuleRule[]
    List of rules and their orders
    policyType String
    rules List<Property Map>
    List of rules and their orders

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PolicyAccessReorderRule 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 PolicyAccessReorderRule Resource

    Get an existing PolicyAccessReorderRule 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?: PolicyAccessReorderRuleState, opts?: CustomResourceOptions): PolicyAccessReorderRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_type: Optional[str] = None,
            rules: Optional[Sequence[PolicyAccessReorderRuleRuleArgs]] = None) -> PolicyAccessReorderRule
    func GetPolicyAccessReorderRule(ctx *Context, name string, id IDInput, state *PolicyAccessReorderRuleState, opts ...ResourceOption) (*PolicyAccessReorderRule, error)
    public static PolicyAccessReorderRule Get(string name, Input<string> id, PolicyAccessReorderRuleState? state, CustomResourceOptions? opts = null)
    public static PolicyAccessReorderRule get(String name, Output<String> id, PolicyAccessReorderRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    PolicyType string
    Rules []PolicyAccessReorderRuleRuleArgs
    List of rules and their orders
    policyType String
    rules List<PolicyAccessReorderRuleRule>
    List of rules and their orders
    policyType string
    rules PolicyAccessReorderRuleRule[]
    List of rules and their orders
    policyType String
    rules List<Property Map>
    List of rules and their orders

    Supporting Types

    PolicyAccessReorderRuleRule, PolicyAccessReorderRuleRuleArgs

    Id string
    Order string
    Id string
    Order string
    id String
    order String
    id string
    order string
    id str
    order str
    id String
    order String

    Package Details

    Repository
    zpa zscaler/pulumi-zpa
    License
    MIT
    Notes
    This Pulumi package is based on the zpa Terraform Provider.
    zpa logo
    Zscaler Private Access v0.0.10 published on Tuesday, Apr 9, 2024 by Zscaler