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

NewResource/dax_parameter_group: Support dax parameter group #4299

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

atsushi-ishibashi
Copy link
Contributor

TF_ACC=1 go test ./aws -v -run=TestAccAwsDaxParameterGroup* -timeout 120m
=== RUN   TestAccAwsDaxParameterGroup_basic
--- PASS: TestAccAwsDaxParameterGroup_basic (94.17s)
=== RUN   TestAccAwsDaxParameterGroup_import
--- PASS: TestAccAwsDaxParameterGroup_import (48.23s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	142.436s

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Apr 21, 2018
@bflad bflad added new-resource Introduces a new resource. service/dax Issues and PRs that pertain to the dax service. labels Apr 23, 2018
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.

Great work as usual @atsushi-ishibashi! Few minor things which I'll fix on merge. 🚀

2 tests passed (all tests)
=== RUN   TestAccAwsDaxParameterGroup_import
--- PASS: TestAccAwsDaxParameterGroup_import (7.15s)
=== RUN   TestAccAwsDaxParameterGroup_basic
--- PASS: TestAccAwsDaxParameterGroup_basic (40.92s)

CheckDestroy: testAccCheckAwsDaxParameterGroupDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccDaxParameterGroupConfig(acctest.RandString(5)),
Copy link
Contributor

Choose a reason for hiding this comment

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

This can generate an invalid name 😉

--- FAIL: TestAccAwsDaxParameterGroup_import (2.58s)
    testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_dax_parameter_group.test: 1 error(s) occurred:
        
        * aws_dax_parameter_group.test: InvalidParameterValueException: The parameter CacheParameterGroupName is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
            status code: 400, request id: 2707066a-46ef-11e8-8865-e1831f4bb1a0

}
return err
}
pg := resp.ParameterGroups[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

To prevent a panic, we should do a len() check here.

if len(resp.ParameterGroups) == 0 {
  log.Printf("[WARN] DAX ParameterGroup %q not found, removing from state", d.Id())
  d.SetId("")
  return nil
}


d.Set("name", pg.ParameterGroupName)
desc := pg.Description
// default description is " "
Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️ Some of these APIs never cease to amaze.

@bflad bflad added this to the v1.16.0 milestone Apr 23, 2018
@bflad bflad merged commit 9bbc68d into hashicorp:master Apr 23, 2018
bflad added a commit that referenced this pull request Apr 23, 2018
@bflad
Copy link
Contributor

bflad commented Apr 25, 2018

This has been released in version 1.16.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 Apr 6, 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 Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/dax Issues and PRs that pertain to the dax service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants