-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Conversation
Awesome! We are using Neptune and would really love to see this get merged! Thank you for all of your work on this @saravanan30erd! |
There was a problem hiding this 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 👍
aws/resource_aws_neptune_cluster.go
Outdated
"cluster_members": { | ||
Type: schema.TypeSet, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
Optional: true, |
There was a problem hiding this comment.
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.
aws/resource_aws_neptune_cluster.go
Outdated
"neptune_cluster_parameter_group_name": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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.
aws/resource_aws_neptune_cluster.go
Outdated
|
||
"snapshot_identifier": { | ||
Type: schema.TypeString, | ||
Computed: false, |
There was a problem hiding this comment.
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
aws/resource_aws_neptune_cluster.go
Outdated
"port": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Computed: true, |
There was a problem hiding this comment.
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.
aws/resource_aws_neptune_cluster.go
Outdated
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) |
There was a problem hiding this comment.
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") %>> |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 updated the recommended changes 👍 $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSNeptuneCluster_' |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
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. |
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! |
Fixes #4713Reference: #4713