1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. getResourceShares
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.resourcemanager.getResourceShares

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 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);
    
    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.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}
    

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:resourcemanager/getResourceShares:getResourceShares
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ResourceShareOwner string
    The owner of resource share, Valid values: Self and OtherAccounts.
    Ids List<string>
    A list of Resource Share IDs.
    NameRegex 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 string
    The name of resource share.
    Status string
    The status of resource share. Valid values: Active,Deleted and Deleting.
    ResourceShareOwner string
    The owner of resource share, Valid values: Self and OtherAccounts.
    Ids []string
    A list of Resource Share IDs.
    NameRegex 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 string
    The name of resource share.
    Status string
    The status of resource share. Valid values: Active,Deleted and Deleting.
    resourceShareOwner String
    The owner of resource share, Valid values: Self and OtherAccounts.
    ids List<String>
    A list of Resource Share IDs.
    nameRegex 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 String
    The name of resource share.
    status String
    The status of resource share. Valid values: Active,Deleted and Deleting.
    resourceShareOwner string
    The owner of resource share, Valid values: Self and OtherAccounts.
    ids string[]
    A list of Resource Share IDs.
    nameRegex 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 string
    The name of resource share.
    status string
    The status of resource share. Valid values: Active,Deleted and Deleting.
    resource_share_owner str
    The owner of resource share, Valid values: Self and OtherAccounts.
    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).
    resource_share_name str
    The name of resource share.
    status str
    The status of resource share. Valid values: Active,Deleted and Deleting.
    resourceShareOwner String
    The owner of resource share, Valid values: Self and OtherAccounts.
    ids List<String>
    A list of Resource Share IDs.
    nameRegex 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 String
    The name of resource share.
    status 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 string
    The ID of the Resource Share.
    ResourceShareId string
    The ID of the resource share.
    ResourceShareName string
    The name of resource share.
    ResourceShareOwner string
    The owner of resource share.
    Status string
    The status of resource share.
    Id string
    The ID of the Resource Share.
    ResourceShareId string
    The ID of the resource share.
    ResourceShareName string
    The name of resource share.
    ResourceShareOwner string
    The owner of resource share.
    Status string
    The status of resource share.
    id String
    The ID of the Resource Share.
    resourceShareId String
    The ID of the resource share.
    resourceShareName String
    The name of resource share.
    resourceShareOwner String
    The owner of resource share.
    status String
    The status of resource share.
    id string
    The ID of the Resource Share.
    resourceShareId string
    The ID of the resource share.
    resourceShareName string
    The name of resource share.
    resourceShareOwner string
    The owner of resource share.
    status string
    The status of resource share.
    id str
    The ID of the Resource Share.
    resource_share_id str
    The ID of the resource share.
    resource_share_name str
    The name of resource share.
    resource_share_owner str
    The owner of resource share.
    status str
    The status of resource share.
    id String
    The ID of the Resource Share.
    resourceShareId String
    The ID of the resource share.
    resourceShareName String
    The name of resource share.
    resourceShareOwner String
    The owner of resource share.
    status 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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi