1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. servicecatalog
  5. getPortfolios
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.servicecatalog.getPortfolios

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides Service Catalog Portfolio available to the user.What is Portfolio

    NOTE: Available in 1.204.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.servicecatalog.getPortfolios({
        ids: [defaultAlicloudServiceCatalogPortfolio.id],
        nameRegex: defaultAlicloudServiceCatalogPortfolio.name,
    });
    export const alicloudServiceCatalogPortfolioExampleId = _default.then(_default => _default.portfolios?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.servicecatalog.get_portfolios(ids=[default_alicloud_service_catalog_portfolio["id"]],
        name_regex=default_alicloud_service_catalog_portfolio["name"])
    pulumi.export("alicloudServiceCatalogPortfolioExampleId", default.portfolios[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/servicecatalog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := servicecatalog.GetPortfolios(ctx, &servicecatalog.GetPortfoliosArgs{
    Ids: interface{}{
    defaultAlicloudServiceCatalogPortfolio.Id,
    },
    NameRegex: pulumi.StringRef(defaultAlicloudServiceCatalogPortfolio.Name),
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("alicloudServiceCatalogPortfolioExampleId", _default.Portfolios[0].Id)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.ServiceCatalog.GetPortfolios.Invoke(new()
        {
            Ids = new[]
            {
                defaultAlicloudServiceCatalogPortfolio.Id,
            },
            NameRegex = defaultAlicloudServiceCatalogPortfolio.Name,
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudServiceCatalogPortfolioExampleId"] = @default.Apply(@default => @default.Apply(getPortfoliosResult => getPortfoliosResult.Portfolios[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.servicecatalog.ServicecatalogFunctions;
    import com.pulumi.alicloud.servicecatalog.inputs.GetPortfoliosArgs;
    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 = ServicecatalogFunctions.getPortfolios(GetPortfoliosArgs.builder()
                .ids(defaultAlicloudServiceCatalogPortfolio.id())
                .nameRegex(defaultAlicloudServiceCatalogPortfolio.name())
                .build());
    
            ctx.export("alicloudServiceCatalogPortfolioExampleId", default_.portfolios()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:servicecatalog:getPortfolios
          Arguments:
            ids:
              - ${defaultAlicloudServiceCatalogPortfolio.id}
            nameRegex: ${defaultAlicloudServiceCatalogPortfolio.name}
    outputs:
      alicloudServiceCatalogPortfolioExampleId: ${default.portfolios[0].id}
    

    Using getPortfolios

    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 getPortfolios(args: GetPortfoliosArgs, opts?: InvokeOptions): Promise<GetPortfoliosResult>
    function getPortfoliosOutput(args: GetPortfoliosOutputArgs, opts?: InvokeOptions): Output<GetPortfoliosResult>
    def get_portfolios(ids: Optional[Sequence[str]] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       page_number: Optional[int] = None,
                       page_size: Optional[int] = None,
                       product_id: Optional[str] = None,
                       scope: Optional[str] = None,
                       sort_by: Optional[str] = None,
                       sort_order: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetPortfoliosResult
    def get_portfolios_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       page_number: Optional[pulumi.Input[int]] = None,
                       page_size: Optional[pulumi.Input[int]] = None,
                       product_id: Optional[pulumi.Input[str]] = None,
                       scope: Optional[pulumi.Input[str]] = None,
                       sort_by: Optional[pulumi.Input[str]] = None,
                       sort_order: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetPortfoliosResult]
    func GetPortfolios(ctx *Context, args *GetPortfoliosArgs, opts ...InvokeOption) (*GetPortfoliosResult, error)
    func GetPortfoliosOutput(ctx *Context, args *GetPortfoliosOutputArgs, opts ...InvokeOption) GetPortfoliosResultOutput

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

    public static class GetPortfolios 
    {
        public static Task<GetPortfoliosResult> InvokeAsync(GetPortfoliosArgs args, InvokeOptions? opts = null)
        public static Output<GetPortfoliosResult> Invoke(GetPortfoliosInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPortfoliosResult> getPortfolios(GetPortfoliosArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:servicecatalog/getPortfolios:getPortfolios
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Portfolio IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ProductId string
    The ID of the product.
    Scope string
    The query scope. Valid values: Local(default), Import, All.
    SortBy string
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    SortOrder string
    The order in which you want to sort the queried data. Valid values: Asc, Desc.
    Ids []string
    A list of Portfolio IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ProductId string
    The ID of the product.
    Scope string
    The query scope. Valid values: Local(default), Import, All.
    SortBy string
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    SortOrder string
    The order in which you want to sort the queried data. Valid values: Asc, Desc.
    ids List<String>
    A list of Portfolio IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    productId String
    The ID of the product.
    scope String
    The query scope. Valid values: Local(default), Import, All.
    sortBy String
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    sortOrder String
    The order in which you want to sort the queried data. Valid values: Asc, Desc.
    ids string[]
    A list of Portfolio IDs.
    nameRegex string
    A regex string to filter results by Group Metric Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    productId string
    The ID of the product.
    scope string
    The query scope. Valid values: Local(default), Import, All.
    sortBy string
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    sortOrder string
    The order in which you want to sort the queried data. Valid values: Asc, Desc.
    ids Sequence[str]
    A list of Portfolio IDs.
    name_regex str
    A regex string to filter results by Group Metric Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    product_id str
    The ID of the product.
    scope str
    The query scope. Valid values: Local(default), Import, All.
    sort_by str
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    sort_order str
    The order in which you want to sort the queried data. Valid values: Asc, Desc.
    ids List<String>
    A list of Portfolio IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    productId String
    The ID of the product.
    scope String
    The query scope. Valid values: Local(default), Import, All.
    sortBy String
    The field that is used to sort the queried data. The value is fixed as CreateTime, which specifies the creation time of product portfolios.
    sortOrder String
    The order in which you want to sort the queried data. Valid values: Asc, Desc.

    getPortfolios Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Portfolio IDs.
    Names List<string>
    A list of name of Portfolios.
    Portfolios List<Pulumi.AliCloud.ServiceCatalog.Outputs.GetPortfoliosPortfolio>
    A list of Portfolio Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    ProductId string
    Scope string
    SortBy string
    SortOrder string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Portfolio IDs.
    Names []string
    A list of name of Portfolios.
    Portfolios []GetPortfoliosPortfolio
    A list of Portfolio Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    ProductId string
    Scope string
    SortBy string
    SortOrder string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Portfolio IDs.
    names List<String>
    A list of name of Portfolios.
    portfolios List<GetPortfoliosPortfolio>
    A list of Portfolio Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    productId String
    scope String
    sortBy String
    sortOrder String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Portfolio IDs.
    names string[]
    A list of name of Portfolios.
    portfolios GetPortfoliosPortfolio[]
    A list of Portfolio Entries. Each element contains the following attributes:
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    productId string
    scope string
    sortBy string
    sortOrder string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Portfolio IDs.
    names Sequence[str]
    A list of name of Portfolios.
    portfolios Sequence[GetPortfoliosPortfolio]
    A list of Portfolio Entries. Each element contains the following attributes:
    name_regex str
    output_file str
    page_number int
    page_size int
    product_id str
    scope str
    sort_by str
    sort_order str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Portfolio IDs.
    names List<String>
    A list of name of Portfolios.
    portfolios List<Property Map>
    A list of Portfolio Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    productId String
    scope String
    sortBy String
    sortOrder String

    Supporting Types

    GetPortfoliosPortfolio

    CreateTime string
    The creation time of the portfolio
    Description string
    The description of the portfolio
    Id string
    The ID of the portfolio
    PortfolioArn string
    The ARN of the portfolio
    PortfolioId string
    The ID of the portfolio
    PortfolioName string
    The name of the portfolio
    ProviderName string
    The provider name of the portfolio
    CreateTime string
    The creation time of the portfolio
    Description string
    The description of the portfolio
    Id string
    The ID of the portfolio
    PortfolioArn string
    The ARN of the portfolio
    PortfolioId string
    The ID of the portfolio
    PortfolioName string
    The name of the portfolio
    ProviderName string
    The provider name of the portfolio
    createTime String
    The creation time of the portfolio
    description String
    The description of the portfolio
    id String
    The ID of the portfolio
    portfolioArn String
    The ARN of the portfolio
    portfolioId String
    The ID of the portfolio
    portfolioName String
    The name of the portfolio
    providerName String
    The provider name of the portfolio
    createTime string
    The creation time of the portfolio
    description string
    The description of the portfolio
    id string
    The ID of the portfolio
    portfolioArn string
    The ARN of the portfolio
    portfolioId string
    The ID of the portfolio
    portfolioName string
    The name of the portfolio
    providerName string
    The provider name of the portfolio
    create_time str
    The creation time of the portfolio
    description str
    The description of the portfolio
    id str
    The ID of the portfolio
    portfolio_arn str
    The ARN of the portfolio
    portfolio_id str
    The ID of the portfolio
    portfolio_name str
    The name of the portfolio
    provider_name str
    The provider name of the portfolio
    createTime String
    The creation time of the portfolio
    description String
    The description of the portfolio
    id String
    The ID of the portfolio
    portfolioArn String
    The ARN of the portfolio
    portfolioId String
    The ID of the portfolio
    portfolioName String
    The name of the portfolio
    providerName String
    The provider name of the portfolio

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi