com.pulumi.alicloud.vpc.NetworkAclEntries Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.vpc;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.vpc.NetworkAclEntriesArgs;
import com.pulumi.alicloud.vpc.inputs.NetworkAclEntriesState;
import com.pulumi.alicloud.vpc.outputs.NetworkAclEntriesEgress;
import com.pulumi.alicloud.vpc.outputs.NetworkAclEntriesIngress;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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), 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
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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 default = AlicloudFunctions.getZones(GetZonesArgs.builder()
* .availableResourceCreation("VSwitch")
* .build());
*
* var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
* .name(name)
* .cidrBlock("172.16.0.0/12")
* .build());
*
* var defaultNetworkAcl = new NetworkAcl("defaultNetworkAcl", NetworkAclArgs.builder()
* .vpcId(defaultNetwork.id())
* .name(name)
* .build());
*
* var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
* .vpcId(defaultNetwork.id())
* .cidrBlock("172.16.0.0/21")
* .zoneId(default_.zones()[0].id())
* .name(name)
* .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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
@ResourceType(type="alicloud:vpc/networkAclEntries:NetworkAclEntries")
public class NetworkAclEntries extends com.pulumi.resources.CustomResource {
/**
* List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
*
*/
@Export(name="egresses", refs={List.class,NetworkAclEntriesEgress.class}, tree="[0,1]")
private Output> egresses;
/**
* @return List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
*
*/
public Output>> egresses() {
return Codegen.optional(this.egresses);
}
/**
* List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
*
*/
@Export(name="ingresses", refs={List.class,NetworkAclEntriesIngress.class}, tree="[0,1]")
private Output> ingresses;
/**
* @return List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
*
*/
public Output>> ingresses() {
return Codegen.optional(this.ingresses);
}
/**
* The id of the network acl, the field can't be changed.
*
*/
@Export(name="networkAclId", refs={String.class}, tree="[0]")
private Output networkAclId;
/**
* @return The id of the network acl, the field can't be changed.
*
*/
public Output networkAclId() {
return this.networkAclId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public NetworkAclEntries(String name) {
this(name, NetworkAclEntriesArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public NetworkAclEntries(String name, NetworkAclEntriesArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public NetworkAclEntries(String name, NetworkAclEntriesArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:vpc/networkAclEntries:NetworkAclEntries", name, args == null ? NetworkAclEntriesArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
}
private NetworkAclEntries(String name, Output id, @Nullable NetworkAclEntriesState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:vpc/networkAclEntries:NetworkAclEntries", name, state, makeResourceOptions(options, id));
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static NetworkAclEntries get(String name, Output id, @Nullable NetworkAclEntriesState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new NetworkAclEntries(name, id, state, options);
}
}