Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Resource: aws_resource_share_accepter #7601

Closed
easttimor opened this issue Feb 19, 2019 · 14 comments · Fixed by #8259
Closed

New Resource: aws_resource_share_accepter #7601

easttimor opened this issue Feb 19, 2019 · 14 comments · Fixed by #8259
Labels
new-resource Introduces a new resource. service/ram Issues and PRs that pertain to the ram service.
Milestone

Comments

@easttimor
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Use AWS Resource Access Manager to share AWS resources between AWS accounts. To share a resource, you create a resource share, associate the resource with the resource share, and specify the principals that can access the resource. The principal must accept an invitation to be associated with the resource share. This last part, accepting the association invite, is the feature that is currently missing in the Terraform AWS provider.

  1. Create a resource share (aws_ram_resource_share)
  2. Associate target account (aws_ram_principal_association) - this exposed the ARN
  3. Accept the association (new resource required)

After creating a Resource Access Manager share (aws_ram_resource_share), other accounts/principals may be associated with the share. This association (aws_ram_principal_association) establishes an invite that must be accepted by the target account. aws_ram_principal_association.example.id exposes the ARN required for input to (3) aws_ram_principal_accepter.

New or Affected Resource(s)

  • aws_ram_principal_accepter

Potential Terraform Configuration

resource "aws_ram_principal_accepter" "example" {
  resource_share_invitation_arn = "${aws_ram_principal_association.example.id}"
}

References

@easttimor easttimor added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 19, 2019
@bflad bflad added new-resource Introduces a new resource. service/ram Issues and PRs that pertain to the ram service. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Feb 19, 2019
@umitseremet
Copy link

Is there a workaround solution to accept request on the destination part? That will be useful especially transit gateway operations

@hatched-DavidMichon
Copy link

@umitseremet I'm facing the same issue but didn't yet worked on a workaround implementation. But if I would implement it right now I would try it with a null_resource and call to aws-cli https://docs.aws.amazon.com/cli/latest/reference/ram/accept-resource-share-invitation.html.

@umitseremet
Copy link

yes @hatched-DavidMichon it seems the only way can be applied, but especially on re-create or destroy operations it will be a problem. The only way seems to do it manual or cli, and applying import after the module is published

@soumitmishra

This comment has been minimized.

2 similar comments
@dmatkovic

This comment has been minimized.

@sadok-f

This comment has been minimized.

@hatched-DavidMichon
Copy link

hatched-DavidMichon commented Apr 1, 2019

I did a similar work for Transit Gateway attachment accepter using a lambda function (aws_lambda_function) and a cloudformation stack (aws_cloudformation_stack).

The idea is to create a cloudformation stack that calls a lambda function who assumes role of the accepter AWS account to accept the request. Cloudformation stack has a "delete" phase so you can also handle this process in your lambda function to actually do necessary/required cleanup.

Here's an example for VPC peering https://github.com/awslabs/aws-cloudformation-templates/tree/master/aws/solutions/VPCPeering that I use and adapt for my needs.

This could be a temporary workaround until resources are available on TF.

@YakDriver
Copy link
Member

@umitseremet @torr201812 @hatched-DavidMichon Please see #8259 and provide 👍 and any feedback.

@MMarulla
Copy link
Contributor

If your different accounts are under a single organization, there is an option in the Resource Access Manager console under the "Settings" tab for the master account called "Enable Sharing". Once checked, according to AWS:

When you share resources within your organization, AWS RAM does not send invitations to principals. Principals in your organization get access to shared resources without exchanging invitations.

@ghost
Copy link

ghost commented Jul 19, 2019

Any updates on this :Accept the association (new resource required)

@YakDriver
Copy link
Member

@Ricomlb Not that I know of

@bflad bflad added this to the v2.24.0 milestone Aug 14, 2019
@bflad
Copy link
Contributor

bflad commented Aug 14, 2019

The new aws_ram_resource_share_accepter resource has been merged and will release with version 2.24.0 of the Terraform AWS Provider, tomorrow. Special thanks to @YakDriver, @ewbankkit, and @lorengordon who were instrumental in helping get this added.

Please note: this resource will accept a RAM Resource Share ARN directly, rather than requiring the need to fetch a RAM Resource Share Invitation ARN. The resource documentation will show an example multi-account setup with aws_ram_resource_share, aws_ram_principal_association, and this new resource. 👍

@ghost
Copy link

ghost commented Aug 15, 2019

This has been released in version 2.24.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 1, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/ram Issues and PRs that pertain to the ram service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants