Package com.pulumi.aws.ram
Class ResourceShareAccepter
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.ram.ResourceShareAccepter
-
public class ResourceShareAccepter extends com.pulumi.resources.CustomResourceManage 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](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-orgs), 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`.
## Import Using `pulumi import`, import resource share accepters using the resource share ARN. For example: ```sh $ pulumi import aws:ram/resourceShareAccepter:ResourceShareAccepter example arn:aws:ram:us-east-1:123456789012:resource-share/c4b56393-e8d9-89d9-6dc9-883752de4767 ```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 com.pulumi.aws.AwsFunctions; import com.pulumi.aws.inputs.GetCallerIdentityArgs; 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 java.util.ArrayList; import java.util.Arrays; 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 senderShare = new ResourceShare("senderShare", ResourceShareArgs.builder() .name("tf-test-resource-share") .allowExternalPrincipals(true) .tags(Map.of("Name", "tf-test-resource-share")) .build()); final var receiver = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder() .build()); var senderInvite = new PrincipalAssociation("senderInvite", PrincipalAssociationArgs.builder() .principal(receiver.accountId()) .resourceShareArn(senderShare.arn()) .build()); var receiverAccept = new ResourceShareAccepter("receiverAccept", ResourceShareAccepterArgs.builder() .shareArn(senderInvite.resourceShareArn()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description ResourceShareAccepter(java.lang.String name)ResourceShareAccepter(java.lang.String name, ResourceShareAccepterArgs args)ResourceShareAccepter(java.lang.String name, ResourceShareAccepterArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourceShareAccepterget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ResourceShareAccepterState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>invitationArn()com.pulumi.core.Output<java.lang.String>receiverAccountId()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.List<java.lang.String>>resources()com.pulumi.core.Output<java.lang.String>senderAccountId()com.pulumi.core.Output<java.lang.String>shareArn()com.pulumi.core.Output<java.lang.String>shareId()com.pulumi.core.Output<java.lang.String>shareName()com.pulumi.core.Output<java.lang.String>status()
-
-
-
Constructor Detail
-
ResourceShareAccepter
public ResourceShareAccepter(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ResourceShareAccepter
public ResourceShareAccepter(java.lang.String name, ResourceShareAccepterArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ResourceShareAccepter
public ResourceShareAccepter(java.lang.String name, ResourceShareAccepterArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
invitationArn
public com.pulumi.core.Output<java.lang.String> invitationArn()
- Returns:
- ARN of the resource share invitation.
-
receiverAccountId
public com.pulumi.core.Output<java.lang.String> receiverAccountId()
- Returns:
- Account ID of the receiver account which accepts the invitation.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
resources
public com.pulumi.core.Output<java.util.List<java.lang.String>> resources()
- Returns:
- List of the resource ARNs shared via the resource share.
-
senderAccountId
public com.pulumi.core.Output<java.lang.String> senderAccountId()
- Returns:
- Account ID of the sender account which submits the invitation.
-
shareArn
public com.pulumi.core.Output<java.lang.String> shareArn()
- Returns:
- ARN of the resource share.
-
shareId
public com.pulumi.core.Output<java.lang.String> shareId()
- Returns:
- ID of the resource share as displayed in the console.
-
shareName
public com.pulumi.core.Output<java.lang.String> shareName()
- Returns:
- Name of the resource share.
-
status
public com.pulumi.core.Output<java.lang.String> status()
- Returns:
- Status of the resource share (ACTIVE, PENDING, FAILED, DELETING, DELETED).
-
get
public static ResourceShareAccepter get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ResourceShareAccepterState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-