NetworkAclAttachment
Provides a network acl attachment resource to associate network acls to vswitches.
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
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "NatGatewayConfigSpec";
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",
},
},
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "NatGatewayConfigSpec"
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",
}])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "NatGatewayConfigSpec";
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",
}],
});Create a NetworkAclAttachment Resource
new NetworkAclAttachment(name: string, args: NetworkAclAttachmentArgs, opts?: CustomResourceOptions);def NetworkAclAttachment(resource_name, opts=None, network_acl_id=None, resources=None, __props__=None);func NewNetworkAclAttachment(ctx *Context, name string, args NetworkAclAttachmentArgs, opts ...ResourceOption) (*NetworkAclAttachment, error)public NetworkAclAttachment(string name, NetworkAclAttachmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args NetworkAclAttachmentArgs
- 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 NetworkAclAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkAclAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
NetworkAclAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The NetworkAclAttachment resource accepts the following input properties:
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Resources
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Attachment Resource Args> List of the resources associated with the network acl. The details see Block Resources.
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Resources
[]Network
Acl Attachment Resource List of the resources associated with the network acl. The details see Block Resources.
- network
Acl stringId The id of the network acl, the field can’t be changed.
- resources
Network
Acl Attachment Resource[] List of the resources associated with the network acl. The details see Block Resources.
- network_
acl_ strid The id of the network acl, the field can’t be changed.
- resources
List[Network
Acl Attachment Resource] List of the resources associated with the network acl. The details see Block Resources.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkAclAttachment resource produces the following output properties:
Look up an Existing NetworkAclAttachment Resource
Get an existing NetworkAclAttachment 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?: NetworkAclAttachmentState, opts?: CustomResourceOptions): NetworkAclAttachmentstatic get(resource_name, id, opts=None, network_acl_id=None, resources=None, __props__=None);func GetNetworkAclAttachment(ctx *Context, name string, id IDInput, state *NetworkAclAttachmentState, opts ...ResourceOption) (*NetworkAclAttachment, error)public static NetworkAclAttachment Get(string name, Input<string> id, NetworkAclAttachmentState? 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:
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Resources
List<Pulumi.
Ali Cloud. Vpc. Inputs. Network Acl Attachment Resource Args> List of the resources associated with the network acl. The details see Block Resources.
- Network
Acl stringId The id of the network acl, the field can’t be changed.
- Resources
[]Network
Acl Attachment Resource List of the resources associated with the network acl. The details see Block Resources.
- network
Acl stringId The id of the network acl, the field can’t be changed.
- resources
Network
Acl Attachment Resource[] List of the resources associated with the network acl. The details see Block Resources.
- network_
acl_ strid The id of the network acl, the field can’t be changed.
- resources
List[Network
Acl Attachment Resource] List of the resources associated with the network acl. The details see Block Resources.
Supporting Types
NetworkAclAttachmentResource
- Resource
Id string The resource id that the network acl will associate with.
- Resource
Type string The resource id that the network acl will associate with. Only support
VSwitchnow.
- Resource
Id string The resource id that the network acl will associate with.
- Resource
Type string The resource id that the network acl will associate with. Only support
VSwitchnow.
- resource
Id string The resource id that the network acl will associate with.
- resource
Type string The resource id that the network acl will associate with. Only support
VSwitchnow.
- resource
Id str The resource id that the network acl will associate with.
- resource
Type str The resource id that the network acl will associate with. Only support
VSwitchnow.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.