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

alicloud.marketplace.getProduct

Explore with Pulumi AI

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

    This data source provides the Market product item details of Alibaba Cloud.

    NOTE: Available in 1.69.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.marketplace.getProduct({
        productCode: "cmapi022206",
    });
    export const productName = _default.then(_default => _default.products?.[0]?.name);
    export const firstProductSkuCode = _default.then(_default => _default.products?.[0]?.skuses?.[0]?.skuCode);
    export const firstProductPackageVersion = _default.then(_default => _default.products?.[0]?.skuses?.[0]?.packageVersions?.[0]?.packageVersion);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.marketplace.get_product(product_code="cmapi022206")
    pulumi.export("productName", default.products[0].name)
    pulumi.export("firstProductSkuCode", default.products[0].skuses[0].sku_code)
    pulumi.export("firstProductPackageVersion", default.products[0].skuses[0].package_versions[0].package_version)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/marketplace"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := marketplace.GetProduct(ctx, &marketplace.GetProductArgs{
    			ProductCode: "cmapi022206",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("productName", _default.Products[0].Name)
    		ctx.Export("firstProductSkuCode", _default.Products[0].Skuses[0].SkuCode)
    		ctx.Export("firstProductPackageVersion", _default.Products[0].Skuses[0].PackageVersions[0].PackageVersion)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.MarketPlace.GetProduct.Invoke(new()
        {
            ProductCode = "cmapi022206",
        });
    
        return new Dictionary<string, object?>
        {
            ["productName"] = @default.Apply(@default => @default.Apply(getProductResult => getProductResult.Products[0]?.Name)),
            ["firstProductSkuCode"] = @default.Apply(@default => @default.Apply(getProductResult => getProductResult.Products[0]?.Skuses[0]?.SkuCode)),
            ["firstProductPackageVersion"] = @default.Apply(@default => @default.Apply(getProductResult => getProductResult.Products[0]?.Skuses[0]?.PackageVersions[0]?.PackageVersion)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.marketplace.MarketplaceFunctions;
    import com.pulumi.alicloud.marketplace.inputs.GetProductArgs;
    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 = MarketplaceFunctions.getProduct(GetProductArgs.builder()
                .productCode("cmapi022206")
                .build());
    
            ctx.export("productName", default_.products()[0].name());
            ctx.export("firstProductSkuCode", default_.products()[0].skuses()[0].skuCode());
            ctx.export("firstProductPackageVersion", default_.products()[0].skuses()[0].packageVersions()[0].packageVersion());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:marketplace:getProduct
          Arguments:
            productCode: cmapi022206
    outputs:
      productName: ${default.products[0].name}
      firstProductSkuCode: ${default.products[0].skuses[0].skuCode}
      firstProductPackageVersion: ${default.products[0].skuses[0].packageVersions[0].packageVersion}
    

    Using getProduct

    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 getProduct(args: GetProductArgs, opts?: InvokeOptions): Promise<GetProductResult>
    function getProductOutput(args: GetProductOutputArgs, opts?: InvokeOptions): Output<GetProductResult>
    def get_product(available_region: Optional[str] = None,
                    product_code: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetProductResult
    def get_product_output(available_region: Optional[pulumi.Input[str]] = None,
                    product_code: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetProductResult]
    func GetProduct(ctx *Context, args *GetProductArgs, opts ...InvokeOption) (*GetProductResult, error)
    func GetProductOutput(ctx *Context, args *GetProductOutputArgs, opts ...InvokeOption) GetProductResultOutput

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

    public static class GetProduct 
    {
        public static Task<GetProductResult> InvokeAsync(GetProductArgs args, InvokeOptions? opts = null)
        public static Output<GetProductResult> Invoke(GetProductInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProductResult> getProduct(GetProductArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:marketplace/getProduct:getProduct
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProductCode string
    The product code of the market product.
    AvailableRegion string
    A available region id used to filter market place Ecs images.
    ProductCode string
    The product code of the market product.
    AvailableRegion string
    A available region id used to filter market place Ecs images.
    productCode String
    The product code of the market product.
    availableRegion String
    A available region id used to filter market place Ecs images.
    productCode string
    The product code of the market product.
    availableRegion string
    A available region id used to filter market place Ecs images.
    product_code str
    The product code of the market product.
    available_region str
    A available region id used to filter market place Ecs images.
    productCode String
    The product code of the market product.
    availableRegion String
    A available region id used to filter market place Ecs images.

    getProduct Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ProductCode string
    Products List<Pulumi.AliCloud.MarketPlace.Outputs.GetProductProduct>
    A product. It contains the following attributes:
    AvailableRegion string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProductCode string
    Products []GetProductProduct
    A product. It contains the following attributes:
    AvailableRegion string
    id String
    The provider-assigned unique ID for this managed resource.
    productCode String
    products List<GetProductProduct>
    A product. It contains the following attributes:
    availableRegion String
    id string
    The provider-assigned unique ID for this managed resource.
    productCode string
    products GetProductProduct[]
    A product. It contains the following attributes:
    availableRegion string
    id str
    The provider-assigned unique ID for this managed resource.
    product_code str
    products Sequence[GetProductProduct]
    A product. It contains the following attributes:
    available_region str
    id String
    The provider-assigned unique ID for this managed resource.
    productCode String
    products List<Property Map>
    A product. It contains the following attributes:
    availableRegion String

    Supporting Types

    GetProductProduct

    Code string
    The code of the product.
    Description string
    The description of the product.
    Name string
    The name of the product.
    Skuses List<Pulumi.AliCloud.MarketPlace.Inputs.GetProductProductSkus>
    A list of one element containing sku attributes of an object. Each element contains the following attributes:
    Code string
    The code of the product.
    Description string
    The description of the product.
    Name string
    The name of the product.
    Skuses []GetProductProductSkus
    A list of one element containing sku attributes of an object. Each element contains the following attributes:
    code String
    The code of the product.
    description String
    The description of the product.
    name String
    The name of the product.
    skuses List<GetProductProductSkus>
    A list of one element containing sku attributes of an object. Each element contains the following attributes:
    code string
    The code of the product.
    description string
    The description of the product.
    name string
    The name of the product.
    skuses GetProductProductSkus[]
    A list of one element containing sku attributes of an object. Each element contains the following attributes:
    code str
    The code of the product.
    description str
    The description of the product.
    name str
    The name of the product.
    skuses Sequence[GetProductProductSkus]
    A list of one element containing sku attributes of an object. Each element contains the following attributes:
    code String
    The code of the product.
    description String
    The description of the product.
    name String
    The name of the product.
    skuses List<Property Map>
    A list of one element containing sku attributes of an object. Each element contains the following attributes:

    GetProductProductSkus

    Images List<Pulumi.AliCloud.MarketPlace.Inputs.GetProductProductSkusImage>
    The list of custom ECS images, Each element contains the following attributes:
    PackageVersions List<Pulumi.AliCloud.MarketPlace.Inputs.GetProductProductSkusPackageVersion>
    The list of package version details of this product sku, Each element contains the following attributes:
    SkuCode string
    The sku code of this product sku.
    SkuName string
    The sku name of this product sku.
    Images []GetProductProductSkusImage
    The list of custom ECS images, Each element contains the following attributes:
    PackageVersions []GetProductProductSkusPackageVersion
    The list of package version details of this product sku, Each element contains the following attributes:
    SkuCode string
    The sku code of this product sku.
    SkuName string
    The sku name of this product sku.
    images List<GetProductProductSkusImage>
    The list of custom ECS images, Each element contains the following attributes:
    packageVersions List<GetProductProductSkusPackageVersion>
    The list of package version details of this product sku, Each element contains the following attributes:
    skuCode String
    The sku code of this product sku.
    skuName String
    The sku name of this product sku.
    images GetProductProductSkusImage[]
    The list of custom ECS images, Each element contains the following attributes:
    packageVersions GetProductProductSkusPackageVersion[]
    The list of package version details of this product sku, Each element contains the following attributes:
    skuCode string
    The sku code of this product sku.
    skuName string
    The sku name of this product sku.
    images Sequence[GetProductProductSkusImage]
    The list of custom ECS images, Each element contains the following attributes:
    package_versions Sequence[GetProductProductSkusPackageVersion]
    The list of package version details of this product sku, Each element contains the following attributes:
    sku_code str
    The sku code of this product sku.
    sku_name str
    The sku name of this product sku.
    images List<Property Map>
    The list of custom ECS images, Each element contains the following attributes:
    packageVersions List<Property Map>
    The list of package version details of this product sku, Each element contains the following attributes:
    skuCode String
    The sku code of this product sku.
    skuName String
    The sku name of this product sku.

    GetProductProductSkusImage

    ImageId string
    The Ecs image id.
    ImageName string
    The Ecs image display name.
    RegionId string
    The Ecs image region.
    ImageId string
    The Ecs image id.
    ImageName string
    The Ecs image display name.
    RegionId string
    The Ecs image region.
    imageId String
    The Ecs image id.
    imageName String
    The Ecs image display name.
    regionId String
    The Ecs image region.
    imageId string
    The Ecs image id.
    imageName string
    The Ecs image display name.
    regionId string
    The Ecs image region.
    image_id str
    The Ecs image id.
    image_name str
    The Ecs image display name.
    region_id str
    The Ecs image region.
    imageId String
    The Ecs image id.
    imageName String
    The Ecs image display name.
    regionId String
    The Ecs image region.

    GetProductProductSkusPackageVersion

    PackageName string
    The package name of this product sku package.
    PackageVersion string
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.
    PackageName string
    The package name of this product sku package.
    PackageVersion string
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.
    packageName String
    The package name of this product sku package.
    packageVersion String
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.
    packageName string
    The package name of this product sku package.
    packageVersion string
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.
    package_name str
    The package name of this product sku package.
    package_version str
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.
    packageName String
    The package name of this product sku package.
    packageVersion String
    The package version of this product sku package. Currently, the API products can return package_version, but others can not for ensure.

    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