Class 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,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Vpc
Assembly: Pulumi.AliCloud.dll
Syntax
public class NetworkAclEntries : CustomResource
Constructors
View SourceNetworkAclEntries(String, NetworkAclEntriesArgs, CustomResourceOptions)
Create a NetworkAclEntries resource with the given unique name, arguments, and options.
Declaration
public NetworkAclEntries(string name, NetworkAclEntriesArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| NetworkAclEntriesArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceEgresses
List of the egress entries of the network acl. The order of the egress entries determines the priority. The details see Block Egress.
Declaration
public Output<ImmutableArray<NetworkAclEntriesEgress>> Egresses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<NetworkAclEntriesEgress>> |
Ingresses
List of the ingress entries of the network acl. The order of the ingress entries determines the priority. The details see Block Ingress.
Declaration
public Output<ImmutableArray<NetworkAclEntriesIngress>> Ingresses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<NetworkAclEntriesIngress>> |
NetworkAclId
The id of the network acl, the field can't be changed.
Declaration
public Output<string> NetworkAclId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, NetworkAclEntriesState, CustomResourceOptions)
Get an existing NetworkAclEntries resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static NetworkAclEntries Get(string name, Input<string> id, NetworkAclEntriesState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| NetworkAclEntriesState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| NetworkAclEntries |