1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. rocketmq
  5. AclRule
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi

alicloud.rocketmq.AclRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi

    Provides a Sag Acl Rule resource. This topic describes how to configure an access control list (ACL) rule for a target Smart Access Gateway instance to permit or deny access to or from specified IP addresses in the ACL rule.

    For information about Sag Acl Rule and how to use it, see What is access control list (ACL) rule.

    NOTE: Available since v1.60.0.

    NOTE: Only the following regions support create Cloud Connect Network. [cn-shanghai, cn-shanghai-finance-1, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1]

    Example Usage

    Basic Usage

    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") ?? "tf_example";
        var defaultAcl = new AliCloud.RocketMQ.Acl("defaultAcl");
    
        var defaultAclRule = new AliCloud.RocketMQ.AclRule("defaultAclRule", new()
        {
            AclId = defaultAcl.Id,
            Description = name,
            Policy = "accept",
            IpProtocol = "ALL",
            Direction = "in",
            SourceCidr = "10.10.1.0/24",
            SourcePortRange = "-1/-1",
            DestCidr = "192.168.1.0/24",
            DestPortRange = "-1/-1",
            Priority = 1,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
    	"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 := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultAcl, err := rocketmq.NewAcl(ctx, "defaultAcl", nil)
    		if err != nil {
    			return err
    		}
    		_, err = rocketmq.NewAclRule(ctx, "defaultAclRule", &rocketmq.AclRuleArgs{
    			AclId:           defaultAcl.ID(),
    			Description:     pulumi.String(name),
    			Policy:          pulumi.String("accept"),
    			IpProtocol:      pulumi.String("ALL"),
    			Direction:       pulumi.String("in"),
    			SourceCidr:      pulumi.String("10.10.1.0/24"),
    			SourcePortRange: pulumi.String("-1/-1"),
    			DestCidr:        pulumi.String("192.168.1.0/24"),
    			DestPortRange:   pulumi.String("-1/-1"),
    			Priority:        pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.rocketmq.Acl;
    import com.pulumi.alicloud.rocketmq.AclRule;
    import com.pulumi.alicloud.rocketmq.AclRuleArgs;
    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("tf_example");
            var defaultAcl = new Acl("defaultAcl");
    
            var defaultAclRule = new AclRule("defaultAclRule", AclRuleArgs.builder()        
                .aclId(defaultAcl.id())
                .description(name)
                .policy("accept")
                .ipProtocol("ALL")
                .direction("in")
                .sourceCidr("10.10.1.0/24")
                .sourcePortRange("-1/-1")
                .destCidr("192.168.1.0/24")
                .destPortRange("-1/-1")
                .priority("1")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    default_acl = alicloud.rocketmq.Acl("defaultAcl")
    default_acl_rule = alicloud.rocketmq.AclRule("defaultAclRule",
        acl_id=default_acl.id,
        description=name,
        policy="accept",
        ip_protocol="ALL",
        direction="in",
        source_cidr="10.10.1.0/24",
        source_port_range="-1/-1",
        dest_cidr="192.168.1.0/24",
        dest_port_range="-1/-1",
        priority=1)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_example";
    const defaultAcl = new alicloud.rocketmq.Acl("defaultAcl", {});
    const defaultAclRule = new alicloud.rocketmq.AclRule("defaultAclRule", {
        aclId: defaultAcl.id,
        description: name,
        policy: "accept",
        ipProtocol: "ALL",
        direction: "in",
        sourceCidr: "10.10.1.0/24",
        sourcePortRange: "-1/-1",
        destCidr: "192.168.1.0/24",
        destPortRange: "-1/-1",
        priority: 1,
    });
    
    configuration:
      name:
        type: string
        default: tf_example
    resources:
      defaultAcl:
        type: alicloud:rocketmq:Acl
      defaultAclRule:
        type: alicloud:rocketmq:AclRule
        properties:
          aclId: ${defaultAcl.id}
          description: ${name}
          policy: accept
          ipProtocol: ALL
          direction: in
          sourceCidr: 10.10.1.0/24
          sourcePortRange: -1/-1
          destCidr: 192.168.1.0/24
          destPortRange: -1/-1
          priority: '1'
    

    Create AclRule Resource

    new AclRule(name: string, args: AclRuleArgs, opts?: CustomResourceOptions);
    @overload
    def AclRule(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                acl_id: Optional[str] = None,
                description: Optional[str] = None,
                dest_cidr: Optional[str] = None,
                dest_port_range: Optional[str] = None,
                direction: Optional[str] = None,
                ip_protocol: Optional[str] = None,
                policy: Optional[str] = None,
                priority: Optional[int] = None,
                source_cidr: Optional[str] = None,
                source_port_range: Optional[str] = None)
    @overload
    def AclRule(resource_name: str,
                args: AclRuleArgs,
                opts: Optional[ResourceOptions] = None)
    func NewAclRule(ctx *Context, name string, args AclRuleArgs, opts ...ResourceOption) (*AclRule, error)
    public AclRule(string name, AclRuleArgs args, CustomResourceOptions? opts = null)
    public AclRule(String name, AclRuleArgs args)
    public AclRule(String name, AclRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:rocketmq:AclRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args AclRuleArgs
    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 AclRuleArgs
    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 AclRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AclRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AclRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    AclId string

    The ID of the ACL.

    DestCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    DestPortRange string

    The range of the destination port. Valid value: 80/80.

    Direction string

    The direction of the ACL rule. Valid values: in|out.

    IpProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    Policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    SourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    SourcePortRange string

    The range of the source port. Valid value: 80/80.

    Description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    Priority int

    The priority of the ACL rule. Value range: 1 to 100.

    AclId string

    The ID of the ACL.

    DestCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    DestPortRange string

    The range of the destination port. Valid value: 80/80.

    Direction string

    The direction of the ACL rule. Valid values: in|out.

    IpProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    Policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    SourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    SourcePortRange string

    The range of the source port. Valid value: 80/80.

    Description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    Priority int

    The priority of the ACL rule. Value range: 1 to 100.

    aclId String

    The ID of the ACL.

    destCidr String

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange String

    The range of the destination port. Valid value: 80/80.

    direction String

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol String

    The protocol used by the ACL rule. The value is not case sensitive.

    policy String

    The policy used by the ACL rule. Valid values: accept|drop.

    sourceCidr String

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange String

    The range of the source port. Valid value: 80/80.

    description String

    The description of the ACL rule. It must be 1 to 512 characters in length.

    priority Integer

    The priority of the ACL rule. Value range: 1 to 100.

    aclId string

    The ID of the ACL.

    destCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange string

    The range of the destination port. Valid value: 80/80.

    direction string

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    sourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange string

    The range of the source port. Valid value: 80/80.

    description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    priority number

    The priority of the ACL rule. Value range: 1 to 100.

    acl_id str

    The ID of the ACL.

    dest_cidr str

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    dest_port_range str

    The range of the destination port. Valid value: 80/80.

    direction str

    The direction of the ACL rule. Valid values: in|out.

    ip_protocol str

    The protocol used by the ACL rule. The value is not case sensitive.

    policy str

    The policy used by the ACL rule. Valid values: accept|drop.

    source_cidr str

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    source_port_range str

    The range of the source port. Valid value: 80/80.

    description str

    The description of the ACL rule. It must be 1 to 512 characters in length.

    priority int

    The priority of the ACL rule. Value range: 1 to 100.

    aclId String

    The ID of the ACL.

    destCidr String

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange String

    The range of the destination port. Valid value: 80/80.

    direction String

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol String

    The protocol used by the ACL rule. The value is not case sensitive.

    policy String

    The policy used by the ACL rule. Valid values: accept|drop.

    sourceCidr String

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange String

    The range of the source port. Valid value: 80/80.

    description String

    The description of the ACL rule. It must be 1 to 512 characters in length.

    priority Number

    The priority of the ACL rule. Value range: 1 to 100.

    Outputs

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

    Get an existing AclRule 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?: AclRuleState, opts?: CustomResourceOptions): AclRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            acl_id: Optional[str] = None,
            description: Optional[str] = None,
            dest_cidr: Optional[str] = None,
            dest_port_range: Optional[str] = None,
            direction: Optional[str] = None,
            ip_protocol: Optional[str] = None,
            policy: Optional[str] = None,
            priority: Optional[int] = None,
            source_cidr: Optional[str] = None,
            source_port_range: Optional[str] = None) -> AclRule
    func GetAclRule(ctx *Context, name string, id IDInput, state *AclRuleState, opts ...ResourceOption) (*AclRule, error)
    public static AclRule Get(string name, Input<string> id, AclRuleState? state, CustomResourceOptions? opts = null)
    public static AclRule get(String name, Output<String> id, AclRuleState 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:
    AclId string

    The ID of the ACL.

    Description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    DestCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    DestPortRange string

    The range of the destination port. Valid value: 80/80.

    Direction string

    The direction of the ACL rule. Valid values: in|out.

    IpProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    Policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    Priority int

    The priority of the ACL rule. Value range: 1 to 100.

    SourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    SourcePortRange string

    The range of the source port. Valid value: 80/80.

    AclId string

    The ID of the ACL.

    Description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    DestCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    DestPortRange string

    The range of the destination port. Valid value: 80/80.

    Direction string

    The direction of the ACL rule. Valid values: in|out.

    IpProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    Policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    Priority int

    The priority of the ACL rule. Value range: 1 to 100.

    SourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    SourcePortRange string

    The range of the source port. Valid value: 80/80.

    aclId String

    The ID of the ACL.

    description String

    The description of the ACL rule. It must be 1 to 512 characters in length.

    destCidr String

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange String

    The range of the destination port. Valid value: 80/80.

    direction String

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol String

    The protocol used by the ACL rule. The value is not case sensitive.

    policy String

    The policy used by the ACL rule. Valid values: accept|drop.

    priority Integer

    The priority of the ACL rule. Value range: 1 to 100.

    sourceCidr String

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange String

    The range of the source port. Valid value: 80/80.

    aclId string

    The ID of the ACL.

    description string

    The description of the ACL rule. It must be 1 to 512 characters in length.

    destCidr string

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange string

    The range of the destination port. Valid value: 80/80.

    direction string

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol string

    The protocol used by the ACL rule. The value is not case sensitive.

    policy string

    The policy used by the ACL rule. Valid values: accept|drop.

    priority number

    The priority of the ACL rule. Value range: 1 to 100.

    sourceCidr string

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange string

    The range of the source port. Valid value: 80/80.

    acl_id str

    The ID of the ACL.

    description str

    The description of the ACL rule. It must be 1 to 512 characters in length.

    dest_cidr str

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    dest_port_range str

    The range of the destination port. Valid value: 80/80.

    direction str

    The direction of the ACL rule. Valid values: in|out.

    ip_protocol str

    The protocol used by the ACL rule. The value is not case sensitive.

    policy str

    The policy used by the ACL rule. Valid values: accept|drop.

    priority int

    The priority of the ACL rule. Value range: 1 to 100.

    source_cidr str

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    source_port_range str

    The range of the source port. Valid value: 80/80.

    aclId String

    The ID of the ACL.

    description String

    The description of the ACL rule. It must be 1 to 512 characters in length.

    destCidr String

    The destination address. It is an IPv4 address range in CIDR format. Default value: 0.0.0.0/0.

    destPortRange String

    The range of the destination port. Valid value: 80/80.

    direction String

    The direction of the ACL rule. Valid values: in|out.

    ipProtocol String

    The protocol used by the ACL rule. The value is not case sensitive.

    policy String

    The policy used by the ACL rule. Valid values: accept|drop.

    priority Number

    The priority of the ACL rule. Value range: 1 to 100.

    sourceCidr String

    The source address. It is an IPv4 address range in the CIDR format. Default value: 0.0.0.0/0.

    sourcePortRange String

    The range of the source port. Valid value: 80/80.

    Import

    The Sag Acl Rule can be imported using the id, e.g.

     $ pulumi import alicloud:rocketmq/aclRule:AclRule example acr-abc123456
    

    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.43.1 published on Monday, Sep 11, 2023 by Pulumi