volcengine.cloud_firewall.CfwDnsControlPolicy
Explore with Pulumi AI
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.
- Destination
Type string - The destination type of the dns control policy. Valid values:
group
,domain
. - Sources
List<Cfw
Dns Control Policy Source> - The source vpc list of the dns control policy.
- Description string
- The description of the dns control policy.
- Internet
Firewall stringId - 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.
- Destination
Type string - The destination type of the dns control policy. Valid values:
group
,domain
. - Sources
[]Cfw
Dns Control Policy Source Args - The source vpc list of the dns control policy.
- Description string
- The description of the dns control policy.
- Internet
Firewall stringId - 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.
- destination
Type String - The destination type of the dns control policy. Valid values:
group
,domain
. - sources
List<Cfw
Dns Control Policy Source> - The source vpc list of the dns control policy.
- description String
- The description of the dns control policy.
- internet
Firewall StringId - 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.
- destination
Type string - The destination type of the dns control policy. Valid values:
group
,domain
. - sources
Cfw
Dns Control Policy Source[] - The source vpc list of the dns control policy.
- description string
- The description of the dns control policy.
- internet
Firewall stringId - 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[Cfw
Dns Control Policy Source Args] - The source vpc list of the dns control policy.
- description str
- The description of the dns control policy.
- internet_
firewall_ strid - 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.
- destination
Type 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.
- internet
Firewall StringId - 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:
- Account
Id string - The account id of the dns control policy.
- Hit
Cnt int - The hit count of the dns control policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Hit intTime - The last hit time of the dns control policy. Unix timestamp.
- Use
Count int - The use count of the dns control policy.
- Account
Id string - The account id of the dns control policy.
- Hit
Cnt int - The hit count of the dns control policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Hit intTime - The last hit time of the dns control policy. Unix timestamp.
- Use
Count int - The use count of the dns control policy.
- account
Id String - The account id of the dns control policy.
- hit
Cnt Integer - The hit count of the dns control policy.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Hit IntegerTime - The last hit time of the dns control policy. Unix timestamp.
- use
Count Integer - The use count of the dns control policy.
- account
Id string - The account id of the dns control policy.
- hit
Cnt number - The hit count of the dns control policy.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Hit numberTime - The last hit time of the dns control policy. Unix timestamp.
- use
Count 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_ inttime - The last hit time of the dns control policy. Unix timestamp.
- use_
count int - The use count of the dns control policy.
- account
Id String - The account id of the dns control policy.
- hit
Cnt Number - The hit count of the dns control policy.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Hit NumberTime - The last hit time of the dns control policy. Unix timestamp.
- use
Count 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.
- Account
Id 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.
- Destination
Type string - 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 stringId - The internet firewall id of the control policy.
- Last
Hit intTime - The last hit time of the dns control policy. Unix timestamp.
- Sources
List<Cfw
Dns Control Policy Source> - 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.
- Account
Id 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.
- Destination
Type string - 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 stringId - The internet firewall id of the control policy.
- Last
Hit intTime - The last hit time of the dns control policy. Unix timestamp.
- Sources
[]Cfw
Dns Control Policy Source Args - 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.
- account
Id 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.
- destination
Type String - The destination type of the dns control policy. Valid values:
group
,domain
. - hit
Cnt Integer - The hit count of the dns control policy.
- internet
Firewall StringId - The internet firewall id of the control policy.
- last
Hit IntegerTime - The last hit time of the dns control policy. Unix timestamp.
- sources
List<Cfw
Dns Control Policy Source> - The source vpc list of the dns control policy.
- status Boolean
- Whether to enable the dns control policy.
- use
Count Integer - The use count of the dns control policy.
- account
Id 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.
- destination
Type string - The destination type of the dns control policy. Valid values:
group
,domain
. - hit
Cnt number - The hit count of the dns control policy.
- internet
Firewall stringId - The internet firewall id of the control policy.
- last
Hit numberTime - The last hit time of the dns control policy. Unix timestamp.
- sources
Cfw
Dns Control Policy Source[] - The source vpc list of the dns control policy.
- status boolean
- Whether to enable the dns control policy.
- use
Count 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_ strid - The internet firewall id of the control policy.
- last_
hit_ inttime - The last hit time of the dns control policy. Unix timestamp.
- sources
Sequence[Cfw
Dns Control Policy Source Args] - 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.
- account
Id 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.
- destination
Type String - The destination type of the dns control policy. Valid values:
group
,domain
. - hit
Cnt Number - The hit count of the dns control policy.
- internet
Firewall StringId - The internet firewall id of the control policy.
- last
Hit NumberTime - 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.
- use
Count Number - The use count of the dns control policy.
Supporting Types
CfwDnsControlPolicySource, CfwDnsControlPolicySourceArgs
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.