Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.mhub.getApps
Explore with Pulumi AI
This data source provides the Mhub Apps of the current Alibaba Cloud user.
NOTE: Available in v1.138.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "example_value";
const _default = new alicloud.mhub.App("default", {
appName: name,
productId: defaultAlicloudMhubProduct.id,
packageName: "com.test.android",
type: "2",
});
const ids = alicloud.mhub.getApps({});
export const mhubAppId1 = ids.then(ids => ids.apps?.[0]?.id);
const nameRegex = alicloud.mhub.getApps({
nameRegex: "^my-App",
});
export const mhubAppId2 = nameRegex.then(nameRegex => nameRegex.apps?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "example_value"
default = alicloud.mhub.App("default",
app_name=name,
product_id=default_alicloud_mhub_product["id"],
package_name="com.test.android",
type="2")
ids = alicloud.mhub.get_apps()
pulumi.export("mhubAppId1", ids.apps[0].id)
name_regex = alicloud.mhub.get_apps(name_regex="^my-App")
pulumi.export("mhubAppId2", name_regex.apps[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mhub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "example_value"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := mhub.NewApp(ctx, "default", &mhub.AppArgs{
AppName: pulumi.String(name),
ProductId: pulumi.Any(defaultAlicloudMhubProduct.Id),
PackageName: pulumi.String("com.test.android"),
Type: pulumi.String("2"),
})
if err != nil {
return err
}
ids, err := mhub.GetApps(ctx, &mhub.GetAppsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("mhubAppId1", ids.Apps[0].Id)
nameRegex, err := mhub.GetApps(ctx, &mhub.GetAppsArgs{
NameRegex: pulumi.StringRef("^my-App"),
}, nil)
if err != nil {
return err
}
ctx.Export("mhubAppId2", nameRegex.Apps[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "example_value";
var @default = new AliCloud.Mhub.App("default", new()
{
AppName = name,
ProductId = defaultAlicloudMhubProduct.Id,
PackageName = "com.test.android",
Type = "2",
});
var ids = AliCloud.Mhub.GetApps.Invoke();
var nameRegex = AliCloud.Mhub.GetApps.Invoke(new()
{
NameRegex = "^my-App",
});
return new Dictionary<string, object?>
{
["mhubAppId1"] = ids.Apply(getAppsResult => getAppsResult.Apps[0]?.Id),
["mhubAppId2"] = nameRegex.Apply(getAppsResult => getAppsResult.Apps[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mhub.App;
import com.pulumi.alicloud.mhub.AppArgs;
import com.pulumi.alicloud.mhub.MhubFunctions;
import com.pulumi.alicloud.mhub.inputs.GetAppsArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("example_value");
var default_ = new App("default", AppArgs.builder()
.appName(name)
.productId(defaultAlicloudMhubProduct.id())
.packageName("com.test.android")
.type("2")
.build());
final var ids = MhubFunctions.getApps();
ctx.export("mhubAppId1", ids.applyValue(getAppsResult -> getAppsResult.apps()[0].id()));
final var nameRegex = MhubFunctions.getApps(GetAppsArgs.builder()
.nameRegex("^my-App")
.build());
ctx.export("mhubAppId2", nameRegex.applyValue(getAppsResult -> getAppsResult.apps()[0].id()));
}
}
configuration:
name:
type: string
default: example_value
resources:
default:
type: alicloud:mhub:App
properties:
appName: ${name}
productId: ${defaultAlicloudMhubProduct.id}
packageName: com.test.android
type: '2'
variables:
ids:
fn::invoke:
Function: alicloud:mhub:getApps
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:mhub:getApps
Arguments:
nameRegex: ^my-App
outputs:
mhubAppId1: ${ids.apps[0].id}
mhubAppId2: ${nameRegex.apps[0].id}
Using getApps
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 getApps(args: GetAppsArgs, opts?: InvokeOptions): Promise<GetAppsResult>
function getAppsOutput(args: GetAppsOutputArgs, opts?: InvokeOptions): Output<GetAppsResult>
def get_apps(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
os_type: Optional[str] = None,
output_file: Optional[str] = None,
product_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAppsResult
def get_apps_output(enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
os_type: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
product_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAppsResult]
func GetApps(ctx *Context, args *GetAppsArgs, opts ...InvokeOption) (*GetAppsResult, error)
func GetAppsOutput(ctx *Context, args *GetAppsOutputArgs, opts ...InvokeOption) GetAppsResultOutput
> Note: This function is named GetApps
in the Go SDK.
public static class GetApps
{
public static Task<GetAppsResult> InvokeAsync(GetAppsArgs args, InvokeOptions? opts = null)
public static Output<GetAppsResult> Invoke(GetAppsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAppsResult> getApps(GetAppsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:mhub/getApps:getApps
arguments:
# arguments dictionary
The following arguments are supported:
- Product
Id string - The ID of the Product.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of App IDs. The value formats as
<product_id>:<app_key>
- Name
Regex string - A regex string to filter results by App name.
- Os
Type string - The os type. Valid values:
Android
andiOS
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- Product
Id string - The ID of the Product.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids []string
- A list of App IDs. The value formats as
<product_id>:<app_key>
- Name
Regex string - A regex string to filter results by App name.
- Os
Type string - The os type. Valid values:
Android
andiOS
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- product
Id String - The ID of the Product.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of App IDs. The value formats as
<product_id>:<app_key>
- name
Regex String - A regex string to filter results by App name.
- os
Type String - The os type. Valid values:
Android
andiOS
. - output
File String - File name where to save data source results (after running
pulumi preview
).
- product
Id string - The ID of the Product.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of App IDs. The value formats as
<product_id>:<app_key>
- name
Regex string - A regex string to filter results by App name.
- os
Type string - The os type. Valid values:
Android
andiOS
. - output
File string - File name where to save data source results (after running
pulumi preview
).
- product_
id str - The ID of the Product.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - ids Sequence[str]
- A list of App IDs. The value formats as
<product_id>:<app_key>
- name_
regex str - A regex string to filter results by App name.
- os_
type str - The os type. Valid values:
Android
andiOS
. - output_
file str - File name where to save data source results (after running
pulumi preview
).
- product
Id String - The ID of the Product.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of App IDs. The value formats as
<product_id>:<app_key>
- name
Regex String - A regex string to filter results by App name.
- os
Type String - The os type. Valid values:
Android
andiOS
. - output
File String - File name where to save data source results (after running
pulumi preview
).
getApps Result
The following output properties are available:
- Apps
List<Pulumi.
Ali Cloud. Mhub. Outputs. Get Apps App> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Product
Id string - Enable
Details bool - Name
Regex string - Os
Type string - Output
File string
- Apps
[]Get
Apps App - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Product
Id string - Enable
Details bool - Name
Regex string - Os
Type string - Output
File string
- apps
List<Get
Apps App> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- product
Id String - enable
Details Boolean - name
Regex String - os
Type String - output
File String
- apps
Get
Apps App[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- product
Id string - enable
Details boolean - name
Regex string - os
Type string - output
File string
- apps
Sequence[Get
Apps App] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- product_
id str - enable_
details bool - name_
regex str - os_
type str - output_
file str
- apps List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- product
Id String - enable
Details Boolean - name
Regex String - os
Type String - output
File String
Supporting Types
GetAppsApp
- App
Key string - Application AppKey, which uniquely identifies an application when requested by the interface
- App
Name string - The Name of the App.
- Bundle
Id string - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - Create
Time string - The CreateTime of the App.
- Encoded
Icon string - Base64 string of picture.
- Id string
- The ID of the App.
- Industry
Id string - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- Package
Name string - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - Product
Id string - The ID of the Product.
- Type string
- The type of the App. Valid values:
Android
andiOS
.
- App
Key string - Application AppKey, which uniquely identifies an application when requested by the interface
- App
Name string - The Name of the App.
- Bundle
Id string - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - Create
Time string - The CreateTime of the App.
- Encoded
Icon string - Base64 string of picture.
- Id string
- The ID of the App.
- Industry
Id string - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- Package
Name string - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - Product
Id string - The ID of the Product.
- Type string
- The type of the App. Valid values:
Android
andiOS
.
- app
Key String - Application AppKey, which uniquely identifies an application when requested by the interface
- app
Name String - The Name of the App.
- bundle
Id String - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - create
Time String - The CreateTime of the App.
- encoded
Icon String - Base64 string of picture.
- id String
- The ID of the App.
- industry
Id String - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- package
Name String - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - product
Id String - The ID of the Product.
- type String
- The type of the App. Valid values:
Android
andiOS
.
- app
Key string - Application AppKey, which uniquely identifies an application when requested by the interface
- app
Name string - The Name of the App.
- bundle
Id string - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - create
Time string - The CreateTime of the App.
- encoded
Icon string - Base64 string of picture.
- id string
- The ID of the App.
- industry
Id string - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- package
Name string - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - product
Id string - The ID of the Product.
- type string
- The type of the App. Valid values:
Android
andiOS
.
- app_
key str - Application AppKey, which uniquely identifies an application when requested by the interface
- app_
name str - The Name of the App.
- bundle_
id str - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - create_
time str - The CreateTime of the App.
- encoded_
icon str - Base64 string of picture.
- id str
- The ID of the App.
- industry_
id str - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- package_
name str - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - product_
id str - The ID of the Product.
- type str
- The type of the App. Valid values:
Android
andiOS
.
- app
Key String - Application AppKey, which uniquely identifies an application when requested by the interface
- app
Name String - The Name of the App.
- bundle
Id String - iOS application ID. Required when creating an iOS app. NOTE: Either
bundle_id
orpackage_name
must be set. - create
Time String - The CreateTime of the App.
- encoded
Icon String - Base64 string of picture.
- id String
- The ID of the App.
- industry
Id String - The Industry ID of the app. For information about Industry and how to use it, MHUBIndustry.
- package
Name String - Android App package name. NOTE: Either
bundle_id
orpackage_name
must be set. - product
Id String - The ID of the Product.
- type String
- The type of the App. Valid values:
Android
andiOS
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.