Show / Hide Table of Contents

Class NetworkAclEntries

Provides a network acl entries resource to create ingress and egress entries.

NOTE: Available in 1.45.0+. Currently, the resource are only available in Hongkong(cn-hongkong), India(ap-south-1), and Indonesia(ap-southeast-1) regions.

NOTE: It doesn't support concurrency and the order of the ingress and egress entries determines the priority.

NOTE: Using this resource need to open a whitelist.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var name = config.Get("name") ?? "NetworkAclEntries";
    var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
    {
        AvailableResourceCreation = "VSwitch",
    }));
    var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
    {
        CidrBlock = "172.16.0.0/12",
    });
    var defaultNetworkAcl = new AliCloud.Vpc.NetworkAcl("defaultNetworkAcl", new AliCloud.Vpc.NetworkAclArgs
    {
        VpcId = defaultNetwork.Id,
    });
    var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
    {
        AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
        CidrBlock = "172.16.0.0/21",
        VpcId = defaultNetwork.Id,
    });
    var defaultNetworkAclAttachment = new AliCloud.Vpc.NetworkAclAttachment("defaultNetworkAclAttachment", new AliCloud.Vpc.NetworkAclAttachmentArgs
    {
        NetworkAclId = defaultNetworkAcl.Id,
        Resources = 
        {
            new AliCloud.Vpc.Inputs.NetworkAclAttachmentResourceArgs
            {
                ResourceId = defaultSwitch.Id,
                ResourceType = "VSwitch",
            },
        },
    });
    var defaultNetworkAclEntries = new AliCloud.Vpc.NetworkAclEntries("defaultNetworkAclEntries", new AliCloud.Vpc.NetworkAclEntriesArgs
    {
        Egresses = 
        {
            new AliCloud.Vpc.Inputs.NetworkAclEntriesEgressArgs
            {
                Description = name,
                DestinationCidrIp = "0.0.0.0/32",
                EntryType = "custom",
                Name = name,
                Policy = "accept",
                Port = "-1/-1",
                Protocol = "all",
            },
        },
        Ingresses = 
        {
            new AliCloud.Vpc.Inputs.NetworkAclEntriesIngressArgs
            {
                Description = name,
                EntryType = "custom",
                Name = name,
                Policy = "accept",
                Port = "-1/-1",
                Protocol = "all",
                SourceCidrIp = "0.0.0.0/32",
            },
        },
        NetworkAclId = defaultNetworkAcl.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NetworkAclEntries
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Vpc
Assembly: Pulumi.AliCloud.dll
Syntax
public class NetworkAclEntries : CustomResource

Constructors

View Source

NetworkAclEntries(String, NetworkAclEntriesArgs, CustomResourceOptions)

Create a NetworkAclEntries resource with the given unique name, arguments, and options.

Declaration
public NetworkAclEntries(string name, NetworkAclEntriesArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

NetworkAclEntriesArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Egresses

List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.

Declaration
public Output<ImmutableArray<NetworkAclEntriesEgress>> Egresses { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<NetworkAclEntriesEgress>>
View Source

Ingresses

List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.

Declaration
public Output<ImmutableArray<NetworkAclEntriesIngress>> Ingresses { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<NetworkAclEntriesIngress>>
View Source

NetworkAclId

The id of the network acl, the field can't be changed.

Declaration
public Output<string> NetworkAclId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, NetworkAclEntriesState, CustomResourceOptions)

Get an existing NetworkAclEntries resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static NetworkAclEntries Get(string name, Input<string> id, NetworkAclEntriesState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

NetworkAclEntriesState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
NetworkAclEntries
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.