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);
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)
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),
};
});
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
})
}
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()));
}
}
variables:
example:
fn::invoke:
function: alicloud:resourcemanager:getResourceShares
arguments:
resourceShareOwner: Self
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstResourceManagerResourceShareId: ${example.shares[0].id}
Return
A collection of values returned by getResourceShares.
Parameters
A collection of arguments for invoking getResourceShares.
Return
A collection of values returned by getResourceShares.
Parameters
A list of Resource Share IDs.
A regex string to filter results by Resource Share name.
File name where to save data source results (after running pulumi preview
).
The name of resource share.
The owner of resource share, Valid values: Self
and OtherAccounts
.
The status of resource share. Valid values: Active
,Deleted
and Deleting
.
See also
Return
A collection of values returned by getResourceShares.
Parameters
Builder for com.pulumi.alicloud.resourcemanager.kotlin.inputs.GetResourceSharesPlainArgs.