NetworkAclEntries

class NetworkAclEntries : KotlinCustomResource

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. DEPRECATED: This resource has been deprecated from version 1.122.0. Replace by ingress_acl_entries and egress_acl_entries with the resource alicloud_network_acl.

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 com.pulumi.alicloud.vpc.NetworkAclEntries;
import com.pulumi.alicloud.vpc.NetworkAclEntriesArgs;
import com.pulumi.alicloud.vpc.inputs.NetworkAclEntriesIngressArgs;
import com.pulumi.alicloud.vpc.inputs.NetworkAclEntriesEgressArgs;
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("NetworkAclEntries");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.cidrBlock("172.16.0.0/12")
.build());
var defaultNetworkAcl = new NetworkAcl("defaultNetworkAcl", NetworkAclArgs.builder()
.vpcId(defaultNetwork.id())
.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()))
.build());
var defaultNetworkAclAttachment = new NetworkAclAttachment("defaultNetworkAclAttachment", NetworkAclAttachmentArgs.builder()
.networkAclId(defaultNetworkAcl.id())
.resources(NetworkAclAttachmentResourceArgs.builder()
.resourceId(defaultSwitch.id())
.resourceType("VSwitch")
.build())
.build());
var defaultNetworkAclEntries = new NetworkAclEntries("defaultNetworkAclEntries", NetworkAclEntriesArgs.builder()
.networkAclId(defaultNetworkAcl.id())
.ingresses(NetworkAclEntriesIngressArgs.builder()
.protocol("all")
.port("-1/-1")
.sourceCidrIp("0.0.0.0/32")
.name(name)
.entryType("custom")
.policy("accept")
.description(name)
.build())
.egresses(NetworkAclEntriesEgressArgs.builder()
.protocol("all")
.port("-1/-1")
.destinationCidrIp("0.0.0.0/32")
.name(name)
.entryType("custom")
.policy("accept")
.description(name)
.build())
.build());
}
}

Properties

Link copied to clipboard

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

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

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

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
val urn: Output<String>