1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. oos
  5. getParameters
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.oos.getParameters

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Oos Parameters of the current Alibaba Cloud user.

    NOTE: Available in v1.147.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.oos.getParameters({
        ids: ["my-Parameter"],
    });
    export const oosParameterId1 = ids.then(ids => ids.parameters?.[0]?.id);
    const nameRegex = alicloud.oos.getParameters({
        nameRegex: "^my-Parameter",
    });
    export const oosParameterId2 = nameRegex.then(nameRegex => nameRegex.parameters?.[0]?.id);
    const resourceGroupId = alicloud.oos.getParameters({
        ids: ["my-Parameter"],
        resourceGroupId: "example_value",
    });
    export const oosParameterId3 = resourceGroupId.then(resourceGroupId => resourceGroupId.parameters?.[0]?.id);
    const tags = alicloud.oos.getParameters({
        ids: ["my-Parameter"],
        tags: {
            Created: "TF",
            For: "OosParameter",
        },
    });
    export const oosParameterId4 = tags.then(tags => tags.parameters?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.oos.get_parameters(ids=["my-Parameter"])
    pulumi.export("oosParameterId1", ids.parameters[0].id)
    name_regex = alicloud.oos.get_parameters(name_regex="^my-Parameter")
    pulumi.export("oosParameterId2", name_regex.parameters[0].id)
    resource_group_id = alicloud.oos.get_parameters(ids=["my-Parameter"],
        resource_group_id="example_value")
    pulumi.export("oosParameterId3", resource_group_id.parameters[0].id)
    tags = alicloud.oos.get_parameters(ids=["my-Parameter"],
        tags={
            "Created": "TF",
            "For": "OosParameter",
        })
    pulumi.export("oosParameterId4", tags.parameters[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := oos.GetParameters(ctx, &oos.GetParametersArgs{
    			Ids: []string{
    				"my-Parameter",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("oosParameterId1", ids.Parameters[0].Id)
    		nameRegex, err := oos.GetParameters(ctx, &oos.GetParametersArgs{
    			NameRegex: pulumi.StringRef("^my-Parameter"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("oosParameterId2", nameRegex.Parameters[0].Id)
    		resourceGroupId, err := oos.GetParameters(ctx, &oos.GetParametersArgs{
    			Ids: []string{
    				"my-Parameter",
    			},
    			ResourceGroupId: pulumi.StringRef("example_value"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("oosParameterId3", resourceGroupId.Parameters[0].Id)
    		tags, err := oos.GetParameters(ctx, &oos.GetParametersArgs{
    			Ids: []string{
    				"my-Parameter",
    			},
    			Tags: map[string]interface{}{
    				"Created": "TF",
    				"For":     "OosParameter",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("oosParameterId4", tags.Parameters[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Oos.GetParameters.Invoke(new()
        {
            Ids = new[]
            {
                "my-Parameter",
            },
        });
    
        var nameRegex = AliCloud.Oos.GetParameters.Invoke(new()
        {
            NameRegex = "^my-Parameter",
        });
    
        var resourceGroupId = AliCloud.Oos.GetParameters.Invoke(new()
        {
            Ids = new[]
            {
                "my-Parameter",
            },
            ResourceGroupId = "example_value",
        });
    
        var tags = AliCloud.Oos.GetParameters.Invoke(new()
        {
            Ids = new[]
            {
                "my-Parameter",
            },
            Tags = 
            {
                { "Created", "TF" },
                { "For", "OosParameter" },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["oosParameterId1"] = ids.Apply(getParametersResult => getParametersResult.Parameters[0]?.Id),
            ["oosParameterId2"] = nameRegex.Apply(getParametersResult => getParametersResult.Parameters[0]?.Id),
            ["oosParameterId3"] = resourceGroupId.Apply(getParametersResult => getParametersResult.Parameters[0]?.Id),
            ["oosParameterId4"] = tags.Apply(getParametersResult => getParametersResult.Parameters[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.oos.OosFunctions;
    import com.pulumi.alicloud.oos.inputs.GetParametersArgs;
    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 = OosFunctions.getParameters(GetParametersArgs.builder()
                .ids("my-Parameter")
                .build());
    
            ctx.export("oosParameterId1", ids.applyValue(getParametersResult -> getParametersResult.parameters()[0].id()));
            final var nameRegex = OosFunctions.getParameters(GetParametersArgs.builder()
                .nameRegex("^my-Parameter")
                .build());
    
            ctx.export("oosParameterId2", nameRegex.applyValue(getParametersResult -> getParametersResult.parameters()[0].id()));
            final var resourceGroupId = OosFunctions.getParameters(GetParametersArgs.builder()
                .ids("my-Parameter")
                .resourceGroupId("example_value")
                .build());
    
            ctx.export("oosParameterId3", resourceGroupId.applyValue(getParametersResult -> getParametersResult.parameters()[0].id()));
            final var tags = OosFunctions.getParameters(GetParametersArgs.builder()
                .ids("my-Parameter")
                .tags(Map.ofEntries(
                    Map.entry("Created", "TF"),
                    Map.entry("For", "OosParameter")
                ))
                .build());
    
            ctx.export("oosParameterId4", tags.applyValue(getParametersResult -> getParametersResult.parameters()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:oos:getParameters
          Arguments:
            ids:
              - my-Parameter
      nameRegex:
        fn::invoke:
          Function: alicloud:oos:getParameters
          Arguments:
            nameRegex: ^my-Parameter
      resourceGroupId:
        fn::invoke:
          Function: alicloud:oos:getParameters
          Arguments:
            ids:
              - my-Parameter
            resourceGroupId: example_value
      tags:
        fn::invoke:
          Function: alicloud:oos:getParameters
          Arguments:
            ids:
              - my-Parameter
            tags:
              Created: TF
              For: OosParameter
    outputs:
      oosParameterId1: ${ids.parameters[0].id}
      oosParameterId2: ${nameRegex.parameters[0].id}
      oosParameterId3: ${resourceGroupId.parameters[0].id}
      oosParameterId4: ${tags.parameters[0].id}
    

    Using getParameters

    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 getParameters(args: GetParametersArgs, opts?: InvokeOptions): Promise<GetParametersResult>
    function getParametersOutput(args: GetParametersOutputArgs, opts?: InvokeOptions): Output<GetParametersResult>
    def get_parameters(enable_details: Optional[bool] = None,
                       ids: Optional[Sequence[str]] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       parameter_name: Optional[str] = None,
                       resource_group_id: Optional[str] = None,
                       sort_field: Optional[str] = None,
                       sort_order: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       type: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetParametersResult
    def get_parameters_output(enable_details: Optional[pulumi.Input[bool]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       parameter_name: Optional[pulumi.Input[str]] = None,
                       resource_group_id: Optional[pulumi.Input[str]] = None,
                       sort_field: Optional[pulumi.Input[str]] = None,
                       sort_order: Optional[pulumi.Input[str]] = None,
                       tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                       type: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetParametersResult]
    func GetParameters(ctx *Context, args *GetParametersArgs, opts ...InvokeOption) (*GetParametersResult, error)
    func GetParametersOutput(ctx *Context, args *GetParametersOutputArgs, opts ...InvokeOption) GetParametersResultOutput

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

    public static class GetParameters 
    {
        public static Task<GetParametersResult> InvokeAsync(GetParametersArgs args, InvokeOptions? opts = null)
        public static Output<GetParametersResult> Invoke(GetParametersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetParametersResult> getParameters(GetParametersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:oos/getParameters:getParameters
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Parameter IDs. Its element value is same as Parameter Name.
    NameRegex string
    A regex string to filter results by Parameter name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ParameterName string
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    ResourceGroupId string
    The ID of the Resource Group.
    SortField string
    SortOrder string
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Type string
    The data type of the common parameter. Valid values: String and StringList.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Parameter IDs. Its element value is same as Parameter Name.
    NameRegex string
    A regex string to filter results by Parameter name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ParameterName string
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    ResourceGroupId string
    The ID of the Resource Group.
    SortField string
    SortOrder string
    Tags map[string]string
    A mapping of tags to assign to the resource.
    Type string
    The data type of the common parameter. Valid values: String and StringList.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Parameter IDs. Its element value is same as Parameter Name.
    nameRegex String
    A regex string to filter results by Parameter name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    parameterName String
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    resourceGroupId String
    The ID of the Resource Group.
    sortField String
    sortOrder String
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    type String
    The data type of the common parameter. Valid values: String and StringList.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Parameter IDs. Its element value is same as Parameter Name.
    nameRegex string
    A regex string to filter results by Parameter name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    parameterName string
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    resourceGroupId string
    The ID of the Resource Group.
    sortField string
    sortOrder string
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    type string
    The data type of the common parameter. Valid values: String and StringList.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Parameter IDs. Its element value is same as Parameter Name.
    name_regex str
    A regex string to filter results by Parameter name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    parameter_name str
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    resource_group_id str
    The ID of the Resource Group.
    sort_field str
    sort_order str
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    type str
    The data type of the common parameter. Valid values: String and StringList.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Parameter IDs. Its element value is same as Parameter Name.
    nameRegex String
    A regex string to filter results by Parameter name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    parameterName String
    The name of the common parameter. You can enter a keyword to query parameter names in fuzzy match mode.
    resourceGroupId String
    The ID of the Resource Group.
    sortField String
    sortOrder String
    tags Map<String>
    A mapping of tags to assign to the resource.
    type String
    The data type of the common parameter. Valid values: String and StringList.

    getParameters Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Parameters List<Pulumi.AliCloud.Oos.Outputs.GetParametersParameter>
    EnableDetails bool
    NameRegex string
    OutputFile string
    ParameterName string
    ResourceGroupId string
    SortField string
    SortOrder string
    Tags Dictionary<string, string>
    Type string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Parameters []GetParametersParameter
    EnableDetails bool
    NameRegex string
    OutputFile string
    ParameterName string
    ResourceGroupId string
    SortField string
    SortOrder string
    Tags map[string]string
    Type string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    parameters List<GetParametersParameter>
    enableDetails Boolean
    nameRegex String
    outputFile String
    parameterName String
    resourceGroupId String
    sortField String
    sortOrder String
    tags Map<String,String>
    type String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    parameters GetParametersParameter[]
    enableDetails boolean
    nameRegex string
    outputFile string
    parameterName string
    resourceGroupId string
    sortField string
    sortOrder string
    tags {[key: string]: string}
    type string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    parameters Sequence[GetParametersParameter]
    enable_details bool
    name_regex str
    output_file str
    parameter_name str
    resource_group_id str
    sort_field str
    sort_order str
    tags Mapping[str, str]
    type str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    parameters List<Property Map>
    enableDetails Boolean
    nameRegex String
    outputFile String
    parameterName String
    resourceGroupId String
    sortField String
    sortOrder String
    tags Map<String>
    type String

    Supporting Types

    GetParametersParameter

    Constraints string
    The constraints of the common parameter.
    CreateTime string
    The time when the common parameter was created.
    CreatedBy string
    The user who created the common parameter.
    Description string
    The description of the common parameter.
    Id string
    The ID of the Parameter. Its value is same as parameter_name.
    ParameterId string
    The ID of the common parameter.
    ParameterName string
    The name of the common parameter.
    ParameterVersion int
    The version number of the common parameter.
    ResourceGroupId string
    The ID of the Resource Group.
    ShareType string
    The share type of the common parameter.
    Tags Dictionary<string, string>
    The tag of the resource.
    Type string
    The data type of the common parameter.
    UpdatedBy string
    The user who updated the common parameter.
    UpdatedDate string
    The time when the common parameter was updated.
    Value string
    The value of the common parameter.
    Constraints string
    The constraints of the common parameter.
    CreateTime string
    The time when the common parameter was created.
    CreatedBy string
    The user who created the common parameter.
    Description string
    The description of the common parameter.
    Id string
    The ID of the Parameter. Its value is same as parameter_name.
    ParameterId string
    The ID of the common parameter.
    ParameterName string
    The name of the common parameter.
    ParameterVersion int
    The version number of the common parameter.
    ResourceGroupId string
    The ID of the Resource Group.
    ShareType string
    The share type of the common parameter.
    Tags map[string]string
    The tag of the resource.
    Type string
    The data type of the common parameter.
    UpdatedBy string
    The user who updated the common parameter.
    UpdatedDate string
    The time when the common parameter was updated.
    Value string
    The value of the common parameter.
    constraints String
    The constraints of the common parameter.
    createTime String
    The time when the common parameter was created.
    createdBy String
    The user who created the common parameter.
    description String
    The description of the common parameter.
    id String
    The ID of the Parameter. Its value is same as parameter_name.
    parameterId String
    The ID of the common parameter.
    parameterName String
    The name of the common parameter.
    parameterVersion Integer
    The version number of the common parameter.
    resourceGroupId String
    The ID of the Resource Group.
    shareType String
    The share type of the common parameter.
    tags Map<String,String>
    The tag of the resource.
    type String
    The data type of the common parameter.
    updatedBy String
    The user who updated the common parameter.
    updatedDate String
    The time when the common parameter was updated.
    value String
    The value of the common parameter.
    constraints string
    The constraints of the common parameter.
    createTime string
    The time when the common parameter was created.
    createdBy string
    The user who created the common parameter.
    description string
    The description of the common parameter.
    id string
    The ID of the Parameter. Its value is same as parameter_name.
    parameterId string
    The ID of the common parameter.
    parameterName string
    The name of the common parameter.
    parameterVersion number
    The version number of the common parameter.
    resourceGroupId string
    The ID of the Resource Group.
    shareType string
    The share type of the common parameter.
    tags {[key: string]: string}
    The tag of the resource.
    type string
    The data type of the common parameter.
    updatedBy string
    The user who updated the common parameter.
    updatedDate string
    The time when the common parameter was updated.
    value string
    The value of the common parameter.
    constraints str
    The constraints of the common parameter.
    create_time str
    The time when the common parameter was created.
    created_by str
    The user who created the common parameter.
    description str
    The description of the common parameter.
    id str
    The ID of the Parameter. Its value is same as parameter_name.
    parameter_id str
    The ID of the common parameter.
    parameter_name str
    The name of the common parameter.
    parameter_version int
    The version number of the common parameter.
    resource_group_id str
    The ID of the Resource Group.
    share_type str
    The share type of the common parameter.
    tags Mapping[str, str]
    The tag of the resource.
    type str
    The data type of the common parameter.
    updated_by str
    The user who updated the common parameter.
    updated_date str
    The time when the common parameter was updated.
    value str
    The value of the common parameter.
    constraints String
    The constraints of the common parameter.
    createTime String
    The time when the common parameter was created.
    createdBy String
    The user who created the common parameter.
    description String
    The description of the common parameter.
    id String
    The ID of the Parameter. Its value is same as parameter_name.
    parameterId String
    The ID of the common parameter.
    parameterName String
    The name of the common parameter.
    parameterVersion Number
    The version number of the common parameter.
    resourceGroupId String
    The ID of the Resource Group.
    shareType String
    The share type of the common parameter.
    tags Map<String>
    The tag of the resource.
    type String
    The data type of the common parameter.
    updatedBy String
    The user who updated the common parameter.
    updatedDate String
    The time when the common parameter was updated.
    value String
    The value of the common parameter.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi