1. Packages
  2. AWS Classic
  3. API Docs
  4. ram
  5. getResourceShare

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ram.getResourceShare

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    aws.ram.ResourceShare Retrieve information about a RAM Resource Share.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ram.getResourceShare({
        name: "example",
        resourceOwner: "SELF",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ram.get_resource_share(name="example",
        resource_owner="SELF")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ram"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
    			Name:          pulumi.StringRef("example"),
    			ResourceOwner: "SELF",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ram.GetResourceShare.Invoke(new()
        {
            Name = "example",
            ResourceOwner = "SELF",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ram.RamFunctions;
    import com.pulumi.aws.ram.inputs.GetResourceShareArgs;
    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 = RamFunctions.getResourceShare(GetResourceShareArgs.builder()
                .name("example")
                .resourceOwner("SELF")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ram:getResourceShare
          Arguments:
            name: example
            resourceOwner: SELF
    

    Search by filters

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const tagFilter = aws.ram.getResourceShare({
        resourceOwner: "SELF",
        filters: [{
            name: "NameOfTag",
            values: ["exampleNameTagValue"],
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    tag_filter = aws.ram.get_resource_share(resource_owner="SELF",
        filters=[{
            "name": "NameOfTag",
            "values": ["exampleNameTagValue"],
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ram"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
    			ResourceOwner: "SELF",
    			Filters: []ram.GetResourceShareFilter{
    				{
    					Name: "NameOfTag",
    					Values: []string{
    						"exampleNameTagValue",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var tagFilter = Aws.Ram.GetResourceShare.Invoke(new()
        {
            ResourceOwner = "SELF",
            Filters = new[]
            {
                new Aws.Ram.Inputs.GetResourceShareFilterInputArgs
                {
                    Name = "NameOfTag",
                    Values = new[]
                    {
                        "exampleNameTagValue",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ram.RamFunctions;
    import com.pulumi.aws.ram.inputs.GetResourceShareArgs;
    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 tagFilter = RamFunctions.getResourceShare(GetResourceShareArgs.builder()
                .resourceOwner("SELF")
                .filters(GetResourceShareFilterArgs.builder()
                    .name("NameOfTag")
                    .values("exampleNameTagValue")
                    .build())
                .build());
    
        }
    }
    
    variables:
      tagFilter:
        fn::invoke:
          Function: aws:ram:getResourceShare
          Arguments:
            resourceOwner: SELF
            filters:
              - name: NameOfTag
                values:
                  - exampleNameTagValue
    

    Using getResourceShare

    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 getResourceShare(args: GetResourceShareArgs, opts?: InvokeOptions): Promise<GetResourceShareResult>
    function getResourceShareOutput(args: GetResourceShareOutputArgs, opts?: InvokeOptions): Output<GetResourceShareResult>
    def get_resource_share(filters: Optional[Sequence[GetResourceShareFilter]] = None,
                           name: Optional[str] = None,
                           resource_owner: Optional[str] = None,
                           resource_share_status: Optional[str] = None,
                           tags: Optional[Mapping[str, str]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetResourceShareResult
    def get_resource_share_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetResourceShareFilterArgs]]]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           resource_owner: Optional[pulumi.Input[str]] = None,
                           resource_share_status: Optional[pulumi.Input[str]] = None,
                           tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetResourceShareResult]
    func LookupResourceShare(ctx *Context, args *LookupResourceShareArgs, opts ...InvokeOption) (*LookupResourceShareResult, error)
    func LookupResourceShareOutput(ctx *Context, args *LookupResourceShareOutputArgs, opts ...InvokeOption) LookupResourceShareResultOutput

    > Note: This function is named LookupResourceShare in the Go SDK.

    public static class GetResourceShare 
    {
        public static Task<GetResourceShareResult> InvokeAsync(GetResourceShareArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceShareResult> Invoke(GetResourceShareInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceShareResult> getResourceShare(GetResourceShareArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ram/getResourceShare:getResourceShare
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ResourceOwner string
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    Filters List<GetResourceShareFilter>
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    Name string
    Name of the resource share to retrieve.
    ResourceShareStatus string
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    Tags Dictionary<string, string>
    Tags attached to the resource share.
    ResourceOwner string
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    Filters []GetResourceShareFilter
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    Name string
    Name of the resource share to retrieve.
    ResourceShareStatus string
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    Tags map[string]string
    Tags attached to the resource share.
    resourceOwner String
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    filters List<GetResourceShareFilter>
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    name String
    Name of the resource share to retrieve.
    resourceShareStatus String
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    tags Map<String,String>
    Tags attached to the resource share.
    resourceOwner string
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    filters GetResourceShareFilter[]
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    name string
    Name of the resource share to retrieve.
    resourceShareStatus string
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    tags {[key: string]: string}
    Tags attached to the resource share.
    resource_owner str
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    filters Sequence[GetResourceShareFilter]
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    name str
    Name of the resource share to retrieve.
    resource_share_status str
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    tags Mapping[str, str]
    Tags attached to the resource share.
    resourceOwner String
    Owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS.
    filters List<Property Map>
    Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    name String
    Name of the resource share to retrieve.
    resourceShareStatus String
    Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are PENDING, ACTIVE, FAILED, DELETING, and DELETED.
    tags Map<String>
    Tags attached to the resource share.

    getResourceShare Result

    The following output properties are available:

    Arn string
    ARN of the resource share.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    OwningAccountId string
    ID of the AWS account that owns the resource share.
    ResourceArns List<string>
    A list of resource ARNs associated with the resource share.
    ResourceOwner string
    Status string
    Status of the resource share.
    Tags Dictionary<string, string>
    Tags attached to the resource share.
    Filters List<GetResourceShareFilter>
    ResourceShareStatus string
    Arn string
    ARN of the resource share.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    OwningAccountId string
    ID of the AWS account that owns the resource share.
    ResourceArns []string
    A list of resource ARNs associated with the resource share.
    ResourceOwner string
    Status string
    Status of the resource share.
    Tags map[string]string
    Tags attached to the resource share.
    Filters []GetResourceShareFilter
    ResourceShareStatus string
    arn String
    ARN of the resource share.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    owningAccountId String
    ID of the AWS account that owns the resource share.
    resourceArns List<String>
    A list of resource ARNs associated with the resource share.
    resourceOwner String
    status String
    Status of the resource share.
    tags Map<String,String>
    Tags attached to the resource share.
    filters List<GetResourceShareFilter>
    resourceShareStatus String
    arn string
    ARN of the resource share.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    owningAccountId string
    ID of the AWS account that owns the resource share.
    resourceArns string[]
    A list of resource ARNs associated with the resource share.
    resourceOwner string
    status string
    Status of the resource share.
    tags {[key: string]: string}
    Tags attached to the resource share.
    filters GetResourceShareFilter[]
    resourceShareStatus string
    arn str
    ARN of the resource share.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    owning_account_id str
    ID of the AWS account that owns the resource share.
    resource_arns Sequence[str]
    A list of resource ARNs associated with the resource share.
    resource_owner str
    status str
    Status of the resource share.
    tags Mapping[str, str]
    Tags attached to the resource share.
    filters Sequence[GetResourceShareFilter]
    resource_share_status str
    arn String
    ARN of the resource share.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    owningAccountId String
    ID of the AWS account that owns the resource share.
    resourceArns List<String>
    A list of resource ARNs associated with the resource share.
    resourceOwner String
    status String
    Status of the resource share.
    tags Map<String>
    Tags attached to the resource share.
    filters List<Property Map>
    resourceShareStatus String

    Supporting Types

    GetResourceShareFilter

    Name string
    Name of the tag key to filter on.
    Values List<string>
    Value of the tag key.
    Name string
    Name of the tag key to filter on.
    Values []string
    Value of the tag key.
    name String
    Name of the tag key to filter on.
    values List<String>
    Value of the tag key.
    name string
    Name of the tag key to filter on.
    values string[]
    Value of the tag key.
    name str
    Name of the tag key to filter on.
    values Sequence[str]
    Value of the tag key.
    name String
    Name of the tag key to filter on.
    values List<String>
    Value of the tag key.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi