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

resource/db_instance: add restore to point in time support #15969

Merged
merged 7 commits into from
Nov 12, 2020

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Nov 2, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #5286
Preceded by #7031

Release note for CHANGELOG:

resource/db_instance: add `restore_to_point_in_time` argument
resource/db_instance: add `latest_restorable_time` attribute

Output from acceptance testing:

--- PASS: TestAccAWSDBInstance_RestoreToPointInTime_SourceIdentifier (1469.96s)
--- PASS: TestAccAWSDBInstance_RestoreToPointInTime_SourceResourceID (1275.53s)

--- PASS: TestAccAWSDBInstance_kmsKey (430.59s) (previously panicking but fixed w/ commit 81ca42c14)

other test results in progress...

@anGie44 anGie44 requested a review from a team November 2, 2020 12:45
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/iot Issues and PRs that pertain to the iot service. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 2, 2020
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from 30a4c68 to ffe6076 Compare November 2, 2020 12:59
@anGie44 anGie44 marked this pull request as draft November 2, 2020 14:23
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch 3 times, most recently from c090dc8 to 202d976 Compare November 2, 2020 14:57
@anGie44 anGie44 marked this pull request as ready for review November 2, 2020 14:58
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch 2 times, most recently from c17355e to de19bb1 Compare November 2, 2020 15:59
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Nov 2, 2020
Comment on lines 3223 to 3249

func TestValidateUTCTimestamp(t *testing.T) {
validT := []string{
"2006-01-02T15:04:05Z",
}

invalidT := []string{
"2015-03-07 23:45:00",
"27-03-2019 23:45:00",
"Mon, 02 Jan 2006 15:04:05 -0700",
}

for _, f := range validT {
_, errors := validateUTCTimestamp(f, "UTC timestamp")
if len(errors) > 0 {
t.Fatalf("Expected the time %q to be in valid format, got error %q", f, errors)
}
}

for _, f := range invalidT {
_, errors := validateUTCTimestamp(f, "invalid UTC timestamp")
if len(errors) == 0 {
t.Fatalf("Expected the time %q to fail validation", f)
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied over from #7031 to re-use here though under a more generic func name

@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from de19bb1 to 565b560 Compare November 2, 2020 16:02
@anGie44 anGie44 added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 2, 2020
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from 565b560 to 291851c Compare November 2, 2020 16:34
@anGie44 anGie44 requested a review from a team as a code owner November 11, 2020 02:50
@YakDriver YakDriver self-assigned this Nov 11, 2020
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits but looks great!

GovCloud:

--- PASS: TestAccAWSDBInstance_MinorVersion (429.15s)
--- PASS: TestAccAWSDBInstance_basic (432.28s)
--- PASS: TestAccAWSDBInstance_AllowMajorVersionUpgrade (447.87s)
--- PASS: TestAccAWSDBInstance_namePrefix (449.64s)
--- PASS: TestAccAWSDBInstance_IsAlreadyBeingDeleted (459.03s)
--- PASS: TestAccAWSDBInstance_DbSubnetGroupName_VpcSecurityGroupIds (474.81s)
--- PASS: TestAccAWSDBInstance_RestoreToPointInTime_SourceResourceID (1305.06s)
--- PASS: TestAccAWSDBInstance_RestoreToPointInTime_SourceIdentifier (1388.71s)

aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance.go Show resolved Hide resolved
aws/resource_aws_db_instance_test.go Outdated Show resolved Hide resolved
aws/validators.go Outdated Show resolved Hide resolved
website/docs/r/db_instance.html.markdown Outdated Show resolved Hide resolved
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from 40fdef3 to 29f6405 Compare November 12, 2020 00:32
aws/validators_test.go Outdated Show resolved Hide resolved
aws/validators_test.go Outdated Show resolved Hide resolved
@anGie44 anGie44 added this to the v3.15.0 milestone Nov 12, 2020
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. and removed size/XL Managed by automation to categorize the size of a PR. labels Nov 12, 2020
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. size/XXL Managed by automation to categorize the size of a PR. labels Nov 12, 2020
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from 78d9d5f to dd30d59 Compare November 12, 2020 18:07
@anGie44 anGie44 force-pushed the f-db-instance-point-in-time-restore branch from fb33369 to 227fc68 Compare November 12, 2020 18:13
@anGie44 anGie44 added service/iot Issues and PRs that pertain to the iot service. and removed service/apigateway Issues and PRs that pertain to the apigateway service. service/devicefarm Issues and PRs that pertain to the devicefarm service. service/ec2 Issues and PRs that pertain to the ec2 service. service/iot Issues and PRs that pertain to the iot service. service/waf Issues and PRs that pertain to the waf service. labels Nov 12, 2020
@anGie44 anGie44 merged commit dea61f5 into master Nov 12, 2020
@anGie44 anGie44 deleted the f-db-instance-point-in-time-restore branch November 12, 2020 18:23
anGie44 added a commit that referenced this pull request Nov 12, 2020
@ghost
Copy link

ghost commented Nov 12, 2020

This has been released in version 3.15.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 Dec 13, 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 as resolved and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. service/iot Issues and PRs that pertain to the iot service. service/rds Issues and PRs that pertain to the rds service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants