Provides a WAFV3 Defense Resource Group resource.
For information about WAFV3 Defense Resource Group and how to use it, see What is Defense Resource Group.
NOTE: Available since v1.263.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const regionId = config.get("regionId") || "cn-hangzhou";
const defaultHaF1fD = new alicloud.wafv3.Instance("defaultHaF1fD", {});
const defaultHVcskT = new alicloud.wafv3.Domain("defaultHVcskT", {
instanceId: defaultHaF1fD.id,
listen: {
httpPorts: [80],
},
redirect: {
backends: ["6.36.36.36"],
loadbalance: "iphash",
},
domain: "1511928242963727_1.wafqax.top",
accessType: "share",
});
const defaultEH4CwO = new alicloud.wafv3.Domain("defaultEH4CwO", {
instanceId: defaultHaF1fD.id,
listen: {
httpPorts: [80],
},
redirect: {
backends: ["6.36.36.36"],
loadbalance: "iphash",
},
domain: "1511928242963727_2.wafqax.top",
accessType: "share",
});
const defaultY0ge1N = new alicloud.wafv3.Domain("defaultY0ge1N", {
instanceId: defaultHaF1fD.id,
listen: {
httpPorts: [80],
},
redirect: {
backends: ["6.36.36.36"],
loadbalance: "iphash",
},
domain: "1511928242963727_3.wafqax.top",
accessType: "share",
});
const _default = new alicloud.wafv3.DefenseResourceGroup("default", {
groupName: "examplefromTF",
resourceLists: [defaultHVcskT.domainId],
description: "example",
instanceId: defaultHaF1fD.id,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
region_id = config.get("regionId")
if region_id is None:
region_id = "cn-hangzhou"
default_ha_f1f_d = alicloud.wafv3.Instance("defaultHaF1fD")
default_h_vcsk_t = alicloud.wafv3.Domain("defaultHVcskT",
instance_id=default_ha_f1f_d.id,
listen={
"http_ports": [80],
},
redirect={
"backends": ["6.36.36.36"],
"loadbalance": "iphash",
},
domain="1511928242963727_1.wafqax.top",
access_type="share")
default_eh4_cw_o = alicloud.wafv3.Domain("defaultEH4CwO",
instance_id=default_ha_f1f_d.id,
listen={
"http_ports": [80],
},
redirect={
"backends": ["6.36.36.36"],
"loadbalance": "iphash",
},
domain="1511928242963727_2.wafqax.top",
access_type="share")
default_y0ge1_n = alicloud.wafv3.Domain("defaultY0ge1N",
instance_id=default_ha_f1f_d.id,
listen={
"http_ports": [80],
},
redirect={
"backends": ["6.36.36.36"],
"loadbalance": "iphash",
},
domain="1511928242963727_3.wafqax.top",
access_type="share")
default = alicloud.wafv3.DefenseResourceGroup("default",
group_name="examplefromTF",
resource_lists=[default_h_vcsk_t.domain_id],
description="example",
instance_id=default_ha_f1f_d.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/wafv3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
regionId := "cn-hangzhou"
if param := cfg.Get("regionId"); param != "" {
regionId = param
}
defaultHaF1fD, err := wafv3.NewInstance(ctx, "defaultHaF1fD", nil)
if err != nil {
return err
}
defaultHVcskT, err := wafv3.NewDomain(ctx, "defaultHVcskT", &wafv3.DomainArgs{
InstanceId: defaultHaF1fD.ID(),
Listen: &wafv3.DomainListenArgs{
HttpPorts: pulumi.IntArray{
pulumi.Int(80),
},
},
Redirect: &wafv3.DomainRedirectArgs{
Backends: pulumi.StringArray{
pulumi.String("6.36.36.36"),
},
Loadbalance: pulumi.String("iphash"),
},
Domain: pulumi.String("1511928242963727_1.wafqax.top"),
AccessType: pulumi.String("share"),
})
if err != nil {
return err
}
_, err = wafv3.NewDomain(ctx, "defaultEH4CwO", &wafv3.DomainArgs{
InstanceId: defaultHaF1fD.ID(),
Listen: &wafv3.DomainListenArgs{
HttpPorts: pulumi.IntArray{
pulumi.Int(80),
},
},
Redirect: &wafv3.DomainRedirectArgs{
Backends: pulumi.StringArray{
pulumi.String("6.36.36.36"),
},
Loadbalance: pulumi.String("iphash"),
},
Domain: pulumi.String("1511928242963727_2.wafqax.top"),
AccessType: pulumi.String("share"),
})
if err != nil {
return err
}
_, err = wafv3.NewDomain(ctx, "defaultY0ge1N", &wafv3.DomainArgs{
InstanceId: defaultHaF1fD.ID(),
Listen: &wafv3.DomainListenArgs{
HttpPorts: pulumi.IntArray{
pulumi.Int(80),
},
},
Redirect: &wafv3.DomainRedirectArgs{
Backends: pulumi.StringArray{
pulumi.String("6.36.36.36"),
},
Loadbalance: pulumi.String("iphash"),
},
Domain: pulumi.String("1511928242963727_3.wafqax.top"),
AccessType: pulumi.String("share"),
})
if err != nil {
return err
}
_, err = wafv3.NewDefenseResourceGroup(ctx, "default", &wafv3.DefenseResourceGroupArgs{
GroupName: pulumi.String("examplefromTF"),
ResourceLists: pulumi.StringArray{
defaultHVcskT.DomainId,
},
Description: pulumi.String("example"),
InstanceId: defaultHaF1fD.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var regionId = config.Get("regionId") ?? "cn-hangzhou";
var defaultHaF1fD = new AliCloud.Wafv3.Instance("defaultHaF1fD");
var defaultHVcskT = new AliCloud.Wafv3.Domain("defaultHVcskT", new()
{
InstanceId = defaultHaF1fD.Id,
Listen = new AliCloud.Wafv3.Inputs.DomainListenArgs
{
HttpPorts = new[]
{
80,
},
},
Redirect = new AliCloud.Wafv3.Inputs.DomainRedirectArgs
{
Backends = new[]
{
"6.36.36.36",
},
Loadbalance = "iphash",
},
DomainName = "1511928242963727_1.wafqax.top",
AccessType = "share",
});
var defaultEH4CwO = new AliCloud.Wafv3.Domain("defaultEH4CwO", new()
{
InstanceId = defaultHaF1fD.Id,
Listen = new AliCloud.Wafv3.Inputs.DomainListenArgs
{
HttpPorts = new[]
{
80,
},
},
Redirect = new AliCloud.Wafv3.Inputs.DomainRedirectArgs
{
Backends = new[]
{
"6.36.36.36",
},
Loadbalance = "iphash",
},
DomainName = "1511928242963727_2.wafqax.top",
AccessType = "share",
});
var defaultY0ge1N = new AliCloud.Wafv3.Domain("defaultY0ge1N", new()
{
InstanceId = defaultHaF1fD.Id,
Listen = new AliCloud.Wafv3.Inputs.DomainListenArgs
{
HttpPorts = new[]
{
80,
},
},
Redirect = new AliCloud.Wafv3.Inputs.DomainRedirectArgs
{
Backends = new[]
{
"6.36.36.36",
},
Loadbalance = "iphash",
},
DomainName = "1511928242963727_3.wafqax.top",
AccessType = "share",
});
var @default = new AliCloud.Wafv3.DefenseResourceGroup("default", new()
{
GroupName = "examplefromTF",
ResourceLists = new[]
{
defaultHVcskT.DomainId,
},
Description = "example",
InstanceId = defaultHaF1fD.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.wafv3.Instance;
import com.pulumi.alicloud.wafv3.Domain;
import com.pulumi.alicloud.wafv3.DomainArgs;
import com.pulumi.alicloud.wafv3.inputs.DomainListenArgs;
import com.pulumi.alicloud.wafv3.inputs.DomainRedirectArgs;
import com.pulumi.alicloud.wafv3.DefenseResourceGroup;
import com.pulumi.alicloud.wafv3.DefenseResourceGroupArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var regionId = config.get("regionId").orElse("cn-hangzhou");
var defaultHaF1fD = new Instance("defaultHaF1fD");
var defaultHVcskT = new Domain("defaultHVcskT", DomainArgs.builder()
.instanceId(defaultHaF1fD.id())
.listen(DomainListenArgs.builder()
.httpPorts(80)
.build())
.redirect(DomainRedirectArgs.builder()
.backends("6.36.36.36")
.loadbalance("iphash")
.build())
.domain("1511928242963727_1.wafqax.top")
.accessType("share")
.build());
var defaultEH4CwO = new Domain("defaultEH4CwO", DomainArgs.builder()
.instanceId(defaultHaF1fD.id())
.listen(DomainListenArgs.builder()
.httpPorts(80)
.build())
.redirect(DomainRedirectArgs.builder()
.backends("6.36.36.36")
.loadbalance("iphash")
.build())
.domain("1511928242963727_2.wafqax.top")
.accessType("share")
.build());
var defaultY0ge1N = new Domain("defaultY0ge1N", DomainArgs.builder()
.instanceId(defaultHaF1fD.id())
.listen(DomainListenArgs.builder()
.httpPorts(80)
.build())
.redirect(DomainRedirectArgs.builder()
.backends("6.36.36.36")
.loadbalance("iphash")
.build())
.domain("1511928242963727_3.wafqax.top")
.accessType("share")
.build());
var default_ = new DefenseResourceGroup("default", DefenseResourceGroupArgs.builder()
.groupName("examplefromTF")
.resourceLists(defaultHVcskT.domainId())
.description("example")
.instanceId(defaultHaF1fD.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
regionId:
type: string
default: cn-hangzhou
resources:
defaultHaF1fD:
type: alicloud:wafv3:Instance
defaultHVcskT:
type: alicloud:wafv3:Domain
properties:
instanceId: ${defaultHaF1fD.id}
listen:
httpPorts:
- '80'
redirect:
backends:
- 6.36.36.36
loadbalance: iphash
domain: 1511928242963727_1.wafqax.top
accessType: share
defaultEH4CwO:
type: alicloud:wafv3:Domain
properties:
instanceId: ${defaultHaF1fD.id}
listen:
httpPorts:
- '80'
redirect:
backends:
- 6.36.36.36
loadbalance: iphash
domain: 1511928242963727_2.wafqax.top
accessType: share
defaultY0ge1N:
type: alicloud:wafv3:Domain
properties:
instanceId: ${defaultHaF1fD.id}
listen:
httpPorts:
- '80'
redirect:
backends:
- 6.36.36.36
loadbalance: iphash
domain: 1511928242963727_3.wafqax.top
accessType: share
default:
type: alicloud:wafv3:DefenseResourceGroup
properties:
groupName: examplefromTF
resourceLists:
- ${defaultHVcskT.domainId}
description: example
instanceId: ${defaultHaF1fD.id}
Create DefenseResourceGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DefenseResourceGroup(name: string, args: DefenseResourceGroupArgs, opts?: CustomResourceOptions);@overload
def DefenseResourceGroup(resource_name: str,
args: DefenseResourceGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DefenseResourceGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_name: Optional[str] = None,
instance_id: Optional[str] = None,
description: Optional[str] = None,
resource_lists: Optional[Sequence[str]] = None)func NewDefenseResourceGroup(ctx *Context, name string, args DefenseResourceGroupArgs, opts ...ResourceOption) (*DefenseResourceGroup, error)public DefenseResourceGroup(string name, DefenseResourceGroupArgs args, CustomResourceOptions? opts = null)
public DefenseResourceGroup(String name, DefenseResourceGroupArgs args)
public DefenseResourceGroup(String name, DefenseResourceGroupArgs args, CustomResourceOptions options)
type: alicloud:wafv3:DefenseResourceGroup
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 DefenseResourceGroupArgs
- 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 DefenseResourceGroupArgs
- 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 DefenseResourceGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DefenseResourceGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DefenseResourceGroupArgs
- 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 defenseResourceGroupResource = new AliCloud.Wafv3.DefenseResourceGroup("defenseResourceGroupResource", new()
{
GroupName = "string",
InstanceId = "string",
Description = "string",
ResourceLists = new[]
{
"string",
},
});
example, err := wafv3.NewDefenseResourceGroup(ctx, "defenseResourceGroupResource", &wafv3.DefenseResourceGroupArgs{
GroupName: pulumi.String("string"),
InstanceId: pulumi.String("string"),
Description: pulumi.String("string"),
ResourceLists: pulumi.StringArray{
pulumi.String("string"),
},
})
var defenseResourceGroupResource = new DefenseResourceGroup("defenseResourceGroupResource", DefenseResourceGroupArgs.builder()
.groupName("string")
.instanceId("string")
.description("string")
.resourceLists("string")
.build());
defense_resource_group_resource = alicloud.wafv3.DefenseResourceGroup("defenseResourceGroupResource",
group_name="string",
instance_id="string",
description="string",
resource_lists=["string"])
const defenseResourceGroupResource = new alicloud.wafv3.DefenseResourceGroup("defenseResourceGroupResource", {
groupName: "string",
instanceId: "string",
description: "string",
resourceLists: ["string"],
});
type: alicloud:wafv3:DefenseResourceGroup
properties:
description: string
groupName: string
instanceId: string
resourceLists:
- string
DefenseResourceGroup 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 DefenseResourceGroup resource accepts the following input properties:
- Group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- Instance
Id string - The ID of the WAF instance.
- Description string
- The description of the protected object group.
- Resource
Lists List<string> - The names of the protected objects that are added to the protected object group.
- Group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- Instance
Id string - The ID of the WAF instance.
- Description string
- The description of the protected object group.
- Resource
Lists []string - The names of the protected objects that are added to the protected object group.
- group
Name String - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id String - The ID of the WAF instance.
- description String
- The description of the protected object group.
- resource
Lists List<String> - The names of the protected objects that are added to the protected object group.
- group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id string - The ID of the WAF instance.
- description string
- The description of the protected object group.
- resource
Lists string[] - The names of the protected objects that are added to the protected object group.
- group_
name str - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance_
id str - The ID of the WAF instance.
- description str
- The description of the protected object group.
- resource_
lists Sequence[str] - The names of the protected objects that are added to the protected object group.
- group
Name String - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id String - The ID of the WAF instance.
- description String
- The description of the protected object group.
- resource
Lists List<String> - The names of the protected objects that are added to the protected object group.
Outputs
All input properties are implicitly available as output properties. Additionally, the DefenseResourceGroup resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing DefenseResourceGroup Resource
Get an existing DefenseResourceGroup 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?: DefenseResourceGroupState, opts?: CustomResourceOptions): DefenseResourceGroup@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
group_name: Optional[str] = None,
instance_id: Optional[str] = None,
resource_lists: Optional[Sequence[str]] = None) -> DefenseResourceGroupfunc GetDefenseResourceGroup(ctx *Context, name string, id IDInput, state *DefenseResourceGroupState, opts ...ResourceOption) (*DefenseResourceGroup, error)public static DefenseResourceGroup Get(string name, Input<string> id, DefenseResourceGroupState? state, CustomResourceOptions? opts = null)public static DefenseResourceGroup get(String name, Output<String> id, DefenseResourceGroupState state, CustomResourceOptions options)resources: _: type: alicloud:wafv3:DefenseResourceGroup 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.
- Description string
- The description of the protected object group.
- Group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- Instance
Id string - The ID of the WAF instance.
- Resource
Lists List<string> - The names of the protected objects that are added to the protected object group.
- Description string
- The description of the protected object group.
- Group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- Instance
Id string - The ID of the WAF instance.
- Resource
Lists []string - The names of the protected objects that are added to the protected object group.
- description String
- The description of the protected object group.
- group
Name String - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id String - The ID of the WAF instance.
- resource
Lists List<String> - The names of the protected objects that are added to the protected object group.
- description string
- The description of the protected object group.
- group
Name string - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id string - The ID of the WAF instance.
- resource
Lists string[] - The names of the protected objects that are added to the protected object group.
- description str
- The description of the protected object group.
- group_
name str - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance_
id str - The ID of the WAF instance.
- resource_
lists Sequence[str] - The names of the protected objects that are added to the protected object group.
- description String
- The description of the protected object group.
- group
Name String - The name of the protected object group. The name must be 1 to 255 characters long and can contain Chinese characters, letters, digits, underscores (_), periods (.), and hyphens (-)
- instance
Id String - The ID of the WAF instance.
- resource
Lists List<String> - The names of the protected objects that are added to the protected object group.
Import
WAFV3 Defense Resource Group can be imported using the id, e.g.
$ pulumi import alicloud:wafv3/defenseResourceGroup:DefenseResourceGroup example <instance_id>:<group_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
