1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. getResourceShares
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.resourcemanager.getResourceShares

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: alicloud:resourcemanager:getResourceShares
      arguments:
        resourceShareOwner: Self
        ids:
          - example_value
        nameRegex: the_resource_name
outputs:
  firstResourceManagerResourceShareId: ${example.shares[0].id}
Copy

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>
Copy
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]
Copy
func GetResourceShares(ctx *Context, args *GetResourceSharesArgs, opts ...InvokeOption) (*GetResourceSharesResult, error)
func GetResourceSharesOutput(ctx *Context, args *GetResourceSharesOutputArgs, opts ...InvokeOption) GetResourceSharesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetResourceSharesResult> getResourceShares(GetResourceSharesArgs args, InvokeOptions options)
public static Output<GetResourceSharesResult> getResourceShares(GetResourceSharesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:resourcemanager/getResourceShares:getResourceShares
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceShareOwner
This property is required.
Changes to this property will trigger replacement.
string
The owner of resource share, Valid values: Self and OtherAccounts.
Ids Changes to this property will trigger replacement. List<string>
A list of Resource Share IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Resource Share name.
OutputFile string
File name where to save data source results (after running pulumi preview).
ResourceShareName Changes to this property will trigger replacement. string
The name of resource share.
Status Changes to this property will trigger replacement. string
The status of resource share. Valid values: Active,Deleted and Deleting.
ResourceShareOwner
This property is required.
Changes to this property will trigger replacement.
string
The owner of resource share, Valid values: Self and OtherAccounts.
Ids Changes to this property will trigger replacement. []string
A list of Resource Share IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Resource Share name.
OutputFile string
File name where to save data source results (after running pulumi preview).
ResourceShareName Changes to this property will trigger replacement. string
The name of resource share.
Status Changes to this property will trigger replacement. string
The status of resource share. Valid values: Active,Deleted and Deleting.
resourceShareOwner
This property is required.
Changes to this property will trigger replacement.
String
The owner of resource share, Valid values: Self and OtherAccounts.
ids Changes to this property will trigger replacement. List<String>
A list of Resource Share IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Resource Share name.
outputFile String
File name where to save data source results (after running pulumi preview).
resourceShareName Changes to this property will trigger replacement. String
The name of resource share.
status Changes to this property will trigger replacement. String
The status of resource share. Valid values: Active,Deleted and Deleting.
resourceShareOwner
This property is required.
Changes to this property will trigger replacement.
string
The owner of resource share, Valid values: Self and OtherAccounts.
ids Changes to this property will trigger replacement. string[]
A list of Resource Share IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Resource Share name.
outputFile string
File name where to save data source results (after running pulumi preview).
resourceShareName Changes to this property will trigger replacement. string
The name of resource share.
status Changes to this property will trigger replacement. string
The status of resource share. Valid values: Active,Deleted and Deleting.
resource_share_owner
This property is required.
Changes to this property will trigger replacement.
str
The owner of resource share, Valid values: Self and OtherAccounts.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Resource Share IDs.
name_regex Changes to this property will trigger replacement. 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).
resource_share_name Changes to this property will trigger replacement. str
The name of resource share.
status Changes to this property will trigger replacement. str
The status of resource share. Valid values: Active,Deleted and Deleting.
resourceShareOwner
This property is required.
Changes to this property will trigger replacement.
String
The owner of resource share, Valid values: Self and OtherAccounts.
ids Changes to this property will trigger replacement. List<String>
A list of Resource Share IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Resource Share name.
outputFile String
File name where to save data source results (after running pulumi preview).
resourceShareName Changes to this property will trigger replacement. String
The name of resource share.
status Changes to this property will trigger replacement. String
The status of resource share. Valid values: Active,Deleted and Deleting.

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>
ResourceShareOwner string
Shares List<Pulumi.AliCloud.ResourceManager.Outputs.GetResourceSharesShare>
NameRegex string
OutputFile string
ResourceShareName string
Status string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
ResourceShareOwner string
Shares []GetResourceSharesShare
NameRegex string
OutputFile string
ResourceShareName string
Status string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
resourceShareOwner String
shares List<GetResourceSharesShare>
nameRegex String
outputFile String
resourceShareName String
status String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
resourceShareOwner string
shares GetResourceSharesShare[]
nameRegex string
outputFile string
resourceShareName string
status string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
resource_share_owner str
shares Sequence[GetResourceSharesShare]
name_regex str
output_file str
resource_share_name str
status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
resourceShareOwner String
shares List<Property Map>
nameRegex String
outputFile String
resourceShareName String
status String

Supporting Types

GetResourceSharesShare

Id This property is required. string
The ID of the Resource Share.
ResourceShareId This property is required. string
The ID of the resource share.
ResourceShareName This property is required. string
The name of resource share.
ResourceShareOwner This property is required. string
The owner of resource share.
Status This property is required. string
The status of resource share.
Id This property is required. string
The ID of the Resource Share.
ResourceShareId This property is required. string
The ID of the resource share.
ResourceShareName This property is required. string
The name of resource share.
ResourceShareOwner This property is required. string
The owner of resource share.
Status This property is required. string
The status of resource share.
id This property is required. String
The ID of the Resource Share.
resourceShareId This property is required. String
The ID of the resource share.
resourceShareName This property is required. String
The name of resource share.
resourceShareOwner This property is required. String
The owner of resource share.
status This property is required. String
The status of resource share.
id This property is required. string
The ID of the Resource Share.
resourceShareId This property is required. string
The ID of the resource share.
resourceShareName This property is required. string
The name of resource share.
resourceShareOwner This property is required. string
The owner of resource share.
status This property is required. string
The status of resource share.
id This property is required. str
The ID of the Resource Share.
resource_share_id This property is required. str
The ID of the resource share.
resource_share_name This property is required. str
The name of resource share.
resource_share_owner This property is required. str
The owner of resource share.
status This property is required. str
The status of resource share.
id This property is required. String
The ID of the Resource Share.
resourceShareId This property is required. String
The ID of the resource share.
resourceShareName This property is required. String
The name of resource share.
resourceShareOwner This property is required. String
The owner of resource share.
status This property is required. String
The status of resource share.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi