Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi
alicloud.resourcemanager.getResourceShares
Start a Neo task
Explain and create an alicloud.resourcemanager.getResourceShares resource
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)
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
})
}
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 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.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}
Using getResourceShares
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 getResourceShares(args: GetResourceSharesArgs, opts?: InvokeOptions): Promise<GetResourceSharesResult>
function getResourceSharesOutput(args: GetResourceSharesOutputArgs, opts?: InvokeOptions): Output<GetResourceSharesResult>def get_resource_shares(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
resource_share_name: Optional[str] = None,
resource_share_owner: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetResourceSharesResult
def get_resource_shares_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
resource_share_name: Optional[pulumi.Input[str]] = None,
resource_share_owner: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetResourceSharesResult]func GetResourceShares(ctx *Context, args *GetResourceSharesArgs, opts ...InvokeOption) (*GetResourceSharesResult, error)
func GetResourceSharesOutput(ctx *Context, args *GetResourceSharesOutputArgs, opts ...InvokeOption) GetResourceSharesResultOutput> Note: This function is named GetResourceShares in the Go SDK.
public static class GetResourceShares
{
public static Task<GetResourceSharesResult> InvokeAsync(GetResourceSharesArgs args, InvokeOptions? opts = null)
public static Output<GetResourceSharesResult> Invoke(GetResourceSharesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetResourceSharesResult> getResourceShares(GetResourceSharesArgs args, InvokeOptions options)
public static Output<GetResourceSharesResult> getResourceShares(GetResourceSharesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:resourcemanager/getResourceShares:getResourceShares
arguments:
# arguments dictionaryThe following arguments are supported:
- string
- The owner of resource share, Valid values:
SelfandOtherAccounts. - Ids List<string>
- A list of Resource Share IDs.
- Name
Regex string - A regex string to filter results by Resource Share name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - string
- The name of resource share.
- Status string
- The status of resource share. Valid values:
Active,DeletedandDeleting.
- string
- The owner of resource share, Valid values:
SelfandOtherAccounts. - Ids []string
- A list of Resource Share IDs.
- Name
Regex string - A regex string to filter results by Resource Share name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - string
- The name of resource share.
- Status string
- The status of resource share. Valid values:
Active,DeletedandDeleting.
- String
- The owner of resource share, Valid values:
SelfandOtherAccounts. - ids List<String>
- A list of Resource Share IDs.
- name
Regex String - A regex string to filter results by Resource Share name.
- output
File String - File name where to save data source results (after running
pulumi preview). - String
- The name of resource share.
- status String
- The status of resource share. Valid values:
Active,DeletedandDeleting.
- string
- The owner of resource share, Valid values:
SelfandOtherAccounts. - ids string[]
- A list of Resource Share IDs.
- name
Regex string - A regex string to filter results by Resource Share name.
- output
File string - File name where to save data source results (after running
pulumi preview). - string
- The name of resource share.
- status string
- The status of resource share. Valid values:
Active,DeletedandDeleting.
- str
- The owner of resource share, Valid values:
SelfandOtherAccounts. - ids Sequence[str]
- A list of Resource Share IDs.
- name_
regex str - A regex string to filter results by Resource Share name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - str
- The name of resource share.
- status str
- The status of resource share. Valid values:
Active,DeletedandDeleting.
- String
- The owner of resource share, Valid values:
SelfandOtherAccounts. - ids List<String>
- A list of Resource Share IDs.
- name
Regex String - A regex string to filter results by Resource Share name.
- output
File String - File name where to save data source results (after running
pulumi preview). - String
- The name of resource share.
- status String
- The status of resource share. Valid values:
Active,DeletedandDeleting.
getResourceShares Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- string
-
List<Pulumi.
Ali Cloud. Resource Manager. Outputs. Get Resource Shares Share> - Name
Regex string - Output
File string - string
- Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- string
-
[]Get
Resource Shares Share - Name
Regex string - Output
File string - string
- Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- String
-
List<Get
Resource Shares Share> - name
Regex String - output
File String - String
- status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- string
-
Get
Resource Shares Share[] - name
Regex string - output
File string - string
- status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- str
-
Sequence[Get
Resource Shares Share] - name_
regex str - output_
file str - str
- status str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- String
- List<Property Map>
- name
Regex String - output
File String - String
- status String
Supporting Types
GetResourceSharesShare
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
