get Resource Shares
This data source provides the Resource Manager Resource Shares of the current Alibaba Cloud user.
NOTE: Available in v1.111.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.resourcemanager.getResourceShares({
resourceShareOwner: "Self",
ids: ["example_value"],
nameRegex: "the_resource_name",
});
export const firstResourceManagerResourceShareId = example.then(example => example.shares?.[0]?.id);Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.resourcemanager.get_resource_shares(resource_share_owner="Self",
ids=["example_value"],
name_regex="the_resource_name")
pulumi.export("firstResourceManagerResourceShareId", example.shares[0].id)Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.ResourceManager.GetResourceShares.Invoke(new()
{
ResourceShareOwner = "Self",
Ids = new[]
{
"example_value",
},
NameRegex = "the_resource_name",
});
return new Dictionary<string, object?>
{
["firstResourceManagerResourceShareId"] = example.Apply(getResourceSharesResult => getResourceSharesResult.Shares[0]?.Id),
};
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := resourcemanager.GetResourceShares(ctx, &resourcemanager.GetResourceSharesArgs{
ResourceShareOwner: "Self",
Ids: []string{
"example_value",
},
NameRegex: pulumi.StringRef("the_resource_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstResourceManagerResourceShareId", example.Shares[0].Id)
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceSharesArgs;
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 example = ResourcemanagerFunctions.getResourceShares(GetResourceSharesArgs.builder()
.resourceShareOwner("Self")
.ids("example_value")
.nameRegex("the_resource_name")
.build());
ctx.export("firstResourceManagerResourceShareId", example.applyValue(getResourceSharesResult -> getResourceSharesResult.shares()[0].id()));
}
}Content copied to clipboard
variables:
example:
fn::invoke:
Function: alicloud:resourcemanager:getResourceShares
Arguments:
resourceShareOwner: Self
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstResourceManagerResourceShareId: ${example.shares[0].id}Content copied to clipboard
Return
A collection of values returned by getResourceShares.
Parameters
argument
A collection of arguments for invoking getResourceShares.
suspend fun getResourceShares(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, resourceShareName: String? = null, resourceShareOwner: String, status: String? = null): GetResourceSharesResult
Return
A collection of values returned by getResourceShares.
See also
Parameters
ids
A list of Resource Share IDs.
name Regex
A regex string to filter results by Resource Share name.
output File
File name where to save data source results (after running pulumi preview).
resource Share Name
The name of resource share.
resource Share Owner
The owner of resource share.
status
The status of resource share.
suspend fun getResourceShares(argument: suspend GetResourceSharesPlainArgsBuilder.() -> Unit): GetResourceSharesResult
Return
A collection of values returned by getResourceShares.
See also
Parameters
argument
Builder for com.pulumi.alicloud.resourcemanager.kotlin.inputs.GetResourceSharesPlainArgs.