1. Packages
  2. Alicloud Provider
  3. API Docs
  4. polardb
  5. getParameterGroups
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.polardb.getParameterGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides the PolarDB Parameter Groups of the current Alibaba Cloud user.

    NOTE: Available since v1.183.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.polardb.getParameterGroups({
        dbType: "MySQL",
        dbVersion: "8.0",
    });
    const ids = _default.then(_default => alicloud.polardb.getParameterGroups({
        ids: [_default.groups?.[0]?.id],
    }));
    export const polardbParameterGroupId1 = ids.then(ids => ids.groups?.[0]?.id);
    const nameRegex = _default.then(_default => alicloud.polardb.getParameterGroups({
        nameRegex: _default.groups?.[0]?.parameterGroupName,
    }));
    export const polardbParameterGroupId2 = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.polardb.get_parameter_groups(db_type="MySQL",
        db_version="8.0")
    ids = alicloud.polardb.get_parameter_groups(ids=[default.groups[0].id])
    pulumi.export("polardbParameterGroupId1", ids.groups[0].id)
    name_regex = alicloud.polardb.get_parameter_groups(name_regex=default.groups[0].parameter_group_name)
    pulumi.export("polardbParameterGroupId2", name_regex.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := polardb.GetParameterGroups(ctx, &polardb.GetParameterGroupsArgs{
    DbType: pulumi.StringRef("MySQL"),
    DbVersion: pulumi.StringRef("8.0"),
    }, nil);
    if err != nil {
    return err
    }
    ids, err := polardb.GetParameterGroups(ctx, &polardb.GetParameterGroupsArgs{
    Ids: interface{}{
    _default.Groups[0].Id,
    },
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("polardbParameterGroupId1", ids.Groups[0].Id)
    nameRegex, err := polardb.GetParameterGroups(ctx, &polardb.GetParameterGroupsArgs{
    NameRegex: pulumi.StringRef(_default.Groups[0].ParameterGroupName),
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("polardbParameterGroupId2", nameRegex.Groups[0].Id)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.PolarDB.GetParameterGroups.Invoke(new()
        {
            DbType = "MySQL",
            DbVersion = "8.0",
        });
    
        var ids = AliCloud.PolarDB.GetParameterGroups.Invoke(new()
        {
            Ids = new[]
            {
                @default.Apply(getParameterGroupsResult => getParameterGroupsResult.Groups[0]?.Id),
            },
        });
    
        var nameRegex = AliCloud.PolarDB.GetParameterGroups.Invoke(new()
        {
            NameRegex = @default.Apply(getParameterGroupsResult => getParameterGroupsResult.Groups[0]?.ParameterGroupName),
        });
    
        return new Dictionary<string, object?>
        {
            ["polardbParameterGroupId1"] = ids.Apply(getParameterGroupsResult => getParameterGroupsResult.Groups[0]?.Id),
            ["polardbParameterGroupId2"] = nameRegex.Apply(getParameterGroupsResult => getParameterGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.polardb.PolardbFunctions;
    import com.pulumi.alicloud.polardb.inputs.GetParameterGroupsArgs;
    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 default = PolardbFunctions.getParameterGroups(GetParameterGroupsArgs.builder()
                .dbType("MySQL")
                .dbVersion("8.0")
                .build());
    
            final var ids = PolardbFunctions.getParameterGroups(GetParameterGroupsArgs.builder()
                .ids(default_.groups()[0].id())
                .build());
    
            ctx.export("polardbParameterGroupId1", ids.applyValue(getParameterGroupsResult -> getParameterGroupsResult.groups()[0].id()));
            final var nameRegex = PolardbFunctions.getParameterGroups(GetParameterGroupsArgs.builder()
                .nameRegex(default_.groups()[0].parameterGroupName())
                .build());
    
            ctx.export("polardbParameterGroupId2", nameRegex.applyValue(getParameterGroupsResult -> getParameterGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:polardb:getParameterGroups
          Arguments:
            dbType: MySQL
            dbVersion: '8.0'
      ids:
        fn::invoke:
          Function: alicloud:polardb:getParameterGroups
          Arguments:
            ids:
              - ${default.groups[0].id}
      nameRegex:
        fn::invoke:
          Function: alicloud:polardb:getParameterGroups
          Arguments:
            nameRegex: ${default.groups[0].parameterGroupName}
    outputs:
      polardbParameterGroupId1: ${ids.groups[0].id}
      polardbParameterGroupId2: ${nameRegex.groups[0].id}
    

    Using getParameterGroups

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getParameterGroups(args: GetParameterGroupsArgs, opts?: InvokeOptions): Promise<GetParameterGroupsResult>
    function getParameterGroupsOutput(args: GetParameterGroupsOutputArgs, opts?: InvokeOptions): Output<GetParameterGroupsResult>
    def get_parameter_groups(db_type: Optional[str] = None,
                             db_version: Optional[str] = None,
                             ids: Optional[Sequence[str]] = None,
                             name_regex: Optional[str] = None,
                             output_file: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetParameterGroupsResult
    def get_parameter_groups_output(db_type: Optional[pulumi.Input[str]] = None,
                             db_version: Optional[pulumi.Input[str]] = None,
                             ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                             name_regex: Optional[pulumi.Input[str]] = None,
                             output_file: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetParameterGroupsResult]
    func GetParameterGroups(ctx *Context, args *GetParameterGroupsArgs, opts ...InvokeOption) (*GetParameterGroupsResult, error)
    func GetParameterGroupsOutput(ctx *Context, args *GetParameterGroupsOutputArgs, opts ...InvokeOption) GetParameterGroupsResultOutput

    > Note: This function is named GetParameterGroups in the Go SDK.

    public static class GetParameterGroups 
    {
        public static Task<GetParameterGroupsResult> InvokeAsync(GetParameterGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetParameterGroupsResult> Invoke(GetParameterGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetParameterGroupsResult> getParameterGroups(GetParameterGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:polardb/getParameterGroups:getParameterGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DbType string
    The type of the database engine. Only MySQL is supported.
    DbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    Ids List<string>
    A list of Parameter Group IDs.
    NameRegex string
    A regex string to filter results by Parameter Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    DbType string
    The type of the database engine. Only MySQL is supported.
    DbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    Ids []string
    A list of Parameter Group IDs.
    NameRegex string
    A regex string to filter results by Parameter Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    dbType String
    The type of the database engine. Only MySQL is supported.
    dbVersion String
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ids List<String>
    A list of Parameter Group IDs.
    nameRegex String
    A regex string to filter results by Parameter Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    dbType string
    The type of the database engine. Only MySQL is supported.
    dbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ids string[]
    A list of Parameter Group IDs.
    nameRegex string
    A regex string to filter results by Parameter Group name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    db_type str
    The type of the database engine. Only MySQL is supported.
    db_version str
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ids Sequence[str]
    A list of Parameter Group IDs.
    name_regex str
    A regex string to filter results by Parameter Group name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    dbType String
    The type of the database engine. Only MySQL is supported.
    dbVersion String
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ids List<String>
    A list of Parameter Group IDs.
    nameRegex String
    A regex string to filter results by Parameter Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getParameterGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.PolarDB.Outputs.GetParameterGroupsGroup>
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Parameter Group names.
    DbType string
    The type of the database engine.
    DbVersion string
    The version number of the database engine.
    NameRegex string
    OutputFile string
    Groups []GetParameterGroupsGroup
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Parameter Group names.
    DbType string
    The type of the database engine.
    DbVersion string
    The version number of the database engine.
    NameRegex string
    OutputFile string
    groups List<GetParameterGroupsGroup>
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Parameter Group names.
    dbType String
    The type of the database engine.
    dbVersion String
    The version number of the database engine.
    nameRegex String
    outputFile String
    groups GetParameterGroupsGroup[]
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Parameter Group names.
    dbType string
    The type of the database engine.
    dbVersion string
    The version number of the database engine.
    nameRegex string
    outputFile string
    groups Sequence[GetParameterGroupsGroup]
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Parameter Group names.
    db_type str
    The type of the database engine.
    db_version str
    The version number of the database engine.
    name_regex str
    output_file str
    groups List<Property Map>
    A list of PolarDB Parameter Groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Parameter Group names.
    dbType String
    The type of the database engine.
    dbVersion String
    The version number of the database engine.
    nameRegex String
    outputFile String

    Supporting Types

    GetParameterGroupsGroup

    CreateTime string
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    DbType string
    The type of the database engine. Only MySQL is supported.
    DbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ForceRestart string
    Indicates whether to restart the cluster when this parameter template is applied.
    Id string
    The ID of the Parameter Group.
    ParameterCounts int
    The number of parameters in the parameter template.
    ParameterGroupDesc string
    The description of the parameter template.
    ParameterGroupId string
    The ID of the Parameter Group.
    ParameterGroupName string
    The name of the parameter template.
    ParameterGroupType string
    The type of the parameter template.
    CreateTime string
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    DbType string
    The type of the database engine. Only MySQL is supported.
    DbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    ForceRestart string
    Indicates whether to restart the cluster when this parameter template is applied.
    Id string
    The ID of the Parameter Group.
    ParameterCounts int
    The number of parameters in the parameter template.
    ParameterGroupDesc string
    The description of the parameter template.
    ParameterGroupId string
    The ID of the Parameter Group.
    ParameterGroupName string
    The name of the parameter template.
    ParameterGroupType string
    The type of the parameter template.
    createTime String
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    dbType String
    The type of the database engine. Only MySQL is supported.
    dbVersion String
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    forceRestart String
    Indicates whether to restart the cluster when this parameter template is applied.
    id String
    The ID of the Parameter Group.
    parameterCounts Integer
    The number of parameters in the parameter template.
    parameterGroupDesc String
    The description of the parameter template.
    parameterGroupId String
    The ID of the Parameter Group.
    parameterGroupName String
    The name of the parameter template.
    parameterGroupType String
    The type of the parameter template.
    createTime string
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    dbType string
    The type of the database engine. Only MySQL is supported.
    dbVersion string
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    forceRestart string
    Indicates whether to restart the cluster when this parameter template is applied.
    id string
    The ID of the Parameter Group.
    parameterCounts number
    The number of parameters in the parameter template.
    parameterGroupDesc string
    The description of the parameter template.
    parameterGroupId string
    The ID of the Parameter Group.
    parameterGroupName string
    The name of the parameter template.
    parameterGroupType string
    The type of the parameter template.
    create_time str
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    db_type str
    The type of the database engine. Only MySQL is supported.
    db_version str
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    force_restart str
    Indicates whether to restart the cluster when this parameter template is applied.
    id str
    The ID of the Parameter Group.
    parameter_counts int
    The number of parameters in the parameter template.
    parameter_group_desc str
    The description of the parameter template.
    parameter_group_id str
    The ID of the Parameter Group.
    parameter_group_name str
    The name of the parameter template.
    parameter_group_type str
    The type of the parameter template.
    createTime String
    The time when the parameter template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    dbType String
    The type of the database engine. Only MySQL is supported.
    dbVersion String
    The version number of the database engine. Valid values: 5.6, 5.7, 8.0.
    forceRestart String
    Indicates whether to restart the cluster when this parameter template is applied.
    id String
    The ID of the Parameter Group.
    parameterCounts Number
    The number of parameters in the parameter template.
    parameterGroupDesc String
    The description of the parameter template.
    parameterGroupId String
    The ID of the Parameter Group.
    parameterGroupName String
    The name of the parameter template.
    parameterGroupType String
    The type of the parameter template.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi