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

issue #4713 New Resource: aws_neptune_cluster #5050

Merged
merged 16 commits into from
Jul 17, 2018

Conversation

saravanan30erd
Copy link
Contributor

@saravanan30erd saravanan30erd commented Jul 2, 2018

Fixes #4713
Reference: #4713

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSNeptuneCluster'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAWSNeptuneCluster -timeout 120m
=== RUN   TestAccAWSNeptuneClusterParameterGroup_basic
--- PASS: TestAccAWSNeptuneClusterParameterGroup_basic (55.86s)
=== RUN   TestAccAWSNeptuneClusterParameterGroup_namePrefix
--- PASS: TestAccAWSNeptuneClusterParameterGroup_namePrefix (54.48s)
=== RUN   TestAccAWSNeptuneClusterParameterGroup_generatedName
--- PASS: TestAccAWSNeptuneClusterParameterGroup_generatedName (55.00s)
=== RUN   TestAccAWSNeptuneClusterParameterGroup_Description
--- PASS: TestAccAWSNeptuneClusterParameterGroup_Description (55.70s)
=== RUN   TestAccAWSNeptuneClusterParameterGroup_Parameter
--- PASS: TestAccAWSNeptuneClusterParameterGroup_Parameter (94.20s)
=== RUN   TestAccAWSNeptuneClusterParameterGroup_Tags
--- PASS: TestAccAWSNeptuneClusterParameterGroup_Tags (134.52s)
=== RUN   TestAccAWSNeptuneCluster_basic
--- PASS: TestAccAWSNeptuneCluster_basic (130.39s)
=== RUN   TestAccAWSNeptuneCluster_namePrefix
--- PASS: TestAccAWSNeptuneCluster_namePrefix (152.58s)
=== RUN   TestAccAWSNeptuneCluster_takeFinalSnapshot
--- PASS: TestAccAWSNeptuneCluster_takeFinalSnapshot (212.69s)
=== RUN   TestAccAWSNeptuneCluster_updateTags
--- PASS: TestAccAWSNeptuneCluster_updateTags (177.25s)
=== RUN   TestAccAWSNeptuneCluster_updateIamRoles
--- PASS: TestAccAWSNeptuneCluster_updateIamRoles (219.52s)
=== RUN   TestAccAWSNeptuneCluster_kmsKey
--- PASS: TestAccAWSNeptuneCluster_kmsKey (196.87s)
=== RUN   TestAccAWSNeptuneCluster_encrypted
--- PASS: TestAccAWSNeptuneCluster_encrypted (142.91s)
=== RUN   TestAccAWSNeptuneCluster_backupsUpdate
--- PASS: TestAccAWSNeptuneCluster_backupsUpdate (199.69s)
=== RUN   TestAccAWSNeptuneCluster_iamAuth
--- PASS: TestAccAWSNeptuneCluster_iamAuth (130.87s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2012.587s
...

@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jul 2, 2018
@bflad bflad added new-resource Introduces a new resource. service/neptune Issues and PRs that pertain to the neptune service. labels Jul 2, 2018
@austinkelleher
Copy link

Awesome! We are using Neptune and would really love to see this get merged! Thank you for all of your work on this @saravanan30erd!

@bflad bflad added this to the v1.28.0 milestone Jul 11, 2018
@bflad bflad self-requested a review July 11, 2018 19:43
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.

Hi @saravanan30erd 👋 Thanks for submitting this! Please see the below for some initial feedback. Let us know if you have any questions or do not have time to implement these, thanks. Testing looks good so far 👍

"cluster_members": {
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not valid to assign cluster_members in configurations, so Optional: true should be removed from this attribute.

"neptune_cluster_parameter_group_name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to consider setting Default: "default.neptune1" or adding a DiffSuppressFunc here to properly allow Terraform to detect API drift and also allow the argument to be omitted instead of Computed: true. This could cause bug reports.

Delete: schema.DefaultTimeout(120 * time.Minute),
},

Schema: map[string]*schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: The attributes can be hard to follow because they are not in alphabetical order.


"snapshot_identifier": {
Type: schema.TypeString,
Computed: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Computed: false here is extraneous

"port": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be Default: 8182 and not Computed: true to properly detect drift from the API.

d.Set("arn", arn)

if err := saveTagsNeptune(conn, d, arn); err != nil {
log.Printf("[WARN] Failed to save tags for Neptune Cluster (%s): %s", aws.StringValue(dbc.DBClusterIdentifier), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should always prefer to return an error message and not just log this condition.

website/aws.erb Outdated
@@ -1677,6 +1677,10 @@
<a href="/docs/providers/aws/r/neptune_cluster_parameter_group.html">aws_neptune_cluster_parameter_group</a>
</li>

<li<%= sidebar_current("docs-aws-resource-neptune-cluster") %>>
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick: Due to the implementation of sidebar_current we should append a -x here and in the markdown page front matter to prevent the sidebar highlighting of both this resource and aws_neptune_cluster_parameter_group

engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "07:00-09:00"
skip_final_snapshot = "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

Two items:

We should remove the quotes around true for here and below.

Minor nitpick: The example resource should have its = aligned to match terraform fmt output


The following arguments are supported:

* `cluster_identifier` - (Optional, Forces new resources) The cluster identifier. If omitted, Terraform will assign a random, unique identifier.
Copy link
Contributor

Choose a reason for hiding this comment

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

The arguments should be alphabetically sorted, they are fairly hard to follow with the current ordering.

* `cluster_identifier` - The Neptune Cluster Identifier
* `cluster_resource_id` - The Neptune Cluster Resource ID
* `cluster_members` – List of Neptune Instances that are a part of this cluster
* `availability_zones` - The availability zone of the instance
Copy link
Contributor

Choose a reason for hiding this comment

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

The attributes byline states In addition to all arguments above -- we should remove all arguments from this attributes list and alphabetically sort the remainder

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jul 17, 2018
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jul 17, 2018
@saravanan30erd
Copy link
Contributor Author

@bflad updated the recommended changes 👍

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSNeptuneCluster_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAWSNeptuneCluster_ -timeout 120m
=== RUN TestAccAWSNeptuneCluster_basic
--- PASS: TestAccAWSNeptuneCluster_basic (128.93s)
=== RUN TestAccAWSNeptuneCluster_namePrefix
--- PASS: TestAccAWSNeptuneCluster_namePrefix (139.78s)
=== RUN TestAccAWSNeptuneCluster_takeFinalSnapshot
--- PASS: TestAccAWSNeptuneCluster_takeFinalSnapshot (152.37s)
=== RUN TestAccAWSNeptuneCluster_updateTags
--- PASS: TestAccAWSNeptuneCluster_updateTags (177.87s)
=== RUN TestAccAWSNeptuneCluster_updateIamRoles
--- PASS: TestAccAWSNeptuneCluster_updateIamRoles (212.79s)
=== RUN TestAccAWSNeptuneCluster_kmsKey
--- PASS: TestAccAWSNeptuneCluster_kmsKey (192.41s)
=== RUN TestAccAWSNeptuneCluster_encrypted
--- PASS: TestAccAWSNeptuneCluster_encrypted (138.92s)
=== RUN TestAccAWSNeptuneCluster_backupsUpdate
--- PASS: TestAccAWSNeptuneCluster_backupsUpdate (167.89s)
=== RUN TestAccAWSNeptuneCluster_iamAuth
--- PASS: TestAccAWSNeptuneCluster_iamAuth (149.48s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 1460.477s

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Jul 17, 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, @saravanan30erd! 🚀

=== RUN   TestAccAWSNeptuneCluster_iamAuth
--- PASS: TestAccAWSNeptuneCluster_iamAuth (88.37s)
=== RUN   TestAccAWSNeptuneCluster_namePrefix
--- PASS: TestAccAWSNeptuneCluster_namePrefix (88.60s)
=== RUN   TestAccAWSNeptuneCluster_basic
--- PASS: TestAccAWSNeptuneCluster_basic (88.62s)
=== RUN   TestAccAWSNeptuneCluster_encrypted
--- PASS: TestAccAWSNeptuneCluster_encrypted (88.68s)
=== RUN   TestAccAWSNeptuneCluster_kmsKey
--- PASS: TestAccAWSNeptuneCluster_kmsKey (107.79s)
=== RUN   TestAccAWSNeptuneCluster_backupsUpdate
--- PASS: TestAccAWSNeptuneCluster_backupsUpdate (113.19s)
=== RUN   TestAccAWSNeptuneCluster_updateIamRoles
--- PASS: TestAccAWSNeptuneCluster_updateIamRoles (114.10s)
=== RUN   TestAccAWSNeptuneCluster_updateTags
--- PASS: TestAccAWSNeptuneCluster_updateTags (133.03s)
=== RUN   TestAccAWSNeptuneCluster_takeFinalSnapshot
--- PASS: TestAccAWSNeptuneCluster_takeFinalSnapshot (159.10s)


// Check if any of the parameters that require a cluster modification after creation are set
var clusterUpdate bool
clusterUpdate = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick: Boolean zero values are false so this line is extraneous. Reference: https://tour.golang.org/basics/12

Otherwise this could be declared as: clusterUpdate := false

@bflad bflad merged commit 4e21c0d into hashicorp:master Jul 17, 2018
bflad added a commit that referenced this pull request Jul 17, 2018
@bflad
Copy link
Contributor

bflad commented Jul 18, 2018

This has been released in version 1.28.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 4, 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 4, 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/neptune Issues and PRs that pertain to the neptune service. size/XXL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Neptune
3 participants