1. Packages
  2. Alicloud Provider
  3. API Docs
  4. cloudfirewall
  5. ControlPolicyOrder
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.cloudfirewall.ControlPolicyOrder

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    Provides a Cloud Firewall Control Policy Order resource.

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

    NOTE: Available since v1.130.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.cloudfirewall.ControlPolicy("default", {
        direction: "in",
        applicationName: "ANY",
        description: name,
        aclAction: "accept",
        source: "127.0.0.1/32",
        sourceType: "net",
        destination: "127.0.0.2/32",
        destinationType: "net",
        proto: "ANY",
    });
    const defaultControlPolicyOrder = new alicloud.cloudfirewall.ControlPolicyOrder("default", {
        aclUuid: _default.aclUuid,
        direction: _default.direction,
        order: 1,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.cloudfirewall.ControlPolicy("default",
        direction="in",
        application_name="ANY",
        description=name,
        acl_action="accept",
        source="127.0.0.1/32",
        source_type="net",
        destination="127.0.0.2/32",
        destination_type="net",
        proto="ANY")
    default_control_policy_order = alicloud.cloudfirewall.ControlPolicyOrder("default",
        acl_uuid=default.acl_uuid,
        direction=default.direction,
        order=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudfirewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := cloudfirewall.NewControlPolicy(ctx, "default", &cloudfirewall.ControlPolicyArgs{
    			Direction:       pulumi.String("in"),
    			ApplicationName: pulumi.String("ANY"),
    			Description:     pulumi.String(name),
    			AclAction:       pulumi.String("accept"),
    			Source:          pulumi.String("127.0.0.1/32"),
    			SourceType:      pulumi.String("net"),
    			Destination:     pulumi.String("127.0.0.2/32"),
    			DestinationType: pulumi.String("net"),
    			Proto:           pulumi.String("ANY"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfirewall.NewControlPolicyOrder(ctx, "default", &cloudfirewall.ControlPolicyOrderArgs{
    			AclUuid:   _default.AclUuid,
    			Direction: _default.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 config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.CloudFirewall.ControlPolicy("default", new()
        {
            Direction = "in",
            ApplicationName = "ANY",
            Description = name,
            AclAction = "accept",
            Source = "127.0.0.1/32",
            SourceType = "net",
            Destination = "127.0.0.2/32",
            DestinationType = "net",
            Proto = "ANY",
        });
    
        var defaultControlPolicyOrder = new AliCloud.CloudFirewall.ControlPolicyOrder("default", new()
        {
            AclUuid = @default.AclUuid,
            Direction = @default.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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new ControlPolicy("default", ControlPolicyArgs.builder()
                .direction("in")
                .applicationName("ANY")
                .description(name)
                .aclAction("accept")
                .source("127.0.0.1/32")
                .sourceType("net")
                .destination("127.0.0.2/32")
                .destinationType("net")
                .proto("ANY")
                .build());
    
            var defaultControlPolicyOrder = new ControlPolicyOrder("defaultControlPolicyOrder", ControlPolicyOrderArgs.builder()
                .aclUuid(default_.aclUuid())
                .direction(default_.direction())
                .order(1)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:cloudfirewall:ControlPolicy
        properties:
          direction: in
          applicationName: ANY
          description: ${name}
          aclAction: accept
          source: 127.0.0.1/32
          sourceType: net
          destination: 127.0.0.2/32
          destinationType: net
          proto: ANY
      defaultControlPolicyOrder:
        type: alicloud:cloudfirewall:ControlPolicyOrder
        name: default
        properties:
          aclUuid: ${default.aclUuid}
          direction: ${default.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.

    Constructor 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
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    AclUuid string
    The unique ID of the access control policy.
    Direction string
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid String
    The unique ID of the access control policy.
    direction String
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid string
    The unique ID of the access control policy.
    direction string
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    acl_uuid str
    The unique ID of the access control policy.
    direction str
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid String
    The unique ID of the access control policy.
    direction String
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    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
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    AclUuid string
    The unique ID of the access control policy.
    Direction string
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid String
    The unique ID of the access control policy.
    direction String
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid string
    The unique ID of the access control policy.
    direction string
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    acl_uuid str
    The unique ID of the access control policy.
    direction str
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    aclUuid String
    The unique ID of the access control policy.
    direction String
    The direction of the traffic to which the access control policy applies. 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.

    NOTE: From version 1.227.1, order must be set.

    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.63.0 published on Monday, Sep 30, 2024 by Pulumi