UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

269 lines (268 loc) 9.46 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a VPC network ACL resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const name = config.requireObject("name"); * const subnetId1 = config.requireObject("subnetId1"); * const subnetId2 = config.requireObject("subnetId2"); * const test = new huaweicloud.vpc.NetworkAcl("test", { * description: "created by terraform", * enterpriseProjectId: "0", * enabled: true, * ingressRules: [ * { * action: "allow", * ipVersion: 4, * protocol: "tcp", * sourceIpAddress: "192.168.0.0/24", * sourcePort: "22-30,33", * destinationIpAddress: "0.0.0.0/0", * destinationPort: "8001-8010", * }, * { * action: "deny", * ipVersion: 4, * protocol: "icmp", * sourceIpAddress: "192.168.0.0/24", * destinationIpAddress: "0.0.0.0/0", * }, * ], * egressRules: [ * { * action: "allow", * ipVersion: 4, * protocol: "tcp", * sourceIpAddress: "172.16.0.0/24", * sourcePort: "22-30,33", * destinationIpAddress: "0.0.0.0/0", * destinationPort: "8001-8010", * }, * { * action: "deny", * ipVersion: 4, * protocol: "icmp", * sourceIpAddress: "172.16.0.0/24", * destinationIpAddress: "0.0.0.0/0", * }, * ], * associatedSubnets: [ * { * subnetId: subnetId1, * }, * { * subnetId: subnetId2, * }, * ], * }); * ``` * * ## Import * * The network ACL can be imported using `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/networkAcl:NetworkAcl test <id> * ``` */ export declare class NetworkAcl extends pulumi.CustomResource { /** * Get an existing NetworkAcl 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 Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NetworkAclState, opts?: pulumi.CustomResourceOptions): NetworkAcl; /** * Returns true if the given object is an instance of NetworkAcl. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is NetworkAcl; /** * Specifies the associated subnets of the network ACL. * The associatedSubnets structure is documented below. */ readonly associatedSubnets: pulumi.Output<outputs.Vpc.NetworkAclAssociatedSubnet[] | undefined>; /** * The created time of the ACL. */ readonly createdAt: pulumi.Output<string>; /** * Specifies the network ACL rule description. The value can contain no more * than 255 characters. The value cannot contain angle brackets (< or >). */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the egress rules of the network ACL. * The rules structure is documented below. */ readonly egressRules: pulumi.Output<outputs.Vpc.NetworkAclEgressRule[] | undefined>; /** * Specifies whether the network ACL is enabled. The default value is **true**. */ readonly enabled: pulumi.Output<boolean | undefined>; /** * Specifies the enterprise project ID of the network ACL. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the ingress rules of the network ACL. * The rules structure is documented below. */ readonly ingressRules: pulumi.Output<outputs.Vpc.NetworkAclIngressRule[] | undefined>; /** * Specifies the network ACL rule name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ readonly name: pulumi.Output<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. * Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * The status of the ACL. */ readonly status: pulumi.Output<string>; /** * Specifies the key/value pairs to associate with the network ACL. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The updated time of the ACL. */ readonly updatedAt: pulumi.Output<string>; /** * Create a NetworkAcl resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: NetworkAclArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NetworkAcl resources. */ export interface NetworkAclState { /** * Specifies the associated subnets of the network ACL. * The associatedSubnets structure is documented below. */ associatedSubnets?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclAssociatedSubnet>[]>; /** * The created time of the ACL. */ createdAt?: pulumi.Input<string>; /** * Specifies the network ACL rule description. The value can contain no more * than 255 characters. The value cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies the egress rules of the network ACL. * The rules structure is documented below. */ egressRules?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclEgressRule>[]>; /** * Specifies whether the network ACL is enabled. The default value is **true**. */ enabled?: pulumi.Input<boolean>; /** * Specifies the enterprise project ID of the network ACL. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the ingress rules of the network ACL. * The rules structure is documented below. */ ingressRules?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclIngressRule>[]>; /** * Specifies the network ACL rule name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. * Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * The status of the ACL. */ status?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the network ACL. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The updated time of the ACL. */ updatedAt?: pulumi.Input<string>; } /** * The set of arguments for constructing a NetworkAcl resource. */ export interface NetworkAclArgs { /** * Specifies the associated subnets of the network ACL. * The associatedSubnets structure is documented below. */ associatedSubnets?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclAssociatedSubnet>[]>; /** * Specifies the network ACL rule description. The value can contain no more * than 255 characters. The value cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies the egress rules of the network ACL. * The rules structure is documented below. */ egressRules?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclEgressRule>[]>; /** * Specifies whether the network ACL is enabled. The default value is **true**. */ enabled?: pulumi.Input<boolean>; /** * Specifies the enterprise project ID of the network ACL. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the ingress rules of the network ACL. * The rules structure is documented below. */ ingressRules?: pulumi.Input<pulumi.Input<inputs.Vpc.NetworkAclIngressRule>[]>; /** * Specifies the network ACL rule name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. * Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the network ACL. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }