ResourceShareAccepter
Manage accepting a Resource Access Manager (RAM) Resource Share invitation. From a receiver AWS account, accept an invitation to share resources that were shared by a sender AWS account. To create a resource share in the sender, see the aws.ram.ResourceShare resource.
Note: If both AWS accounts are in the same Organization and RAM Sharing with AWS Organizations is enabled, this resource is not necessary as RAM Resource Share invitations are not used.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var alternate = new Aws.Provider("alternate", new Aws.ProviderArgs
{
Profile = "profile1",
});
var senderShare = new Aws.Ram.ResourceShare("senderShare", new Aws.Ram.ResourceShareArgs
{
AllowExternalPrincipals = true,
Tags =
{
{ "Name", "tf-test-resource-share" },
},
}, new CustomResourceOptions
{
Provider = "aws.alternate",
});
var receiver = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
var senderInvite = new Aws.Ram.PrincipalAssociation("senderInvite", new Aws.Ram.PrincipalAssociationArgs
{
Principal = receiver.Apply(receiver => receiver.AccountId),
ResourceShareArn = senderShare.Arn,
}, new CustomResourceOptions
{
Provider = "aws.alternate",
});
var receiverAccept = new Aws.Ram.ResourceShareAccepter("receiverAccept", new Aws.Ram.ResourceShareAccepterArgs
{
ShareArn = senderInvite.ResourceShareArn,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/providers"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ram"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := providers.Newaws(ctx, "alternate", &providers.awsArgs{
Profile: pulumi.String("profile1"),
})
if err != nil {
return err
}
senderShare, err := ram.NewResourceShare(ctx, "senderShare", &ram.ResourceShareArgs{
AllowExternalPrincipals: pulumi.Bool(true),
Tags: pulumi.StringMap{
"Name": pulumi.String("tf-test-resource-share"),
},
}, pulumi.Provider("aws.alternate"))
if err != nil {
return err
}
receiver, err := aws.GetCallerIdentity(ctx, nil, nil)
if err != nil {
return err
}
senderInvite, err := ram.NewPrincipalAssociation(ctx, "senderInvite", &ram.PrincipalAssociationArgs{
Principal: pulumi.String(receiver.AccountId),
ResourceShareArn: senderShare.Arn,
}, pulumi.Provider("aws.alternate"))
if err != nil {
return err
}
_, err = ram.NewResourceShareAccepter(ctx, "receiverAccept", &ram.ResourceShareAccepterArgs{
ShareArn: senderInvite.ResourceShareArn,
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
import pulumi_pulumi as pulumi
alternate = pulumi.providers.Aws("alternate", profile="profile1")
sender_share = aws.ram.ResourceShare("senderShare",
allow_external_principals=True,
tags={
"Name": "tf-test-resource-share",
},
opts=ResourceOptions(provider="aws.alternate"))
receiver = aws.get_caller_identity()
sender_invite = aws.ram.PrincipalAssociation("senderInvite",
principal=receiver.account_id,
resource_share_arn=sender_share.arn,
opts=ResourceOptions(provider="aws.alternate"))
receiver_accept = aws.ram.ResourceShareAccepter("receiverAccept", share_arn=sender_invite.resource_share_arn)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const alternate = new aws.Provider("alternate", {
profile: "profile1",
});
const senderShare = new aws.ram.ResourceShare("sender_share", {
allowExternalPrincipals: true,
tags: {
Name: "tf-test-resource-share",
},
}, { provider: alternate });
const receiver = pulumi.output(aws.getCallerIdentity({ async: true }));
const senderInvite = new aws.ram.PrincipalAssociation("sender_invite", {
principal: receiver.accountId,
resourceShareArn: senderShare.arn,
}, { provider: alternate });
const receiverAccept = new aws.ram.ResourceShareAccepter("receiver_accept", {
shareArn: senderInvite.resourceShareArn,
});Create a ResourceShareAccepter Resource
new ResourceShareAccepter(name: string, args: ResourceShareAccepterArgs, opts?: CustomResourceOptions);def ResourceShareAccepter(resource_name, opts=None, share_arn=None, __props__=None);func NewResourceShareAccepter(ctx *Context, name string, args ResourceShareAccepterArgs, opts ...ResourceOption) (*ResourceShareAccepter, error)public ResourceShareAccepter(string name, ResourceShareAccepterArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ResourceShareAccepterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ResourceShareAccepterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceShareAccepterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ResourceShareAccepter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ResourceShareAccepter resource accepts the following input properties:
- string
The ARN of the resource share.
- string
The ARN of the resource share.
- string
The ARN of the resource share.
- str
The ARN of the resource share.
Outputs
All input properties are implicitly available as output properties. Additionally, the ResourceShareAccepter resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Invitation
Arn string The ARN of the resource share invitation.
- Receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- Resources List<string>
A list of the resource ARNs shared via the resource share.
- Sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- Status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- Id string
- The provider-assigned unique ID for this managed resource.
- Invitation
Arn string The ARN of the resource share invitation.
- Receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- Resources []string
A list of the resource ARNs shared via the resource share.
- Sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- Status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- id string
- The provider-assigned unique ID for this managed resource.
- invitation
Arn string The ARN of the resource share invitation.
- receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- resources string[]
A list of the resource ARNs shared via the resource share.
- sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- id str
- The provider-assigned unique ID for this managed resource.
- invitation_
arn str The ARN of the resource share invitation.
- receiver_
account_ strid The account ID of the receiver account which accepts the invitation.
- resources List[str]
A list of the resource ARNs shared via the resource share.
- sender_
account_ strid The account ID of the sender account which submits the invitation.
- str
The ID of the resource share as displayed in the console.
- str
The name of the resource share.
- status str
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
Look up an Existing ResourceShareAccepter Resource
Get an existing ResourceShareAccepter 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?: ResourceShareAccepterState, opts?: CustomResourceOptions): ResourceShareAccepterstatic get(resource_name, id, opts=None, invitation_arn=None, receiver_account_id=None, resources=None, sender_account_id=None, share_arn=None, share_id=None, share_name=None, status=None, __props__=None);func GetResourceShareAccepter(ctx *Context, name string, id IDInput, state *ResourceShareAccepterState, opts ...ResourceOption) (*ResourceShareAccepter, error)public static ResourceShareAccepter Get(string name, Input<string> id, ResourceShareAccepterState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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:
- Invitation
Arn string The ARN of the resource share invitation.
- Receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- Resources List<string>
A list of the resource ARNs shared via the resource share.
- Sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ARN of the resource share.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- Status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- Invitation
Arn string The ARN of the resource share invitation.
- Receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- Resources []string
A list of the resource ARNs shared via the resource share.
- Sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ARN of the resource share.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- Status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- invitation
Arn string The ARN of the resource share invitation.
- receiver
Account stringId The account ID of the receiver account which accepts the invitation.
- resources string[]
A list of the resource ARNs shared via the resource share.
- sender
Account stringId The account ID of the sender account which submits the invitation.
- string
The ARN of the resource share.
- string
The ID of the resource share as displayed in the console.
- string
The name of the resource share.
- status string
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
- invitation_
arn str The ARN of the resource share invitation.
- receiver_
account_ strid The account ID of the receiver account which accepts the invitation.
- resources List[str]
A list of the resource ARNs shared via the resource share.
- sender_
account_ strid The account ID of the sender account which submits the invitation.
- str
The ARN of the resource share.
- str
The ID of the resource share as displayed in the console.
- str
The name of the resource share.
- status str
The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.