NetworkAclAttachment

class NetworkAclAttachment : KotlinCustomResource

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

DEPRECATED: This resource has been deprecated from version 1.124.0. Replace by resources with the resource alicloud_network_acl. Note that because this resource conflicts with the resources attribute of alicloud.vpc.NetworkAcl, this resource can no be used. 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

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.NetworkAcl;
import com.pulumi.alicloud.vpc.NetworkAclArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.vpc.NetworkAclAttachment;
import com.pulumi.alicloud.vpc.NetworkAclAttachmentArgs;
import com.pulumi.alicloud.vpc.inputs.NetworkAclAttachmentResourceArgs;
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("NatGatewayConfigSpec");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/12")
.build());
var defaultNetworkAcl = new NetworkAcl("defaultNetworkAcl", NetworkAclArgs.builder()
.vpcId(defaultNetwork.id())
.networkAclName(name)
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/21")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName(name)
.build());
var defaultNetworkAclAttachment = new NetworkAclAttachment("defaultNetworkAclAttachment", NetworkAclAttachmentArgs.builder()
.networkAclId(defaultNetworkAcl.id())
.resources(NetworkAclAttachmentResourceArgs.builder()
.resourceId(defaultSwitch.id())
.resourceType("VSwitch")
.build())
.build());
}
}

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val networkAclId: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val urn: Output<String>