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 for AWS Backup #7166

Closed
Quentin-M opened this issue Jan 17, 2019 · 21 comments · Fixed by #7382
Closed

Support for AWS Backup #7166

Quentin-M opened this issue Jan 17, 2019 · 21 comments · Fixed by #7382
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/backup Issues and PRs that pertain to the backup service.
Milestone

Comments

@Quentin-M
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

AWS just launched a new service called AWS Backup, which replaces and significantly extends the AWS Data Lifecycle Manager; by providing finer-grained policies (e.g. cron schedule), cold storage, adding the ability to backup not only EBS volumes but various other services (e.g. RDS databases, DynamoDB tables, EFS file systems, and Storage Gateway volumes).

The community could greatly profit from a Terraform implementation of this resource.

@Quentin-M Quentin-M added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 17, 2019
@slapula
Copy link
Contributor

slapula commented Jan 17, 2019

I can take shot at this if no one has started on it yet.

@bflad bflad added new-resource Introduces a new resource. service/backup Issues and PRs that pertain to the backup service. labels Jan 17, 2019
@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 17, 2019

It looks like we'll want:

resources.

@slapula
Copy link
Contributor

slapula commented Jan 17, 2019

Something like this will likely need to be merged first before we add these resources to the provider: #7164

@slapula
Copy link
Contributor

slapula commented Jan 18, 2019

Seeing as that the aws-go-sdk docs have been updated to include this service now, I'll get started today. It makes most sense to start with aws_backup_vault since that seems to be the backbone for the other resources.

@peimanja
Copy link

peimanja commented Feb 2, 2019

Any update on this one?

@slapula
Copy link
Contributor

slapula commented Feb 2, 2019

@peimanja I have these resources written but I need to expand on the acceptance tests. Once that's done, all three PRs will need to be reviewed by the maintainers.

@bflad
Copy link
Contributor

bflad commented Feb 6, 2019

The new aws_backup_vault resource has been merged and will release with version 1.58.0 of the Terraform AWS provider, likely in the next day or two.

@bflad
Copy link
Contributor

bflad commented Feb 8, 2019

The new aws_backup_vault resource has been released in version 1.58.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@grumpper
Copy link

grumpper commented Feb 14, 2019

Any insights when should we expect the rest of the needed aws_backup related resources (plan & selection)? Since I am not seeing any updates in their PRs (7350 & 7382) for 2 weeks now...

@asweat-pubfactory
Copy link

Any updates on this? We're actively looking to deploy this to our existing Terraform setup.

@bflad
Copy link
Contributor

bflad commented Mar 18, 2019

The new aws_backup_plan resource has been merged and will release with version 2.3.0 of the Terraform AWS Provider, likely middle of this week.

@AndrewCi
Copy link

AndrewCi commented Apr 1, 2019

Just to confirm - it appears aws_backup_selection is the only resource not currently included in terraform?

@bflad bflad added this to the v2.5.0 milestone Apr 4, 2019
@bflad
Copy link
Contributor

bflad commented Apr 4, 2019

Hi folks! 👋 The aws_backup_selection resource has been merged and will release with version 2.5.0 of the Terraform AWS Provider, likely later today.

For any other feature requests or bug reports with the Backup service, please create new GitHub issues. Thanks!

@bflad
Copy link
Contributor

bflad commented Apr 5, 2019

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

@Geartrixy
Copy link

Really appreciate the speed at which this has been implemented!

Quick question:

According to the lifecycle documentation here https://www.terraform.io/docs/providers/aws/r/backup_plan.html , it states:

"(Required) Specifies the number of days after creation that a recovery point is moved to cold storage."

But there is an option to specify "Never". Does assigning the value "0" equate to "Never"? I ask as they are required values for the lifecycle block.

Thanks in advance :)

@slapula
Copy link
Contributor

slapula commented Apr 6, 2019

@Geartrixy this issue has been noted and is being handled in #8236 (which I believe will be reviewed and merged soon -- just not sure when).

@Geartrixy
Copy link

Also the following doesn't inform of a configuration error, but causes terraform to either crash or feedback multiple state refresh errors "Error: Error refreshing state":

lifecycle { cold_storage_after = "Never" delete_after = "Never" }

@Spenser309
Copy link

Spenser309 commented Apr 13, 2019

So, I noticed an issue which may require assistance with the aws_backup_vault resource

* module.dev.aws_backup_vault.dev-backup-vault (destroy): 1 error(s) occurred:

* aws_backup_vault.dev-backup-vault: error deleting Backup Vault (test-vault): InvalidRequestException: Backup vault cannot be deleted (contains 1 recovery points)
	status code: 400, request id: 31737fa3-24e8-47e9-b039-928046fac433

It looks like a force option may be needed on the vault resource to allow destroy to work properly.

@grumpper
Copy link

@Spenser309 this is also valid if you try to do it from AWS Console manually and it does not even give you an option to bulk delete and you have to get rid of recovery points one by one.... Bottom line is I think is unrelated to Terraform at all and force option will not be possible

@missioncloud
Copy link

We encountered this as well but had 1000+ recovery points; manually deleting was not feasible, especially with radio buttons on the console. We whipped up a little script to clean up previous recovery points - here's the source: https://gist.github.com/missioncloud/4dc21c48eb2c07ab7db93e11ebb08cc6

python3 delete_recovery_points.py $VAULT_NAME

Hope it helps someone!

@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. new-resource Introduces a new resource. service/backup Issues and PRs that pertain to the backup service.
Projects
None yet