get Db Instance Plans
This data source provides the Gpdb Db Instance Plans of the current Alibaba Cloud user.
NOTE: Available in v1.189.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.gpdb.getDbInstancePlans({
dbInstanceId: "example_value",
ids: ["example_value"],
});
export const gpdbDbInstancePlanId1 = ids.then(ids => ids.plans?.[0]?.id);
const nameRegex = alicloud.gpdb.getDbInstancePlans({
dbInstanceId: "example_value",
nameRegex: "^my-DBInstancePlan",
});
export const gpdbDbInstancePlanId2 = nameRegex.then(nameRegex => nameRegex.plans?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.gpdb.get_db_instance_plans(db_instance_id="example_value",
ids=["example_value"])
pulumi.export("gpdbDbInstancePlanId1", ids.plans[0].id)
name_regex = alicloud.gpdb.get_db_instance_plans(db_instance_id="example_value",
name_regex="^my-DBInstancePlan")
pulumi.export("gpdbDbInstancePlanId2", name_regex.plans[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Gpdb.GetDbInstancePlans.Invoke(new()
{
DbInstanceId = "example_value",
Ids = new[]
{
"example_value",
},
});
var nameRegex = AliCloud.Gpdb.GetDbInstancePlans.Invoke(new()
{
DbInstanceId = "example_value",
NameRegex = "^my-DBInstancePlan",
});
return new Dictionary<string, object?>
{
["gpdbDbInstancePlanId1"] = ids.Apply(getDbInstancePlansResult => getDbInstancePlansResult.Plans[0]?.Id),
["gpdbDbInstancePlanId2"] = nameRegex.Apply(getDbInstancePlansResult => getDbInstancePlansResult.Plans[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := gpdb.GetDbInstancePlans(ctx, &gpdb.GetDbInstancePlansArgs{
DbInstanceId: "example_value",
Ids: []string{
"example_value",
},
}, nil)
if err != nil {
return err
}
ctx.Export("gpdbDbInstancePlanId1", ids.Plans[0].Id)
nameRegex, err := gpdb.GetDbInstancePlans(ctx, &gpdb.GetDbInstancePlansArgs{
DbInstanceId: "example_value",
NameRegex: pulumi.StringRef("^my-DBInstancePlan"),
}, nil)
if err != nil {
return err
}
ctx.Export("gpdbDbInstancePlanId2", nameRegex.Plans[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.gpdb.GpdbFunctions;
import com.pulumi.alicloud.gpdb.inputs.GetDbInstancePlansArgs;
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 ids = GpdbFunctions.getDbInstancePlans(GetDbInstancePlansArgs.builder()
.dbInstanceId("example_value")
.ids("example_value")
.build());
ctx.export("gpdbDbInstancePlanId1", ids.plans()[0].id());
final var nameRegex = GpdbFunctions.getDbInstancePlans(GetDbInstancePlansArgs.builder()
.dbInstanceId("example_value")
.nameRegex("^my-DBInstancePlan")
.build());
ctx.export("gpdbDbInstancePlanId2", nameRegex.plans()[0].id());
}
}
variables:
ids:
fn::invoke:
function: alicloud:gpdb:getDbInstancePlans
arguments:
dbInstanceId: example_value
ids:
- example_value
nameRegex:
fn::invoke:
function: alicloud:gpdb:getDbInstancePlans
arguments:
dbInstanceId: example_value
nameRegex: ^my-DBInstancePlan
outputs:
gpdbDbInstancePlanId1: ${ids.plans[0].id}
gpdbDbInstancePlanId2: ${nameRegex.plans[0].id}
Return
A collection of values returned by getDbInstancePlans.
Parameters
A collection of arguments for invoking getDbInstancePlans.
Return
A collection of values returned by getDbInstancePlans.
Parameters
The ID of the Database instance.
A list of DB Instance Plan IDs.
A regex string to filter results by DB Instance Plan name.
File name where to save data source results (after running pulumi preview
).
Plan scheduling type. Valid values: Postpone
, Regular
.
The type of the Plan. Valid values: PauseResume
, Resize
.
Planning Status. Valid values: active
, cancel
, deleted
, finished
.
See also
Return
A collection of values returned by getDbInstancePlans.
Parameters
Builder for com.pulumi.alicloud.gpdb.kotlin.inputs.GetDbInstancePlansPlainArgs.