Show / Hide Table of Contents

Class NetworkAclAttachment

Provides a network acl attachment resource to associate network acls to vswitches.

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

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var name = config.Get("name") ?? "NatGatewayConfigSpec";
    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",
            },
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NetworkAclAttachment
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 NetworkAclAttachment : CustomResource

Constructors

View Source

NetworkAclAttachment(String, NetworkAclAttachmentArgs, CustomResourceOptions)

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

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

The unique name of the resource

NetworkAclAttachmentArgs 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

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>
View Source

Resources

List of the resources associated with the network acl. The details see Block Resources.

Declaration
public Output<ImmutableArray<NetworkAclAttachmentResource>> Resources { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<NetworkAclAttachmentResource>>

Methods

View Source

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

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

Declaration
public static NetworkAclAttachment Get(string name, Input<string> id, NetworkAclAttachmentState 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.

NetworkAclAttachmentState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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