1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cloudfirewall
  5. ControlPolicyOrder
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.cloudfirewall.ControlPolicyOrder

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a Cloud Firewall Control Policy resource.

    For information about Cloud Firewall Control Policy Order and how to use it, see What is Control Policy Order.

    NOTE: Available in v1.130.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example1 = new alicloud.cloudfirewall.ControlPolicy("example1", {
        applicationName: "ANY",
        aclAction: "accept",
        description: "example",
        destinationType: "net",
        destination: "100.1.1.0/24",
        direction: "out",
        proto: "ANY",
        source: "1.2.3.0/24",
        sourceType: "net",
    });
    const example2 = new alicloud.cloudfirewall.ControlPolicyOrder("example2", {
        aclUuid: example1.aclUuid,
        direction: example1.direction,
        order: 1,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example1 = alicloud.cloudfirewall.ControlPolicy("example1",
        application_name="ANY",
        acl_action="accept",
        description="example",
        destination_type="net",
        destination="100.1.1.0/24",
        direction="out",
        proto="ANY",
        source="1.2.3.0/24",
        source_type="net")
    example2 = alicloud.cloudfirewall.ControlPolicyOrder("example2",
        acl_uuid=example1.acl_uuid,
        direction=example1.direction,
        order=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudfirewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example1, err := cloudfirewall.NewControlPolicy(ctx, "example1", &cloudfirewall.ControlPolicyArgs{
    			ApplicationName: pulumi.String("ANY"),
    			AclAction:       pulumi.String("accept"),
    			Description:     pulumi.String("example"),
    			DestinationType: pulumi.String("net"),
    			Destination:     pulumi.String("100.1.1.0/24"),
    			Direction:       pulumi.String("out"),
    			Proto:           pulumi.String("ANY"),
    			Source:          pulumi.String("1.2.3.0/24"),
    			SourceType:      pulumi.String("net"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfirewall.NewControlPolicyOrder(ctx, "example2", &cloudfirewall.ControlPolicyOrderArgs{
    			AclUuid:   example1.AclUuid,
    			Direction: example1.Direction,
    			Order:     pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example1 = new AliCloud.CloudFirewall.ControlPolicy("example1", new()
        {
            ApplicationName = "ANY",
            AclAction = "accept",
            Description = "example",
            DestinationType = "net",
            Destination = "100.1.1.0/24",
            Direction = "out",
            Proto = "ANY",
            Source = "1.2.3.0/24",
            SourceType = "net",
        });
    
        var example2 = new AliCloud.CloudFirewall.ControlPolicyOrder("example2", new()
        {
            AclUuid = example1.AclUuid,
            Direction = example1.Direction,
            Order = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cloudfirewall.ControlPolicy;
    import com.pulumi.alicloud.cloudfirewall.ControlPolicyArgs;
    import com.pulumi.alicloud.cloudfirewall.ControlPolicyOrder;
    import com.pulumi.alicloud.cloudfirewall.ControlPolicyOrderArgs;
    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 example1 = new ControlPolicy("example1", ControlPolicyArgs.builder()        
                .applicationName("ANY")
                .aclAction("accept")
                .description("example")
                .destinationType("net")
                .destination("100.1.1.0/24")
                .direction("out")
                .proto("ANY")
                .source("1.2.3.0/24")
                .sourceType("net")
                .build());
    
            var example2 = new ControlPolicyOrder("example2", ControlPolicyOrderArgs.builder()        
                .aclUuid(example1.aclUuid())
                .direction(example1.direction())
                .order(1)
                .build());
    
        }
    }
    
    resources:
      example1:
        type: alicloud:cloudfirewall:ControlPolicy
        properties:
          applicationName: ANY
          aclAction: accept
          description: example
          destinationType: net
          destination: 100.1.1.0/24
          direction: out
          proto: ANY
          source: 1.2.3.0/24
          sourceType: net
      example2:
        type: alicloud:cloudfirewall:ControlPolicyOrder
        properties:
          aclUuid: ${example1.aclUuid}
          direction: ${example1.direction}
          order: 1
    

    Create ControlPolicyOrder Resource

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

    Constructor syntax

    new ControlPolicyOrder(name: string, args: ControlPolicyOrderArgs, opts?: CustomResourceOptions);
    @overload
    def ControlPolicyOrder(resource_name: str,
                           args: ControlPolicyOrderArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ControlPolicyOrder(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           acl_uuid: Optional[str] = None,
                           direction: Optional[str] = None,
                           order: Optional[int] = None)
    func NewControlPolicyOrder(ctx *Context, name string, args ControlPolicyOrderArgs, opts ...ResourceOption) (*ControlPolicyOrder, error)
    public ControlPolicyOrder(string name, ControlPolicyOrderArgs args, CustomResourceOptions? opts = null)
    public ControlPolicyOrder(String name, ControlPolicyOrderArgs args)
    public ControlPolicyOrder(String name, ControlPolicyOrderArgs args, CustomResourceOptions options)
    
    type: alicloud:cloudfirewall:ControlPolicyOrder
    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 ControlPolicyOrderArgs
    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 ControlPolicyOrderArgs
    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 ControlPolicyOrderArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ControlPolicyOrderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ControlPolicyOrderArgs
    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 controlPolicyOrderResource = new AliCloud.CloudFirewall.ControlPolicyOrder("controlPolicyOrderResource", new()
    {
        AclUuid = "string",
        Direction = "string",
        Order = 0,
    });
    
    example, err := cloudfirewall.NewControlPolicyOrder(ctx, "controlPolicyOrderResource", &cloudfirewall.ControlPolicyOrderArgs{
    	AclUuid:   pulumi.String("string"),
    	Direction: pulumi.String("string"),
    	Order:     pulumi.Int(0),
    })
    
    var controlPolicyOrderResource = new ControlPolicyOrder("controlPolicyOrderResource", ControlPolicyOrderArgs.builder()        
        .aclUuid("string")
        .direction("string")
        .order(0)
        .build());
    
    control_policy_order_resource = alicloud.cloudfirewall.ControlPolicyOrder("controlPolicyOrderResource",
        acl_uuid="string",
        direction="string",
        order=0)
    
    const controlPolicyOrderResource = new alicloud.cloudfirewall.ControlPolicyOrder("controlPolicyOrderResource", {
        aclUuid: "string",
        direction: "string",
        order: 0,
    });
    
    type: alicloud:cloudfirewall:ControlPolicyOrder
    properties:
        aclUuid: string
        direction: string
        order: 0
    

    ControlPolicyOrder 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 ControlPolicyOrder resource accepts the following input properties:

    AclUuid string
    The unique ID of the access control policy.
    Direction string
    Direction. Valid values: in, out.
    Order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    AclUuid string
    The unique ID of the access control policy.
    Direction string
    Direction. Valid values: in, out.
    Order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid String
    The unique ID of the access control policy.
    direction String
    Direction. Valid values: in, out.
    order Integer
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid string
    The unique ID of the access control policy.
    direction string
    Direction. Valid values: in, out.
    order number
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    acl_uuid str
    The unique ID of the access control policy.
    direction str
    Direction. Valid values: in, out.
    order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid String
    The unique ID of the access control policy.
    direction String
    Direction. Valid values: in, out.
    order Number
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.

    Outputs

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

    Get an existing ControlPolicyOrder 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?: ControlPolicyOrderState, opts?: CustomResourceOptions): ControlPolicyOrder
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            acl_uuid: Optional[str] = None,
            direction: Optional[str] = None,
            order: Optional[int] = None) -> ControlPolicyOrder
    func GetControlPolicyOrder(ctx *Context, name string, id IDInput, state *ControlPolicyOrderState, opts ...ResourceOption) (*ControlPolicyOrder, error)
    public static ControlPolicyOrder Get(string name, Input<string> id, ControlPolicyOrderState? state, CustomResourceOptions? opts = null)
    public static ControlPolicyOrder get(String name, Output<String> id, ControlPolicyOrderState 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:
    AclUuid string
    The unique ID of the access control policy.
    Direction string
    Direction. Valid values: in, out.
    Order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    AclUuid string
    The unique ID of the access control policy.
    Direction string
    Direction. Valid values: in, out.
    Order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid String
    The unique ID of the access control policy.
    direction String
    Direction. Valid values: in, out.
    order Integer
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid string
    The unique ID of the access control policy.
    direction string
    Direction. Valid values: in, out.
    order number
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    acl_uuid str
    The unique ID of the access control policy.
    direction str
    Direction. Valid values: in, out.
    order int
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.
    aclUuid String
    The unique ID of the access control policy.
    direction String
    Direction. Valid values: in, out.
    order Number
    The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. NOTE: The value of -1 indicates the lowest priority.

    Import

    Cloud Firewall Control Policy Order can be imported using the id, e.g.

    $ pulumi import alicloud:cloudfirewall/controlPolicyOrder:ControlPolicyOrder example <acl_uuid>:<direction>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi