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",
                },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "NatGatewayConfigSpec"
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/12")
default_network_acl = alicloud.vpc.NetworkAcl("defaultNetworkAcl", vpc_id=default_network.id)
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/21",
    vpc_id=default_network.id)
default_network_acl_attachment = alicloud.vpc.NetworkAclAttachment("defaultNetworkAclAttachment",
    network_acl_id=default_network_acl.id,
    resources=[{
        "resourceId": default_switch.id,
        "resourceType": "VSwitch",
    }])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "NatGatewayConfigSpec";

const defaultZones = pulumi.output(alicloud.getZones({
    availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/12",
});
const defaultNetworkAcl = new alicloud.vpc.NetworkAcl("default", {
    vpcId: defaultNetwork.id,
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/21",
    vpcId: defaultNetwork.id,
});
const defaultNetworkAclAttachment = new alicloud.vpc.NetworkAclAttachment("default", {
    networkAclId: defaultNetworkAcl.id,
    resources: [{
        resourceId: defaultSwitch.id,
        resourceType: "VSwitch",
    }],
});

Create a NetworkAclAttachment Resource

def NetworkAclAttachment(resource_name, opts=None, network_acl_id=None, resources=None, __props__=None);
name string
The unique name of the resource.
args NetworkAclAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args NetworkAclAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NetworkAclAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NetworkAclAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The NetworkAclAttachment resource accepts the following input properties:

NetworkAclId string

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

Resources List<Pulumi.AliCloud.Vpc.Inputs.NetworkAclAttachmentResourceArgs>

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

NetworkAclId string

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

Resources []NetworkAclAttachmentResource

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

networkAclId string

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

resources NetworkAclAttachmentResource[]

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

network_acl_id str

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

resources List[NetworkAclAttachmentResource]

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

Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkAclAttachment 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing NetworkAclAttachment Resource

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

static get(resource_name, id, opts=None, network_acl_id=None, resources=None, __props__=None);
func GetNetworkAclAttachment(ctx *Context, name string, id IDInput, state *NetworkAclAttachmentState, opts ...ResourceOption) (*NetworkAclAttachment, error)
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.

The following state arguments are supported:

NetworkAclId string

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

Resources List<Pulumi.AliCloud.Vpc.Inputs.NetworkAclAttachmentResourceArgs>

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

NetworkAclId string

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

Resources []NetworkAclAttachmentResource

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

networkAclId string

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

resources NetworkAclAttachmentResource[]

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

network_acl_id str

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

resources List[NetworkAclAttachmentResource]

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

Supporting Types

NetworkAclAttachmentResource

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ResourceId string

The resource id that the network acl will associate with.

ResourceType string

The resource id that the network acl will associate with. Only support VSwitch now.

ResourceId string

The resource id that the network acl will associate with.

ResourceType string

The resource id that the network acl will associate with. Only support VSwitch now.

resourceId string

The resource id that the network acl will associate with.

resourceType string

The resource id that the network acl will associate with. Only support VSwitch now.

resourceId str

The resource id that the network acl will associate with.

resourceType str

The resource id that the network acl will associate with. Only support VSwitch now.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.