1. Packages
  2. AWS
  3. API Docs
  4. ram
  5. ResourceShare
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.ram.ResourceShare

Explore with Pulumi AI

Manages a Resource Access Manager (RAM) Resource Share. To associate principals with the share, see the aws.ram.PrincipalAssociation resource. To associate resources with the share, see the aws.ram.ResourceAssociation resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ram.ResourceShare("example", {
    name: "example",
    allowExternalPrincipals: true,
    tags: {
        Environment: "Production",
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ram.ResourceShare("example",
    name="example",
    allow_external_principals=True,
    tags={
        "Environment": "Production",
    })
Copy
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.NewResourceShare(ctx, "example", &ram.ResourceShareArgs{
			Name:                    pulumi.String("example"),
			AllowExternalPrincipals: pulumi.Bool(true),
			Tags: pulumi.StringMap{
				"Environment": pulumi.String("Production"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Ram.ResourceShare("example", new()
    {
        Name = "example",
        AllowExternalPrincipals = true,
        Tags = 
        {
            { "Environment", "Production" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ram.ResourceShare;
import com.pulumi.aws.ram.ResourceShareArgs;
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) {
        var example = new ResourceShare("example", ResourceShareArgs.builder()
            .name("example")
            .allowExternalPrincipals(true)
            .tags(Map.of("Environment", "Production"))
            .build());

    }
}
Copy
resources:
  example:
    type: aws:ram:ResourceShare
    properties:
      name: example
      allowExternalPrincipals: true
      tags:
        Environment: Production
Copy

Create ResourceShare Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ResourceShare(name: string, args?: ResourceShareArgs, opts?: CustomResourceOptions);
@overload
def ResourceShare(resource_name: str,
                  args: Optional[ResourceShareArgs] = None,
                  opts: Optional[ResourceOptions] = None)

@overload
def ResourceShare(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  allow_external_principals: Optional[bool] = None,
                  name: Optional[str] = None,
                  permission_arns: Optional[Sequence[str]] = None,
                  tags: Optional[Mapping[str, str]] = None)
func NewResourceShare(ctx *Context, name string, args *ResourceShareArgs, opts ...ResourceOption) (*ResourceShare, error)
public ResourceShare(string name, ResourceShareArgs? args = null, CustomResourceOptions? opts = null)
public ResourceShare(String name, ResourceShareArgs args)
public ResourceShare(String name, ResourceShareArgs args, CustomResourceOptions options)
type: aws:ram:ResourceShare
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ResourceShareArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ResourceShareArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ResourceShareArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ResourceShareArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ResourceShareArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var resourceShareResource = new Aws.Ram.ResourceShare("resourceShareResource", new()
{
    AllowExternalPrincipals = false,
    Name = "string",
    PermissionArns = new[]
    {
        "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := ram.NewResourceShare(ctx, "resourceShareResource", &ram.ResourceShareArgs{
	AllowExternalPrincipals: pulumi.Bool(false),
	Name:                    pulumi.String("string"),
	PermissionArns: pulumi.StringArray{
		pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var resourceShareResource = new ResourceShare("resourceShareResource", ResourceShareArgs.builder()
    .allowExternalPrincipals(false)
    .name("string")
    .permissionArns("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
resource_share_resource = aws.ram.ResourceShare("resourceShareResource",
    allow_external_principals=False,
    name="string",
    permission_arns=["string"],
    tags={
        "string": "string",
    })
Copy
const resourceShareResource = new aws.ram.ResourceShare("resourceShareResource", {
    allowExternalPrincipals: false,
    name: "string",
    permissionArns: ["string"],
    tags: {
        string: "string",
    },
});
Copy
type: aws:ram:ResourceShare
properties:
    allowExternalPrincipals: false
    name: string
    permissionArns:
        - string
    tags:
        string: string
Copy

ResourceShare Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ResourceShare resource accepts the following input properties:

AllowExternalPrincipals bool
Indicates whether principals outside your organization can be associated with a resource share.
Name string
The name of the resource share.
PermissionArns Changes to this property will trigger replacement. List<string>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
Tags Dictionary<string, string>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
AllowExternalPrincipals bool
Indicates whether principals outside your organization can be associated with a resource share.
Name string
The name of the resource share.
PermissionArns Changes to this property will trigger replacement. []string
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
Tags map[string]string
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
allowExternalPrincipals Boolean
Indicates whether principals outside your organization can be associated with a resource share.
name String
The name of the resource share.
permissionArns Changes to this property will trigger replacement. List<String>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Map<String,String>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
allowExternalPrincipals boolean
Indicates whether principals outside your organization can be associated with a resource share.
name string
The name of the resource share.
permissionArns Changes to this property will trigger replacement. string[]
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags {[key: string]: string}
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
allow_external_principals bool
Indicates whether principals outside your organization can be associated with a resource share.
name str
The name of the resource share.
permission_arns Changes to this property will trigger replacement. Sequence[str]
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Mapping[str, str]
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
allowExternalPrincipals Boolean
Indicates whether principals outside your organization can be associated with a resource share.
name String
The name of the resource share.
permissionArns Changes to this property will trigger replacement. List<String>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Map<String>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the ResourceShare resource produces the following output properties:

Arn string
The Amazon Resource Name (ARN) of the resource share.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
The Amazon Resource Name (ARN) of the resource share.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The Amazon Resource Name (ARN) of the resource share.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
The Amazon Resource Name (ARN) of the resource share.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
The Amazon Resource Name (ARN) of the resource share.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The Amazon Resource Name (ARN) of the resource share.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing ResourceShare Resource

Get an existing ResourceShare resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ResourceShareState, opts?: CustomResourceOptions): ResourceShare
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow_external_principals: Optional[bool] = None,
        arn: Optional[str] = None,
        name: Optional[str] = None,
        permission_arns: Optional[Sequence[str]] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> ResourceShare
func GetResourceShare(ctx *Context, name string, id IDInput, state *ResourceShareState, opts ...ResourceOption) (*ResourceShare, error)
public static ResourceShare Get(string name, Input<string> id, ResourceShareState? state, CustomResourceOptions? opts = null)
public static ResourceShare get(String name, Output<String> id, ResourceShareState state, CustomResourceOptions options)
resources:  _:    type: aws:ram:ResourceShare    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AllowExternalPrincipals bool
Indicates whether principals outside your organization can be associated with a resource share.
Arn string
The Amazon Resource Name (ARN) of the resource share.
Name string
The name of the resource share.
PermissionArns Changes to this property will trigger replacement. List<string>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
Tags Dictionary<string, string>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

AllowExternalPrincipals bool
Indicates whether principals outside your organization can be associated with a resource share.
Arn string
The Amazon Resource Name (ARN) of the resource share.
Name string
The name of the resource share.
PermissionArns Changes to this property will trigger replacement. []string
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
Tags map[string]string
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

allowExternalPrincipals Boolean
Indicates whether principals outside your organization can be associated with a resource share.
arn String
The Amazon Resource Name (ARN) of the resource share.
name String
The name of the resource share.
permissionArns Changes to this property will trigger replacement. List<String>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Map<String,String>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

allowExternalPrincipals boolean
Indicates whether principals outside your organization can be associated with a resource share.
arn string
The Amazon Resource Name (ARN) of the resource share.
name string
The name of the resource share.
permissionArns Changes to this property will trigger replacement. string[]
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags {[key: string]: string}
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

allow_external_principals bool
Indicates whether principals outside your organization can be associated with a resource share.
arn str
The Amazon Resource Name (ARN) of the resource share.
name str
The name of the resource share.
permission_arns Changes to this property will trigger replacement. Sequence[str]
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Mapping[str, str]
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

allowExternalPrincipals Boolean
Indicates whether principals outside your organization can be associated with a resource share.
arn String
The Amazon Resource Name (ARN) of the resource share.
name String
The name of the resource share.
permissionArns Changes to this property will trigger replacement. List<String>
Specifies the Amazon Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
tags Map<String>
A map of tags to assign to the resource share. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Import

Using pulumi import, import resource shares using the arn of the resource share. For example:

$ pulumi import aws:ram/resourceShare:ResourceShare example arn:aws:ram:eu-west-1:123456789012:resource-share/73da1ab9-b94a-4ba3-8eb4-45917f7f4b12
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

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