NetworkAclEntries
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.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "NetworkAclEntries";
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",
},
},
});
var defaultNetworkAclEntries = new AliCloud.Vpc.NetworkAclEntries("defaultNetworkAclEntries", new AliCloud.Vpc.NetworkAclEntriesArgs
{
Egresses =
{
new AliCloud.Vpc.Inputs.NetworkAclEntriesEgressArgs
{
Description = name,
DestinationCidrIp = "0.0.0.0/32",
EntryType = "custom",
Name = name,
Policy = "accept",
Port = "-1/-1",
Protocol = "all",
},
},
Ingresses =
{
new AliCloud.Vpc.Inputs.NetworkAclEntriesIngressArgs
{
Description = name,
EntryType = "custom",
Name = name,
Policy = "accept",
Port = "-1/-1",
Protocol = "all",
SourceCidrIp = "0.0.0.0/32",
},
},
NetworkAclId = defaultNetworkAcl.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "NetworkAclEntries"
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",
}])
default_network_acl_entries = alicloud.vpc.NetworkAclEntries("defaultNetworkAclEntries",
egresses=[{
"description": name,
"destinationCidrIp": "0.0.0.0/32",
"entryType": "custom",
"name": name,
"policy": "accept",
"port": "-1/-1",
"protocol": "all",
}],
ingresses=[{
"description": name,
"entryType": "custom",
"name": name,
"policy": "accept",
"port": "-1/-1",
"protocol": "all",
"source_cidr_ip": "0.0.0.0/32",
}],
network_acl_id=default_network_acl.id)import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "NetworkAclEntries";
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",
}],
});
const defaultNetworkAclEntries = new alicloud.vpc.NetworkAclEntries("default", {
egresses: [{
description: name,
destinationCidrIp: "0.0.0.0/32",
entryType: "custom",
name: name,
policy: "accept",
port: "-1/-1",
protocol: "all",
}],
ingresses: [{
description: name,
entryType: "custom",
name: name,
policy: "accept",
port: "-1/-1",
protocol: "all",
sourceCidrIp: "0.0.0.0/32",
}],
networkAclId: defaultNetworkAcl.id,
});Create a NetworkAclEntries Resource
new NetworkAclEntries(name: string, args: NetworkAclEntriesArgs, opts?: CustomResourceOptions);def NetworkAclEntries(resource_name, opts=None, egresses=None, ingresses=None, network_acl_id=None, __props__=None);func NewNetworkAclEntries(ctx *Context, name string, args NetworkAclEntriesArgs, opts ...ResourceOption) (*NetworkAclEntries, error)public NetworkAclEntries(string name, NetworkAclEntriesArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args NetworkAclEntriesArgs
- 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 NetworkAclEntriesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkAclEntriesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
NetworkAclEntries Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The NetworkAclEntries resource accepts the following input properties:
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Egresses
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Entries Egress Args> List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- Ingresses
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Entries Ingress Args> List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Egresses
[]Network
Acl Entries Egress List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- Ingresses
[]Network
Acl Entries Ingress List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- network
Acl stringId The id of the network acl, the field can’t be changed.
- egresses
Network
Acl Entries Egress[] List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- ingresses
Network
Acl Entries Ingress[] List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- network_
acl_ strid The id of the network acl, the field can’t be changed.
- egresses
List[Network
Acl Entries Egress] List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- ingresses
List[Network
Acl Entries Ingress] List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkAclEntries resource produces the following output properties:
Look up an Existing NetworkAclEntries Resource
Get an existing NetworkAclEntries resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NetworkAclEntriesState, opts?: CustomResourceOptions): NetworkAclEntriesstatic get(resource_name, id, opts=None, egresses=None, ingresses=None, network_acl_id=None, __props__=None);func GetNetworkAclEntries(ctx *Context, name string, id IDInput, state *NetworkAclEntriesState, opts ...ResourceOption) (*NetworkAclEntries, error)public static NetworkAclEntries Get(string name, Input<string> id, NetworkAclEntriesState? state, CustomResourceOptions? opts = null)- 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:
- Egresses
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Entries Egress Args> List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- Ingresses
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Entries Ingress Args> List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Egresses
[]Network
Acl Entries Egress List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- Ingresses
[]Network
Acl Entries Ingress List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- egresses
Network
Acl Entries Egress[] List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- ingresses
Network
Acl Entries Ingress[] List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- network
Acl stringId The id of the network acl, the field can’t be changed.
- egresses
List[Network
Acl Entries Egress] List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
- ingresses
List[Network
Acl Entries Ingress] List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
- network_
acl_ strid The id of the network acl, the field can’t be changed.
Supporting Types
NetworkAclEntriesEgress
- Description string
The description of the egress entry.
- Destination
Cidr stringIp The destination ip of the egress entry.
- Entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- Name string
The name of the egress entry.
- Policy string
The policy of the egress entry. It must be
acceptordrop.- Port string
The port of the egress entry.
- Protocol string
The protocol of the egress entry.
- Description string
The description of the egress entry.
- Destination
Cidr stringIp The destination ip of the egress entry.
- Entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- Name string
The name of the egress entry.
- Policy string
The policy of the egress entry. It must be
acceptordrop.- Port string
The port of the egress entry.
- Protocol string
The protocol of the egress entry.
- description string
The description of the egress entry.
- destination
Cidr stringIp The destination ip of the egress entry.
- entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- name string
The name of the egress entry.
- policy string
The policy of the egress entry. It must be
acceptordrop.- port string
The port of the egress entry.
- protocol string
The protocol of the egress entry.
- description str
The description of the egress entry.
- destination
Cidr strIp The destination ip of the egress entry.
- entry
Type str The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- name str
The name of the egress entry.
- policy str
The policy of the egress entry. It must be
acceptordrop.- port str
The port of the egress entry.
- protocol str
The protocol of the egress entry.
NetworkAclEntriesIngress
- Description string
The description of the egress entry.
- Entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- Name string
The name of the egress entry.
- Policy string
The policy of the egress entry. It must be
acceptordrop.- Port string
The port of the egress entry.
- Protocol string
The protocol of the egress entry.
- Source
Cidr stringIp The source ip of the ingress entry.
- Description string
The description of the egress entry.
- Entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- Name string
The name of the egress entry.
- Policy string
The policy of the egress entry. It must be
acceptordrop.- Port string
The port of the egress entry.
- Protocol string
The protocol of the egress entry.
- Source
Cidr stringIp The source ip of the ingress entry.
- description string
The description of the egress entry.
- entry
Type string The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- name string
The name of the egress entry.
- policy string
The policy of the egress entry. It must be
acceptordrop.- port string
The port of the egress entry.
- protocol string
The protocol of the egress entry.
- source
Cidr stringIp The source ip of the ingress entry.
- description str
The description of the egress entry.
- entry
Type str The entry type of the egress entry. It must be
customorsystem. Default value iscustom.- name str
The name of the egress entry.
- policy str
The policy of the egress entry. It must be
acceptordrop.- port str
The port of the egress entry.
- protocol str
The protocol of the egress entry.
- source_
cidr_ strip The source ip of the ingress entry.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.