1. Packages
  2. Volcengine
  3. API Docs
  4. cloud_firewall
  5. CfwDnsControlPolicy
Volcengine v0.0.29 published on Tuesday, Apr 29, 2025 by Volcengine

volcengine.cloud_firewall.CfwDnsControlPolicy

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.29 published on Tuesday, Apr 29, 2025 by Volcengine

    Provides a resource to manage cfw dns control policy

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
        vpcName: "acc-test-vpc",
        cidrBlock: "172.16.0.0/16",
    });
    const fooCfwDnsControlPolicy = new volcengine.cloud_firewall.CfwDnsControlPolicy("fooCfwDnsControlPolicy", {
        description: "acc-test-dns-control-policy",
        destinationType: "domain",
        destination: "www.test.com",
        sources: [{
            vpcId: fooVpc.id,
            region: "cn-beijing",
        }],
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_vpc = volcengine.vpc.Vpc("fooVpc",
        vpc_name="acc-test-vpc",
        cidr_block="172.16.0.0/16")
    foo_cfw_dns_control_policy = volcengine.cloud_firewall.CfwDnsControlPolicy("fooCfwDnsControlPolicy",
        description="acc-test-dns-control-policy",
        destination_type="domain",
        destination="www.test.com",
        sources=[volcengine.cloud_firewall.CfwDnsControlPolicySourceArgs(
            vpc_id=foo_vpc.id,
            region="cn-beijing",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cloud_firewall"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
    			VpcName:   pulumi.String("acc-test-vpc"),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloud_firewall.NewCfwDnsControlPolicy(ctx, "fooCfwDnsControlPolicy", &cloud_firewall.CfwDnsControlPolicyArgs{
    			Description:     pulumi.String("acc-test-dns-control-policy"),
    			DestinationType: pulumi.String("domain"),
    			Destination:     pulumi.String("www.test.com"),
    			Sources: cloud_firewall.CfwDnsControlPolicySourceArray{
    				&cloud_firewall.CfwDnsControlPolicySourceArgs{
    					VpcId:  fooVpc.ID(),
    					Region: pulumi.String("cn-beijing"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "172.16.0.0/16",
        });
    
        var fooCfwDnsControlPolicy = new Volcengine.Cloud_firewall.CfwDnsControlPolicy("fooCfwDnsControlPolicy", new()
        {
            Description = "acc-test-dns-control-policy",
            DestinationType = "domain",
            Destination = "www.test.com",
            Sources = new[]
            {
                new Volcengine.Cloud_firewall.Inputs.CfwDnsControlPolicySourceArgs
                {
                    VpcId = fooVpc.Id,
                    Region = "cn-beijing",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.cloud_firewall.CfwDnsControlPolicy;
    import com.pulumi.volcengine.cloud_firewall.CfwDnsControlPolicyArgs;
    import com.pulumi.volcengine.cloud_firewall.inputs.CfwDnsControlPolicySourceArgs;
    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 fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var fooCfwDnsControlPolicy = new CfwDnsControlPolicy("fooCfwDnsControlPolicy", CfwDnsControlPolicyArgs.builder()        
                .description("acc-test-dns-control-policy")
                .destinationType("domain")
                .destination("www.test.com")
                .sources(CfwDnsControlPolicySourceArgs.builder()
                    .vpcId(fooVpc.id())
                    .region("cn-beijing")
                    .build())
                .build());
    
        }
    }
    
    resources:
      fooVpc:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 172.16.0.0/16
      fooCfwDnsControlPolicy:
        type: volcengine:cloud_firewall:CfwDnsControlPolicy
        properties:
          description: acc-test-dns-control-policy
          destinationType: domain
          destination: www.test.com
          sources:
            - vpcId: ${fooVpc.id}
              region: cn-beijing
    

    Create CfwDnsControlPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CfwDnsControlPolicy(name: string, args: CfwDnsControlPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def CfwDnsControlPolicy(resource_name: str,
                            args: CfwDnsControlPolicyArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def CfwDnsControlPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            destination: Optional[str] = None,
                            destination_type: Optional[str] = None,
                            sources: Optional[Sequence[CfwDnsControlPolicySourceArgs]] = None,
                            description: Optional[str] = None,
                            internet_firewall_id: Optional[str] = None,
                            status: Optional[bool] = None)
    func NewCfwDnsControlPolicy(ctx *Context, name string, args CfwDnsControlPolicyArgs, opts ...ResourceOption) (*CfwDnsControlPolicy, error)
    public CfwDnsControlPolicy(string name, CfwDnsControlPolicyArgs args, CustomResourceOptions? opts = null)
    public CfwDnsControlPolicy(String name, CfwDnsControlPolicyArgs args)
    public CfwDnsControlPolicy(String name, CfwDnsControlPolicyArgs args, CustomResourceOptions options)
    
    type: volcengine:cloud_firewall:CfwDnsControlPolicy
    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 CfwDnsControlPolicyArgs
    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 CfwDnsControlPolicyArgs
    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 CfwDnsControlPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CfwDnsControlPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CfwDnsControlPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cfwDnsControlPolicyResource = new Volcengine.Cloud_firewall.CfwDnsControlPolicy("cfwDnsControlPolicyResource", new()
    {
        Destination = "string",
        DestinationType = "string",
        Sources = new[]
        {
            new Volcengine.Cloud_firewall.Inputs.CfwDnsControlPolicySourceArgs
            {
                Region = "string",
                VpcId = "string",
            },
        },
        Description = "string",
        InternetFirewallId = "string",
        Status = false,
    });
    
    example, err := cloud_firewall.NewCfwDnsControlPolicy(ctx, "cfwDnsControlPolicyResource", &cloud_firewall.CfwDnsControlPolicyArgs{
    	Destination:     pulumi.String("string"),
    	DestinationType: pulumi.String("string"),
    	Sources: cloud_firewall.CfwDnsControlPolicySourceArray{
    		&cloud_firewall.CfwDnsControlPolicySourceArgs{
    			Region: pulumi.String("string"),
    			VpcId:  pulumi.String("string"),
    		},
    	},
    	Description:        pulumi.String("string"),
    	InternetFirewallId: pulumi.String("string"),
    	Status:             pulumi.Bool(false),
    })
    
    var cfwDnsControlPolicyResource = new CfwDnsControlPolicy("cfwDnsControlPolicyResource", CfwDnsControlPolicyArgs.builder()
        .destination("string")
        .destinationType("string")
        .sources(CfwDnsControlPolicySourceArgs.builder()
            .region("string")
            .vpcId("string")
            .build())
        .description("string")
        .internetFirewallId("string")
        .status(false)
        .build());
    
    cfw_dns_control_policy_resource = volcengine.cloud_firewall.CfwDnsControlPolicy("cfwDnsControlPolicyResource",
        destination="string",
        destination_type="string",
        sources=[{
            "region": "string",
            "vpc_id": "string",
        }],
        description="string",
        internet_firewall_id="string",
        status=False)
    
    const cfwDnsControlPolicyResource = new volcengine.cloud_firewall.CfwDnsControlPolicy("cfwDnsControlPolicyResource", {
        destination: "string",
        destinationType: "string",
        sources: [{
            region: "string",
            vpcId: "string",
        }],
        description: "string",
        internetFirewallId: "string",
        status: false,
    });
    
    type: volcengine:cloud_firewall:CfwDnsControlPolicy
    properties:
        description: string
        destination: string
        destinationType: string
        internetFirewallId: string
        sources:
            - region: string
              vpcId: string
        status: false
    

    CfwDnsControlPolicy 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 CfwDnsControlPolicy resource accepts the following input properties:

    Destination string
    The destination of the dns control policy.
    DestinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    Sources List<CfwDnsControlPolicySource>
    The source vpc list of the dns control policy.
    Description string
    The description of the dns control policy.
    InternetFirewallId string
    The internet firewall id of the control policy.
    Status bool
    Whether to enable the dns control policy.
    Destination string
    The destination of the dns control policy.
    DestinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    Sources []CfwDnsControlPolicySourceArgs
    The source vpc list of the dns control policy.
    Description string
    The description of the dns control policy.
    InternetFirewallId string
    The internet firewall id of the control policy.
    Status bool
    Whether to enable the dns control policy.
    destination String
    The destination of the dns control policy.
    destinationType String
    The destination type of the dns control policy. Valid values: group, domain.
    sources List<CfwDnsControlPolicySource>
    The source vpc list of the dns control policy.
    description String
    The description of the dns control policy.
    internetFirewallId String
    The internet firewall id of the control policy.
    status Boolean
    Whether to enable the dns control policy.
    destination string
    The destination of the dns control policy.
    destinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    sources CfwDnsControlPolicySource[]
    The source vpc list of the dns control policy.
    description string
    The description of the dns control policy.
    internetFirewallId string
    The internet firewall id of the control policy.
    status boolean
    Whether to enable the dns control policy.
    destination str
    The destination of the dns control policy.
    destination_type str
    The destination type of the dns control policy. Valid values: group, domain.
    sources Sequence[CfwDnsControlPolicySourceArgs]
    The source vpc list of the dns control policy.
    description str
    The description of the dns control policy.
    internet_firewall_id str
    The internet firewall id of the control policy.
    status bool
    Whether to enable the dns control policy.
    destination String
    The destination of the dns control policy.
    destinationType String
    The destination type of the dns control policy. Valid values: group, domain.
    sources List<Property Map>
    The source vpc list of the dns control policy.
    description String
    The description of the dns control policy.
    internetFirewallId String
    The internet firewall id of the control policy.
    status Boolean
    Whether to enable the dns control policy.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CfwDnsControlPolicy resource produces the following output properties:

    AccountId string
    The account id of the dns control policy.
    HitCnt int
    The hit count of the dns control policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastHitTime int
    The last hit time of the dns control policy. Unix timestamp.
    UseCount int
    The use count of the dns control policy.
    AccountId string
    The account id of the dns control policy.
    HitCnt int
    The hit count of the dns control policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastHitTime int
    The last hit time of the dns control policy. Unix timestamp.
    UseCount int
    The use count of the dns control policy.
    accountId String
    The account id of the dns control policy.
    hitCnt Integer
    The hit count of the dns control policy.
    id String
    The provider-assigned unique ID for this managed resource.
    lastHitTime Integer
    The last hit time of the dns control policy. Unix timestamp.
    useCount Integer
    The use count of the dns control policy.
    accountId string
    The account id of the dns control policy.
    hitCnt number
    The hit count of the dns control policy.
    id string
    The provider-assigned unique ID for this managed resource.
    lastHitTime number
    The last hit time of the dns control policy. Unix timestamp.
    useCount number
    The use count of the dns control policy.
    account_id str
    The account id of the dns control policy.
    hit_cnt int
    The hit count of the dns control policy.
    id str
    The provider-assigned unique ID for this managed resource.
    last_hit_time int
    The last hit time of the dns control policy. Unix timestamp.
    use_count int
    The use count of the dns control policy.
    accountId String
    The account id of the dns control policy.
    hitCnt Number
    The hit count of the dns control policy.
    id String
    The provider-assigned unique ID for this managed resource.
    lastHitTime Number
    The last hit time of the dns control policy. Unix timestamp.
    useCount Number
    The use count of the dns control policy.

    Look up Existing CfwDnsControlPolicy Resource

    Get an existing CfwDnsControlPolicy 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?: CfwDnsControlPolicyState, opts?: CustomResourceOptions): CfwDnsControlPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            description: Optional[str] = None,
            destination: Optional[str] = None,
            destination_type: Optional[str] = None,
            hit_cnt: Optional[int] = None,
            internet_firewall_id: Optional[str] = None,
            last_hit_time: Optional[int] = None,
            sources: Optional[Sequence[CfwDnsControlPolicySourceArgs]] = None,
            status: Optional[bool] = None,
            use_count: Optional[int] = None) -> CfwDnsControlPolicy
    func GetCfwDnsControlPolicy(ctx *Context, name string, id IDInput, state *CfwDnsControlPolicyState, opts ...ResourceOption) (*CfwDnsControlPolicy, error)
    public static CfwDnsControlPolicy Get(string name, Input<string> id, CfwDnsControlPolicyState? state, CustomResourceOptions? opts = null)
    public static CfwDnsControlPolicy get(String name, Output<String> id, CfwDnsControlPolicyState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:cloud_firewall:CfwDnsControlPolicy    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.
    The following state arguments are supported:
    AccountId string
    The account id of the dns control policy.
    Description string
    The description of the dns control policy.
    Destination string
    The destination of the dns control policy.
    DestinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    HitCnt int
    The hit count of the dns control policy.
    InternetFirewallId string
    The internet firewall id of the control policy.
    LastHitTime int
    The last hit time of the dns control policy. Unix timestamp.
    Sources List<CfwDnsControlPolicySource>
    The source vpc list of the dns control policy.
    Status bool
    Whether to enable the dns control policy.
    UseCount int
    The use count of the dns control policy.
    AccountId string
    The account id of the dns control policy.
    Description string
    The description of the dns control policy.
    Destination string
    The destination of the dns control policy.
    DestinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    HitCnt int
    The hit count of the dns control policy.
    InternetFirewallId string
    The internet firewall id of the control policy.
    LastHitTime int
    The last hit time of the dns control policy. Unix timestamp.
    Sources []CfwDnsControlPolicySourceArgs
    The source vpc list of the dns control policy.
    Status bool
    Whether to enable the dns control policy.
    UseCount int
    The use count of the dns control policy.
    accountId String
    The account id of the dns control policy.
    description String
    The description of the dns control policy.
    destination String
    The destination of the dns control policy.
    destinationType String
    The destination type of the dns control policy. Valid values: group, domain.
    hitCnt Integer
    The hit count of the dns control policy.
    internetFirewallId String
    The internet firewall id of the control policy.
    lastHitTime Integer
    The last hit time of the dns control policy. Unix timestamp.
    sources List<CfwDnsControlPolicySource>
    The source vpc list of the dns control policy.
    status Boolean
    Whether to enable the dns control policy.
    useCount Integer
    The use count of the dns control policy.
    accountId string
    The account id of the dns control policy.
    description string
    The description of the dns control policy.
    destination string
    The destination of the dns control policy.
    destinationType string
    The destination type of the dns control policy. Valid values: group, domain.
    hitCnt number
    The hit count of the dns control policy.
    internetFirewallId string
    The internet firewall id of the control policy.
    lastHitTime number
    The last hit time of the dns control policy. Unix timestamp.
    sources CfwDnsControlPolicySource[]
    The source vpc list of the dns control policy.
    status boolean
    Whether to enable the dns control policy.
    useCount number
    The use count of the dns control policy.
    account_id str
    The account id of the dns control policy.
    description str
    The description of the dns control policy.
    destination str
    The destination of the dns control policy.
    destination_type str
    The destination type of the dns control policy. Valid values: group, domain.
    hit_cnt int
    The hit count of the dns control policy.
    internet_firewall_id str
    The internet firewall id of the control policy.
    last_hit_time int
    The last hit time of the dns control policy. Unix timestamp.
    sources Sequence[CfwDnsControlPolicySourceArgs]
    The source vpc list of the dns control policy.
    status bool
    Whether to enable the dns control policy.
    use_count int
    The use count of the dns control policy.
    accountId String
    The account id of the dns control policy.
    description String
    The description of the dns control policy.
    destination String
    The destination of the dns control policy.
    destinationType String
    The destination type of the dns control policy. Valid values: group, domain.
    hitCnt Number
    The hit count of the dns control policy.
    internetFirewallId String
    The internet firewall id of the control policy.
    lastHitTime Number
    The last hit time of the dns control policy. Unix timestamp.
    sources List<Property Map>
    The source vpc list of the dns control policy.
    status Boolean
    Whether to enable the dns control policy.
    useCount Number
    The use count of the dns control policy.

    Supporting Types

    CfwDnsControlPolicySource, CfwDnsControlPolicySourceArgs

    Region string
    The region of the source vpc.
    VpcId string
    The id of the source vpc.
    Region string
    The region of the source vpc.
    VpcId string
    The id of the source vpc.
    region String
    The region of the source vpc.
    vpcId String
    The id of the source vpc.
    region string
    The region of the source vpc.
    vpcId string
    The id of the source vpc.
    region str
    The region of the source vpc.
    vpc_id str
    The id of the source vpc.
    region String
    The region of the source vpc.
    vpcId String
    The id of the source vpc.

    Import

    DnsControlPolicy can be imported using the id, e.g.

    $ pulumi import volcengine:cloud_firewall/cfwDnsControlPolicy:CfwDnsControlPolicy default resource_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.29 published on Tuesday, Apr 29, 2025 by Volcengine