tencentcloud.VpcAcl
Explore with Pulumi AI
Provide a resource to create a VPC ACL instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const example = new tencentcloud.VpcAcl("example", {
vpcId: vpc.vpcId,
ingresses: [
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
],
egresses: [
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
example = tencentcloud.VpcAcl("example",
vpc_id=vpc.vpc_id,
ingresses=[
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
],
egresses=[
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewVpcAcl(ctx, "example", &tencentcloud.VpcAclArgs{
VpcId: vpc.VpcId,
Ingresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.1.0/24#800#TCP"),
pulumi.String("ACCEPT#192.168.1.0/24#800-900#TCP"),
},
Egresses: pulumi.StringArray{
pulumi.String("ACCEPT#192.168.1.0/24#800#TCP"),
pulumi.String("ACCEPT#192.168.1.0/24#800-900#TCP"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
var example = new Tencentcloud.VpcAcl("example", new()
{
VpcId = vpc.VpcId,
Ingresses = new[]
{
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
},
Egresses = new[]
{
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.VpcAcl;
import com.pulumi.tencentcloud.VpcAclArgs;
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) {
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var example = new VpcAcl("example", VpcAclArgs.builder()
.vpcId(vpc.vpcId())
.ingresses(
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP")
.egresses(
"ACCEPT#192.168.1.0/24#800#TCP",
"ACCEPT#192.168.1.0/24#800-900#TCP")
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
example:
type: tencentcloud:VpcAcl
properties:
vpcId: ${vpc.vpcId}
ingresses:
- ACCEPT#192.168.1.0/24#800#TCP
- ACCEPT#192.168.1.0/24#800-900#TCP
egresses:
- ACCEPT#192.168.1.0/24#800#TCP
- ACCEPT#192.168.1.0/24#800-900#TCP
Create VpcAcl Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcAcl(name: string, args: VpcAclArgs, opts?: CustomResourceOptions);
@overload
def VpcAcl(resource_name: str,
args: VpcAclArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpcAcl(resource_name: str,
opts: Optional[ResourceOptions] = None,
vpc_id: Optional[str] = None,
egresses: Optional[Sequence[str]] = None,
ingresses: Optional[Sequence[str]] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
vpc_acl_id: Optional[str] = None)
func NewVpcAcl(ctx *Context, name string, args VpcAclArgs, opts ...ResourceOption) (*VpcAcl, error)
public VpcAcl(string name, VpcAclArgs args, CustomResourceOptions? opts = null)
public VpcAcl(String name, VpcAclArgs args)
public VpcAcl(String name, VpcAclArgs args, CustomResourceOptions options)
type: tencentcloud:VpcAcl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VpcAclArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcAclArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcAclArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcAclArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcAclArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcAcl Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VpcAcl resource accepts the following input properties:
- Vpc
Id string - ID of the VPC instance.
- Egresses List<string>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Ingresses List<string>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Name string
- Name of the network ACL.
- Dictionary<string, string>
- Tags of the vpc acl.
- Vpc
Acl stringId - ID of the resource.
- Vpc
Id string - ID of the VPC instance.
- Egresses []string
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Ingresses []string
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Name string
- Name of the network ACL.
- map[string]string
- Tags of the vpc acl.
- Vpc
Acl stringId - ID of the resource.
- vpc
Id String - ID of the VPC instance.
- egresses List<String>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses List<String>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name String
- Name of the network ACL.
- Map<String,String>
- Tags of the vpc acl.
- vpc
Acl StringId - ID of the resource.
- vpc
Id string - ID of the VPC instance.
- egresses string[]
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses string[]
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name string
- Name of the network ACL.
- {[key: string]: string}
- Tags of the vpc acl.
- vpc
Acl stringId - ID of the resource.
- vpc_
id str - ID of the VPC instance.
- egresses Sequence[str]
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses Sequence[str]
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name str
- Name of the network ACL.
- Mapping[str, str]
- Tags of the vpc acl.
- vpc_
acl_ strid - ID of the resource.
- vpc
Id String - ID of the VPC instance.
- egresses List<String>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses List<String>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name String
- Name of the network ACL.
- Map<String>
- Tags of the vpc acl.
- vpc
Acl StringId - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcAcl resource produces the following output properties:
- Create
Time string - Creation time of ACL.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Creation time of ACL.
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time of ACL.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - Creation time of ACL.
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - Creation time of ACL.
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time of ACL.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing VpcAcl Resource
Get an existing VpcAcl 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?: VpcAclState, opts?: CustomResourceOptions): VpcAcl
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
egresses: Optional[Sequence[str]] = None,
ingresses: Optional[Sequence[str]] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
vpc_acl_id: Optional[str] = None,
vpc_id: Optional[str] = None) -> VpcAcl
func GetVpcAcl(ctx *Context, name string, id IDInput, state *VpcAclState, opts ...ResourceOption) (*VpcAcl, error)
public static VpcAcl Get(string name, Input<string> id, VpcAclState? state, CustomResourceOptions? opts = null)
public static VpcAcl get(String name, Output<String> id, VpcAclState state, CustomResourceOptions options)
resources: _: type: tencentcloud:VpcAcl get: id: ${id}
- 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.
- 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.
- Create
Time string - Creation time of ACL.
- Egresses List<string>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Ingresses List<string>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Name string
- Name of the network ACL.
- Dictionary<string, string>
- Tags of the vpc acl.
- Vpc
Acl stringId - ID of the resource.
- Vpc
Id string - ID of the VPC instance.
- Create
Time string - Creation time of ACL.
- Egresses []string
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Ingresses []string
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - Name string
- Name of the network ACL.
- map[string]string
- Tags of the vpc acl.
- Vpc
Acl stringId - ID of the resource.
- Vpc
Id string - ID of the VPC instance.
- create
Time String - Creation time of ACL.
- egresses List<String>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses List<String>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name String
- Name of the network ACL.
- Map<String,String>
- Tags of the vpc acl.
- vpc
Acl StringId - ID of the resource.
- vpc
Id String - ID of the VPC instance.
- create
Time string - Creation time of ACL.
- egresses string[]
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses string[]
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name string
- Name of the network ACL.
- {[key: string]: string}
- Tags of the vpc acl.
- vpc
Acl stringId - ID of the resource.
- vpc
Id string - ID of the VPC instance.
- create_
time str - Creation time of ACL.
- egresses Sequence[str]
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses Sequence[str]
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name str
- Name of the network ACL.
- Mapping[str, str]
- Tags of the vpc acl.
- vpc_
acl_ strid - ID of the resource.
- vpc_
id str - ID of the VPC instance.
- create
Time String - Creation time of ACL.
- egresses List<String>
- Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - ingresses List<String>
- Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is
ACCEPT
andDROP
. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is80
,80-90
orALL
. The available value of 'protocol' isTCP
,UDP
,ICMP
andALL
. When 'protocol' isICMP
orALL
, the 'port' must beALL
. - name String
- Name of the network ACL.
- Map<String>
- Tags of the vpc acl.
- vpc
Acl StringId - ID of the resource.
- vpc
Id String - ID of the VPC instance.
Import
Vpc ACL can be imported, e.g.
$ pulumi import tencentcloud:index/vpcAcl:VpcAcl example acl-mijp2oyu
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.