Documentation
¶
Index ¶
- type SwitchDasPro
- type SwitchDasProArgs
- type SwitchDasProArray
- type SwitchDasProArrayInput
- type SwitchDasProArrayOutput
- func (SwitchDasProArrayOutput) ElementType() reflect.Type
- func (o SwitchDasProArrayOutput) Index(i pulumi.IntInput) SwitchDasProOutput
- func (o SwitchDasProArrayOutput) ToSwitchDasProArrayOutput() SwitchDasProArrayOutput
- func (o SwitchDasProArrayOutput) ToSwitchDasProArrayOutputWithContext(ctx context.Context) SwitchDasProArrayOutput
- type SwitchDasProInput
- type SwitchDasProMap
- type SwitchDasProMapInput
- type SwitchDasProMapOutput
- func (SwitchDasProMapOutput) ElementType() reflect.Type
- func (o SwitchDasProMapOutput) MapIndex(k pulumi.StringInput) SwitchDasProOutput
- func (o SwitchDasProMapOutput) ToSwitchDasProMapOutput() SwitchDasProMapOutput
- func (o SwitchDasProMapOutput) ToSwitchDasProMapOutputWithContext(ctx context.Context) SwitchDasProMapOutput
- type SwitchDasProOutput
- func (SwitchDasProOutput) ElementType() reflect.Type
- func (o SwitchDasProOutput) InstanceId() pulumi.StringOutput
- func (o SwitchDasProOutput) SqlRetention() pulumi.IntOutput
- func (o SwitchDasProOutput) Status() pulumi.BoolOutput
- func (o SwitchDasProOutput) ToSwitchDasProOutput() SwitchDasProOutput
- func (o SwitchDasProOutput) ToSwitchDasProOutputWithContext(ctx context.Context) SwitchDasProOutput
- func (o SwitchDasProOutput) UserId() pulumi.StringOutput
- type SwitchDasProState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SwitchDasPro ¶
type SwitchDasPro struct { pulumi.CustomResourceState // The ID of the database instance. InstanceId pulumi.StringOutput `pulumi:"instanceId"` // The storage duration of SQL Explorer data. Valid values: `30`, `180`, `365`, `1095`, `1825`. Unit: days. Default value: `30`. SqlRetention pulumi.IntOutput `pulumi:"sqlRetention"` // Whether the database instance has DAS professional. Status pulumi.BoolOutput `pulumi:"status"` // The ID of the Alibaba Cloud account that is used to create the database instance. UserId pulumi.StringOutput `pulumi:"userId"` }
Provides a DAS Switch Das Pro resource.
For information about DAS Switch Das Pro and how to use it, see [What is Switch Das Pro](https://www.alibabacloud.com/help/en/database-autonomy-service/latest/enabledaspro).
> **NOTE:** Available since v1.193.0.
## Example Usage
Basic Usage ¶
```go package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud" "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/das" "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb" "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc" "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 := "tfexample" if param := cfg.Get("name"); param != "" { name = param } defaultAccount, err := alicloud.GetAccount(ctx, nil, nil) if err != nil { return err } defaultNodeClasses, err := polardb.GetNodeClasses(ctx, &polardb.GetNodeClassesArgs{ DbType: pulumi.StringRef("MySQL"), DbVersion: pulumi.StringRef("8.0"), PayType: "PostPaid", }, nil) if err != nil { return err } defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{ VpcName: pulumi.String(name), CidrBlock: pulumi.String("172.16.0.0/16"), }) if err != nil { return err } defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{ VpcId: defaultNetwork.ID(), CidrBlock: pulumi.String("172.16.0.0/24"), ZoneId: *pulumi.String(defaultNodeClasses.Classes[0].ZoneId), VswitchName: pulumi.String(name), }) if err != nil { return err } defaultCluster, err := polardb.NewCluster(ctx, "defaultCluster", &polardb.ClusterArgs{ DbType: pulumi.String("MySQL"), DbVersion: pulumi.String("8.0"), DbNodeClass: pulumi.String("polar.mysql.x4.large"), PayType: pulumi.String("PostPaid"), VswitchId: defaultSwitch.ID(), Description: pulumi.String(name), DbClusterIpArrays: polardb.ClusterDbClusterIpArrayArray{ &polardb.ClusterDbClusterIpArrayArgs{ DbClusterIpArrayName: pulumi.String("default"), SecurityIps: pulumi.StringArray{ pulumi.String("1.2.3.4"), pulumi.String("1.2.3.5"), }, }, }, }) if err != nil { return err } _, err = das.NewSwitchDasPro(ctx, "defaultSwitchDasPro", &das.SwitchDasProArgs{ InstanceId: defaultCluster.ID(), SqlRetention: pulumi.Int(30), UserId: *pulumi.String(defaultAccount.Id), }) if err != nil { return err } return nil }) }
```
## Import
DAS Switch Das Pro can be imported using the id, e.g.
```sh
$ pulumi import alicloud:das/switchDasPro:SwitchDasPro example <id>
```
func GetSwitchDasPro ¶
func GetSwitchDasPro(ctx *pulumi.Context, name string, id pulumi.IDInput, state *SwitchDasProState, opts ...pulumi.ResourceOption) (*SwitchDasPro, error)
GetSwitchDasPro gets an existing SwitchDasPro resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewSwitchDasPro ¶
func NewSwitchDasPro(ctx *pulumi.Context, name string, args *SwitchDasProArgs, opts ...pulumi.ResourceOption) (*SwitchDasPro, error)
NewSwitchDasPro registers a new resource with the given unique name, arguments, and options.
func (*SwitchDasPro) ElementType ¶
func (*SwitchDasPro) ElementType() reflect.Type
func (*SwitchDasPro) ToSwitchDasProOutput ¶
func (i *SwitchDasPro) ToSwitchDasProOutput() SwitchDasProOutput
func (*SwitchDasPro) ToSwitchDasProOutputWithContext ¶
func (i *SwitchDasPro) ToSwitchDasProOutputWithContext(ctx context.Context) SwitchDasProOutput
type SwitchDasProArgs ¶
type SwitchDasProArgs struct { // The ID of the database instance. InstanceId pulumi.StringInput // The storage duration of SQL Explorer data. Valid values: `30`, `180`, `365`, `1095`, `1825`. Unit: days. Default value: `30`. SqlRetention pulumi.IntPtrInput // The ID of the Alibaba Cloud account that is used to create the database instance. UserId pulumi.StringPtrInput }
The set of arguments for constructing a SwitchDasPro resource.
func (SwitchDasProArgs) ElementType ¶
func (SwitchDasProArgs) ElementType() reflect.Type
type SwitchDasProArray ¶
type SwitchDasProArray []SwitchDasProInput
func (SwitchDasProArray) ElementType ¶
func (SwitchDasProArray) ElementType() reflect.Type
func (SwitchDasProArray) ToSwitchDasProArrayOutput ¶
func (i SwitchDasProArray) ToSwitchDasProArrayOutput() SwitchDasProArrayOutput
func (SwitchDasProArray) ToSwitchDasProArrayOutputWithContext ¶
func (i SwitchDasProArray) ToSwitchDasProArrayOutputWithContext(ctx context.Context) SwitchDasProArrayOutput
type SwitchDasProArrayInput ¶
type SwitchDasProArrayInput interface { pulumi.Input ToSwitchDasProArrayOutput() SwitchDasProArrayOutput ToSwitchDasProArrayOutputWithContext(context.Context) SwitchDasProArrayOutput }
SwitchDasProArrayInput is an input type that accepts SwitchDasProArray and SwitchDasProArrayOutput values. You can construct a concrete instance of `SwitchDasProArrayInput` via:
SwitchDasProArray{ SwitchDasProArgs{...} }
type SwitchDasProArrayOutput ¶
type SwitchDasProArrayOutput struct{ *pulumi.OutputState }
func (SwitchDasProArrayOutput) ElementType ¶
func (SwitchDasProArrayOutput) ElementType() reflect.Type
func (SwitchDasProArrayOutput) Index ¶
func (o SwitchDasProArrayOutput) Index(i pulumi.IntInput) SwitchDasProOutput
func (SwitchDasProArrayOutput) ToSwitchDasProArrayOutput ¶
func (o SwitchDasProArrayOutput) ToSwitchDasProArrayOutput() SwitchDasProArrayOutput
func (SwitchDasProArrayOutput) ToSwitchDasProArrayOutputWithContext ¶
func (o SwitchDasProArrayOutput) ToSwitchDasProArrayOutputWithContext(ctx context.Context) SwitchDasProArrayOutput
type SwitchDasProInput ¶
type SwitchDasProInput interface { pulumi.Input ToSwitchDasProOutput() SwitchDasProOutput ToSwitchDasProOutputWithContext(ctx context.Context) SwitchDasProOutput }
type SwitchDasProMap ¶
type SwitchDasProMap map[string]SwitchDasProInput
func (SwitchDasProMap) ElementType ¶
func (SwitchDasProMap) ElementType() reflect.Type
func (SwitchDasProMap) ToSwitchDasProMapOutput ¶
func (i SwitchDasProMap) ToSwitchDasProMapOutput() SwitchDasProMapOutput
func (SwitchDasProMap) ToSwitchDasProMapOutputWithContext ¶
func (i SwitchDasProMap) ToSwitchDasProMapOutputWithContext(ctx context.Context) SwitchDasProMapOutput
type SwitchDasProMapInput ¶
type SwitchDasProMapInput interface { pulumi.Input ToSwitchDasProMapOutput() SwitchDasProMapOutput ToSwitchDasProMapOutputWithContext(context.Context) SwitchDasProMapOutput }
SwitchDasProMapInput is an input type that accepts SwitchDasProMap and SwitchDasProMapOutput values. You can construct a concrete instance of `SwitchDasProMapInput` via:
SwitchDasProMap{ "key": SwitchDasProArgs{...} }
type SwitchDasProMapOutput ¶
type SwitchDasProMapOutput struct{ *pulumi.OutputState }
func (SwitchDasProMapOutput) ElementType ¶
func (SwitchDasProMapOutput) ElementType() reflect.Type
func (SwitchDasProMapOutput) MapIndex ¶
func (o SwitchDasProMapOutput) MapIndex(k pulumi.StringInput) SwitchDasProOutput
func (SwitchDasProMapOutput) ToSwitchDasProMapOutput ¶
func (o SwitchDasProMapOutput) ToSwitchDasProMapOutput() SwitchDasProMapOutput
func (SwitchDasProMapOutput) ToSwitchDasProMapOutputWithContext ¶
func (o SwitchDasProMapOutput) ToSwitchDasProMapOutputWithContext(ctx context.Context) SwitchDasProMapOutput
type SwitchDasProOutput ¶
type SwitchDasProOutput struct{ *pulumi.OutputState }
func (SwitchDasProOutput) ElementType ¶
func (SwitchDasProOutput) ElementType() reflect.Type
func (SwitchDasProOutput) InstanceId ¶
func (o SwitchDasProOutput) InstanceId() pulumi.StringOutput
The ID of the database instance.
func (SwitchDasProOutput) SqlRetention ¶
func (o SwitchDasProOutput) SqlRetention() pulumi.IntOutput
The storage duration of SQL Explorer data. Valid values: `30`, `180`, `365`, `1095`, `1825`. Unit: days. Default value: `30`.
func (SwitchDasProOutput) Status ¶
func (o SwitchDasProOutput) Status() pulumi.BoolOutput
Whether the database instance has DAS professional.
func (SwitchDasProOutput) ToSwitchDasProOutput ¶
func (o SwitchDasProOutput) ToSwitchDasProOutput() SwitchDasProOutput
func (SwitchDasProOutput) ToSwitchDasProOutputWithContext ¶
func (o SwitchDasProOutput) ToSwitchDasProOutputWithContext(ctx context.Context) SwitchDasProOutput
func (SwitchDasProOutput) UserId ¶
func (o SwitchDasProOutput) UserId() pulumi.StringOutput
The ID of the Alibaba Cloud account that is used to create the database instance.
type SwitchDasProState ¶
type SwitchDasProState struct { // The ID of the database instance. InstanceId pulumi.StringPtrInput // The storage duration of SQL Explorer data. Valid values: `30`, `180`, `365`, `1095`, `1825`. Unit: days. Default value: `30`. SqlRetention pulumi.IntPtrInput // Whether the database instance has DAS professional. Status pulumi.BoolPtrInput // The ID of the Alibaba Cloud account that is used to create the database instance. UserId pulumi.StringPtrInput }
func (SwitchDasProState) ElementType ¶
func (SwitchDasProState) ElementType() reflect.Type