ResourceShareAccepter

class ResourceShareAccepter : KotlinCustomResource

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

This configuration provides an example of using multiple AWS providers to configure two different AWS accounts. In the sender account, the configuration creates a aws.ram.ResourceShare and uses a data source in the receiver account to create a aws.ram.PrincipalAssociation resource with the receiver's account ID. In the receiver account, the configuration accepts the invitation to share resources with the aws.ram.ResourceShareAccepter.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.Provider;
import com.pulumi.aws.ProviderArgs;
import com.pulumi.aws.ram.ResourceShare;
import com.pulumi.aws.ram.ResourceShareArgs;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.ram.PrincipalAssociation;
import com.pulumi.aws.ram.PrincipalAssociationArgs;
import com.pulumi.aws.ram.ResourceShareAccepter;
import com.pulumi.aws.ram.ResourceShareAccepterArgs;
import com.pulumi.resources.CustomResourceOptions;
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 alternate = new Provider("alternate", ProviderArgs.builder()
.profile("profile1")
.build());
var senderShare = new ResourceShare("senderShare", ResourceShareArgs.builder()
.allowExternalPrincipals(true)
.tags(Map.of("Name", "tf-test-resource-share"))
.build(), CustomResourceOptions.builder()
.provider(aws.alternate())
.build());
final var receiver = AwsFunctions.getCallerIdentity();
var senderInvite = new PrincipalAssociation("senderInvite", PrincipalAssociationArgs.builder()
.principal(receiver.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
.resourceShareArn(senderShare.arn())
.build(), CustomResourceOptions.builder()
.provider(aws.alternate())
.build());
var receiverAccept = new ResourceShareAccepter("receiverAccept", ResourceShareAccepterArgs.builder()
.shareArn(senderInvite.resourceShareArn())
.build());
}
}

Import

Resource share accepters can be imported using the resource share ARN, e.g.,

$ pulumi import aws:ram/resourceShareAccepter:ResourceShareAccepter example arn:aws:ram:us-east-1:123456789012:resource-share/c4b56393-e8d9-89d9-6dc9-883752de4767

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val invitationArn: Output<String>

The ARN of the resource share invitation.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The account ID of the receiver account which accepts the invitation.

Link copied to clipboard
val resources: Output<List<String>>

A list of the resource ARNs shared via the resource share.

Link copied to clipboard
val senderAccountId: Output<String>

The account ID of the sender account which submits the invitation.

Link copied to clipboard
val shareArn: Output<String>

The ARN of the resource share.

Link copied to clipboard
val shareId: Output<String>

The ID of the resource share as displayed in the console.

Link copied to clipboard
val shareName: Output<String>

The name of the resource share.

Link copied to clipboard
val status: Output<String>

The status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).

Link copied to clipboard
val urn: Output<String>