@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
394 lines (393 loc) • 15.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a WAF dedicated instance resource within HuaweiCloud.
*
* ## Example Usage
* ### Creating with common tenant
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const azName = config.requireObject("azName");
* const ecsFlavorId = config.requireObject("ecsFlavorId");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const securityGroupId = config.requireObject("securityGroupId");
* const enterpriseProjectId = config.requireObject("enterpriseProjectId");
* const test = new huaweicloud.waf.DedicatedInstance("test", {
* availableZone: azName,
* specificationCode: "waf.instance.professional",
* ecsFlavor: ecsFlavorId,
* vpcId: vpcId,
* subnetId: subnetId,
* enterpriseProjectId: enterpriseProjectId,
* tags: {
* foo: "bar",
* key: "value",
* },
* securityGroups: [securityGroupId],
* });
* ```
* ### Creating with resource tenant
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const azName = config.requireObject("azName");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const securityGroupId = config.requireObject("securityGroupId");
* const enterpriseProjectId = config.requireObject("enterpriseProjectId");
* const test = new huaweicloud.waf.DedicatedInstance("test", {
* availableZone: azName,
* specificationCode: "waf.instance.professional",
* vpcId: vpcId,
* subnetId: subnetId,
* enterpriseProjectId: enterpriseProjectId,
* resTenant: true,
* tags: {
* foo: "bar",
* key: "value",
* },
* securityGroups: [securityGroupId],
* });
* ```
*
* ## Import
*
* There are two ways to import WAF dedicated instance state. * Using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/dedicatedInstance:DedicatedInstance test <id>
* ```
*
* * Using `id` and `enterprise_project_id`, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/dedicatedInstance:DedicatedInstance test <id>/<enterprise_project_id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`res_tenant`, `anti_affinity`, and `tags`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also, you can ignore changes as below. hcl resource "huaweicloud_waf_dedicated_instance" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* res_tenant, anti_affinity, tags,
*
* ]
*
* } }
*/
export declare class DedicatedInstance extends pulumi.CustomResource {
/**
* Get an existing DedicatedInstance 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?: DedicatedInstanceState, opts?: pulumi.CustomResourceOptions): DedicatedInstance;
/**
* Returns true if the given object is an instance of DedicatedInstance. 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 DedicatedInstance;
/**
* The access status of the instance. `0`: inaccessible, `1`: accessible.
*/
readonly accessStatus: pulumi.Output<number>;
/**
* Specifies whether to enable anti-affinity. This field is valid only
* when `resTenant` is set to **true**. Changing this will create a new instance.
*/
readonly antiAffinity: pulumi.Output<boolean | undefined>;
/**
* Specifies the available zone name for the dedicated instance. It can be
* obtained through this data source `huaweicloud.getAvailabilityZones`. Changing this will create a new instance.
*/
readonly availableZone: pulumi.Output<string>;
/**
* Specifies the ECS CPU architecture of instance. Defaults to **x86**.
* Changing this will create a new instance.
*/
readonly cpuArchitecture: pulumi.Output<string | undefined>;
/**
* Specifies the flavor of the ECS used by the WAF instance. Flavors can be
* obtained through this data source `huaweicloud.Ecs.getFlavors`. Changing this will create a new instance.
* This field is valid and required only when `resTenant` is set to **false**.
*/
readonly ecsFlavor: pulumi.Output<string>;
/**
* Specifies the enterprise project ID of WAF dedicated instance. Changing this
* will migrate the WAF instance to a new enterprise project.
* For enterprise users, if omitted, default enterprise project will be used.
*/
readonly enterpriseProjectId: pulumi.Output<string | undefined>;
/**
* schema: Deprecated;
*/
readonly groupId: pulumi.Output<string | undefined>;
/**
* Specifies the name of WAF dedicated instance. Duplicate names are allowed, we suggest to
* keeping the name unique.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the region in which to create the WAF dedicated instance.
* If omitted, the provider-level region will be used. Changing this setting will create a new instance.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies whether this is resource tenant.
* Changing this will create a new instance.
* + **false**: Common tenant.
* + **true**: Resource tenant.
*/
readonly resTenant: pulumi.Output<boolean | undefined>;
/**
* The running status of the instance. Values are:
*/
readonly runStatus: pulumi.Output<number>;
/**
* Specifies the security group of the instance. This is an array of
* security group IDs. Changing this will create a new instance.
*/
readonly securityGroups: pulumi.Output<string[]>;
/**
* The ID of the ECS hosting the dedicated engine.
*/
readonly serverId: pulumi.Output<string>;
/**
* The service plane IP address of the WAF dedicated instance.
*/
readonly serviceIp: pulumi.Output<string>;
/**
* Specifies the specification code of instance.
* Different specifications have different throughput. Changing this will create a new instance.
* Values are:
* + **waf.instance.professional**: The professional edition, corresponding to WI-500 on the console.
* + **waf.instance.enterprise**: The enterprise edition, corresponding to WI-100 on the console.
*/
readonly specificationCode: pulumi.Output<string>;
/**
* Specifies the subnet ID of WAF dedicated instance VPC. Changing this will
* create a new instance.
*/
readonly subnetId: pulumi.Output<string>;
/**
* Specifies the key/value pairs to associate with the WAF dedicated instance.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Whether the dedicated engine can be upgraded. `0`: Cannot be upgraded, `1`: Can be upgraded.
*/
readonly upgradable: pulumi.Output<number>;
/**
* Specifies the VPC ID of WAF dedicated instance. Changing this will create a new
* instance.
*/
readonly vpcId: pulumi.Output<string>;
/**
* Create a DedicatedInstance 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: DedicatedInstanceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DedicatedInstance resources.
*/
export interface DedicatedInstanceState {
/**
* The access status of the instance. `0`: inaccessible, `1`: accessible.
*/
accessStatus?: pulumi.Input<number>;
/**
* Specifies whether to enable anti-affinity. This field is valid only
* when `resTenant` is set to **true**. Changing this will create a new instance.
*/
antiAffinity?: pulumi.Input<boolean>;
/**
* Specifies the available zone name for the dedicated instance. It can be
* obtained through this data source `huaweicloud.getAvailabilityZones`. Changing this will create a new instance.
*/
availableZone?: pulumi.Input<string>;
/**
* Specifies the ECS CPU architecture of instance. Defaults to **x86**.
* Changing this will create a new instance.
*/
cpuArchitecture?: pulumi.Input<string>;
/**
* Specifies the flavor of the ECS used by the WAF instance. Flavors can be
* obtained through this data source `huaweicloud.Ecs.getFlavors`. Changing this will create a new instance.
* This field is valid and required only when `resTenant` is set to **false**.
*/
ecsFlavor?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID of WAF dedicated instance. Changing this
* will migrate the WAF instance to a new enterprise project.
* For enterprise users, if omitted, default enterprise project will be used.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* schema: Deprecated;
*/
groupId?: pulumi.Input<string>;
/**
* Specifies the name of WAF dedicated instance. Duplicate names are allowed, we suggest to
* keeping the name unique.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the WAF dedicated instance.
* If omitted, the provider-level region will be used. Changing this setting will create a new instance.
*/
region?: pulumi.Input<string>;
/**
* Specifies whether this is resource tenant.
* Changing this will create a new instance.
* + **false**: Common tenant.
* + **true**: Resource tenant.
*/
resTenant?: pulumi.Input<boolean>;
/**
* The running status of the instance. Values are:
*/
runStatus?: pulumi.Input<number>;
/**
* Specifies the security group of the instance. This is an array of
* security group IDs. Changing this will create a new instance.
*/
securityGroups?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the ECS hosting the dedicated engine.
*/
serverId?: pulumi.Input<string>;
/**
* The service plane IP address of the WAF dedicated instance.
*/
serviceIp?: pulumi.Input<string>;
/**
* Specifies the specification code of instance.
* Different specifications have different throughput. Changing this will create a new instance.
* Values are:
* + **waf.instance.professional**: The professional edition, corresponding to WI-500 on the console.
* + **waf.instance.enterprise**: The enterprise edition, corresponding to WI-100 on the console.
*/
specificationCode?: pulumi.Input<string>;
/**
* Specifies the subnet ID of WAF dedicated instance VPC. Changing this will
* create a new instance.
*/
subnetId?: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the WAF dedicated instance.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Whether the dedicated engine can be upgraded. `0`: Cannot be upgraded, `1`: Can be upgraded.
*/
upgradable?: pulumi.Input<number>;
/**
* Specifies the VPC ID of WAF dedicated instance. Changing this will create a new
* instance.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DedicatedInstance resource.
*/
export interface DedicatedInstanceArgs {
/**
* Specifies whether to enable anti-affinity. This field is valid only
* when `resTenant` is set to **true**. Changing this will create a new instance.
*/
antiAffinity?: pulumi.Input<boolean>;
/**
* Specifies the available zone name for the dedicated instance. It can be
* obtained through this data source `huaweicloud.getAvailabilityZones`. Changing this will create a new instance.
*/
availableZone: pulumi.Input<string>;
/**
* Specifies the ECS CPU architecture of instance. Defaults to **x86**.
* Changing this will create a new instance.
*/
cpuArchitecture?: pulumi.Input<string>;
/**
* Specifies the flavor of the ECS used by the WAF instance. Flavors can be
* obtained through this data source `huaweicloud.Ecs.getFlavors`. Changing this will create a new instance.
* This field is valid and required only when `resTenant` is set to **false**.
*/
ecsFlavor?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID of WAF dedicated instance. Changing this
* will migrate the WAF instance to a new enterprise project.
* For enterprise users, if omitted, default enterprise project will be used.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* schema: Deprecated;
*/
groupId?: pulumi.Input<string>;
/**
* Specifies the name of WAF dedicated instance. Duplicate names are allowed, we suggest to
* keeping the name unique.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the WAF dedicated instance.
* If omitted, the provider-level region will be used. Changing this setting will create a new instance.
*/
region?: pulumi.Input<string>;
/**
* Specifies whether this is resource tenant.
* Changing this will create a new instance.
* + **false**: Common tenant.
* + **true**: Resource tenant.
*/
resTenant?: pulumi.Input<boolean>;
/**
* Specifies the security group of the instance. This is an array of
* security group IDs. Changing this will create a new instance.
*/
securityGroups: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the specification code of instance.
* Different specifications have different throughput. Changing this will create a new instance.
* Values are:
* + **waf.instance.professional**: The professional edition, corresponding to WI-500 on the console.
* + **waf.instance.enterprise**: The enterprise edition, corresponding to WI-100 on the console.
*/
specificationCode: pulumi.Input<string>;
/**
* Specifies the subnet ID of WAF dedicated instance VPC. Changing this will
* create a new instance.
*/
subnetId: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the WAF dedicated instance.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the VPC ID of WAF dedicated instance. Changing this will create a new
* instance.
*/
vpcId: pulumi.Input<string>;
}