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

Support Attaching and Detaching IAM Roles to RDS Database Instances (e.g. Oracle S3 Integration) #8038

Closed
bflad opened this issue Mar 21, 2019 · 4 comments · Fixed by #8466
Closed
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Mar 21, 2019

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

Amazon recently announced an integration between Amazon RDS for Oracle instances and Amazon S3: https://aws.amazon.com/about-aws/whats-new/2019/02/Amazon-RDS-for-Oracle-Now-Supports-Amazon-S3-Integration/

With Amazon S3 Integration, you can perform data ingress with Oracle Data Pump to migrate workloads into your RDS Oracle DB Instance. After exporting your data from your source instance, you upload your Data Pump files to your Amazon S3 bucket. You can then copy the files from your S3 bucket to the RDS Oracle host and finally use the DBMS_DATAPUMP package to import your data into the target RDS Oracle DB Instance.

With Amazon S3 Integration, you can also perform data egress out of your RDS Oracle DB instance. First, back up the data locally on the RDS Oracle host. This local backup can either be an Oracle RMAN backup or Oracle Data Pump export of the database. Once these files are created locally, you can copy the files to the S3 bucket. Optionally, you can move these backups from Amazon S3 to Amazon S3 Glacier for long term storage that complements your automated backup strategy. By using this method, you can satisfy regulatory requirements for storing database backups in an off-site location and, at the same time, cost effectively support your long-term retention policies.

Details for configuring this integration can be found at: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html

While we should already have the necessary support required for Option Groups, the DB Instance requires new management of IAM Role attachments. This is similar to DB Cluster attachments for IAM Roles, however DB Instance attachments also require a feature name.

New or Affected Resource(s)

  • aws_db_instance or potentially a new aws_db_instance_role_attachment resource

Potential Terraform Configuration

# If implemented within the resource
resource "aws_db_instance" "example" {
  role {
    feature_name = "..."
    role_arn = "${aws_iam_role.example.arn}"
  }
}

# If implemented as a separate resource
resource "aws_db_instance_role_attachment" "example" {
  db_instance_identifier = "${aws_db_instance.example.id}"
  feature_name = "..."
  role_arn = "${aws_iam_role.example.arn}"
}

References

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. labels Mar 21, 2019
@bflad
Copy link
Contributor Author

bflad commented Apr 27, 2019

Pull request submitted: #8466

bflad added a commit that referenced this issue Apr 27, 2019
Reference: #8038

Output from acceptance testing:

```
--- PASS: TestAccAWSDbInstanceRoleAssociation_basic (561.71s)
--- PASS: TestAccAWSDbInstanceRoleAssociation_disappears (675.31s)
```
@bflad
Copy link
Contributor Author

bflad commented Apr 27, 2019

This should support the new Importing Amazon S3 Data into an RDS PostgreSQL DB Instance feature as well with something like:

resource "aws_db_instance_role_association" "test" {
  db_instance_identifier = "${aws_db_instance.test.id}"
  feature_name           = "s3Import"
  role_arn               = "${aws_iam_role.test.id}"
}

@nywilken
Copy link
Contributor

nywilken commented May 1, 2019

The new aws_db_instance_role_association resource has been merged and will be released with version 2.9.0 of the Terraform AWS provider.

@bflad bflad added this to the v2.9.0 milestone May 6, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

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 Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants