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

Modify Aws Backup Selection Resource #8546

Conversation

teraken0509
Copy link
Contributor

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #8443

Release note for CHANGELOG:

- resource/aws_backup_selection: Add `ForceNew` configuration for `selection_tag` attributes.
- resource/aws_backup_selection: Add resource import support.

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAwsBackupSelection_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAwsBackupSelection_ -timeout 120m
=== RUN   TestAccAwsBackupSelection_basic
=== PAUSE TestAccAwsBackupSelection_basic
=== RUN   TestAccAwsBackupSelection_disappears
=== PAUSE TestAccAwsBackupSelection_disappears
=== RUN   TestAccAwsBackupSelection_withTags
=== PAUSE TestAccAwsBackupSelection_withTags
=== RUN   TestAccAwsBackupSelection_withResources
=== PAUSE TestAccAwsBackupSelection_withResources
=== RUN   TestAccAwsBackupSelection_updateTag
=== PAUSE TestAccAwsBackupSelection_updateTag
=== CONT  TestAccAwsBackupSelection_basic
=== CONT  TestAccAwsBackupSelection_withResources
=== CONT  TestAccAwsBackupSelection_updateTag
=== CONT  TestAccAwsBackupSelection_withTags
=== CONT  TestAccAwsBackupSelection_disappears
--- PASS: TestAccAwsBackupSelection_disappears (46.77s)
--- PASS: TestAccAwsBackupSelection_withResources (47.35s)
--- PASS: TestAccAwsBackupSelection_basic (47.77s)
--- PASS: TestAccAwsBackupSelection_withTags (47.89s)
--- PASS: TestAccAwsBackupSelection_updateTag (72.42s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	72.491s

@ghost ghost added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 7, 2019
@bflad bflad added bug Addresses a defect in current functionality. enhancement Requests to existing resources that expand the functionality or scope. service/backup Issues and PRs that pertain to the backup service. labels May 15, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks so much, @kterada0509, looks good with two small consistency updates that will be handled on merge. 🚀

Output from AWS Standard acceptance testing:

--- PASS: TestAccAwsBackupSelection_disappears (17.90s)
--- PASS: TestAccAwsBackupSelection_basic (19.08s)
--- PASS: TestAccAwsBackupSelection_withTags (19.20s)
--- PASS: TestAccAwsBackupSelection_withResources (19.37s)
--- PASS: TestAccAwsBackupSelection_updateTag (31.67s)

func resourceAwsBackupSelectionImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
idParts := strings.Split(d.Id(), "|")
if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" {
return nil, fmt.Errorf("unexpected format of ID (%q), expected <plan-id>:<selection-id>", d.Id())
Copy link
Contributor

Choose a reason for hiding this comment

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

The delimiter above is | not :

Suggested change
return nil, fmt.Errorf("unexpected format of ID (%q), expected <plan-id>:<selection-id>", d.Id())
return nil, fmt.Errorf("unexpected format of ID (%q), expected <plan-id>|<selection-id>", d.Id())

Backup selection can be imported using the role plan_id and id separated by `|`.

```
$ terraform import aws_backup_selection.example plan-id/selection-id
Copy link
Contributor

Choose a reason for hiding this comment

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

The delimiter in the import state function is | not :

Suggested change
$ terraform import aws_backup_selection.example plan-id/selection-id
$ terraform import aws_backup_selection.example plan-id|selection-id

@@ -152,6 +205,31 @@ func testAccCheckAwsBackupSelectionDisappears(selection *backup.GetBackupSelecti
}
}

func testAccCheckAwsBackupSelectionRecreated(t *testing.T,
Copy link
Contributor

Choose a reason for hiding this comment

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

💯 Thanks for adding this.

@bflad bflad added this to the v2.11.0 milestone May 15, 2019
@bflad bflad merged commit de481d7 into hashicorp:master May 15, 2019
bflad added a commit that referenced this pull request May 15, 2019
@bflad
Copy link
Contributor

bflad commented May 17, 2019

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

@teraken0509 teraken0509 deleted the feature/modify-aws_backup_selection-resource branch March 5, 2020 14:06
@ghost
Copy link

ghost commented Mar 5, 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 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/backup Issues and PRs that pertain to the backup service. size/M 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.

Cannot update selection tag in aws_backup_selection
2 participants