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

d/aws_dynamodb_table: Add missing 'billing_mode' and 'point_in_time_recovery' attributes #7497

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

ewbankkit
Copy link
Contributor

Fixes #7496.
Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsDynamoDbTable_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAwsDynamoDbTable_basic -timeout 120m
=== RUN   TestAccDataSourceAwsDynamoDbTable_basic
=== PAUSE TestAccDataSourceAwsDynamoDbTable_basic
=== CONT  TestAccDataSourceAwsDynamoDbTable_basic
--- PASS: TestAccDataSourceAwsDynamoDbTable_basic (146.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	146.526s

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/dynamodb Issues and PRs that pertain to the dynamodb service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 10, 2019
@ewbankkit
Copy link
Contributor Author

Partially replaces #5666.

Copy link
Member

@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.

LGTM, thanks @ewbankkit! 🚀

--- PASS: TestAccDataSourceAwsDynamoDbTable_basic (120.82s)

TableName: aws.String(d.Id()),
})
if err != nil && !isAWSErr(err, "UnknownOperationException", "") {
return err
Copy link
Member

Choose a reason for hiding this comment

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

Nit: We should return error context here for operators and code maintainers, e.g.

return fmt.Errorf("error reading DynamoDB Table (%s) continuous backups: %s", d.Id(), err)

Since the same problem exists in the resource, not marking as a review blocker.

if err != nil && !isAWSErr(err, "UnknownOperationException", "") {
return err
}
d.Set("point_in_time_recovery", flattenDynamoDbPitr(pitrOut))
Copy link
Member

Choose a reason for hiding this comment

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

When using d.Set() with aggregate types (TypeList, TypeSet, TypeMap), we should perform error checking to prevent issues where the code is not properly able to set the Terraform state. e.g.

if err := d.Set("point_in_time_recovery", flattenDynamoDbPitr(pitrOut)); err != nil {
  return fmt.Errorf("error setting point_in_time_recovery: %s", err)
}

Since the same problem exists in the resource, not marking as a review blocker.

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 12, 2019
@bflad bflad added this to the v1.59.0 milestone Feb 12, 2019
@bflad bflad merged commit c23e4c8 into hashicorp:master Feb 12, 2019
bflad added a commit that referenced this pull request Feb 12, 2019
@ewbankkit ewbankkit deleted the issue-7496 branch February 12, 2019 11:27
@bflad
Copy link
Member

bflad commented Feb 14, 2019

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

@ghost
Copy link

ghost commented Mar 31, 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 31, 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/dynamodb Issues and PRs that pertain to the dynamodb service. size/XS 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.

d/aws_dynamodb_table: Add missing billing_mode and point_in_time attributes
2 participants