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

New resource: aws_neptune_cluster_instance #5376

Merged
merged 13 commits into from
Aug 1, 2018

Conversation

saravanan30erd
Copy link
Contributor

Reference #4713

Changes proposed in this pull request:

  • Change 1
    Added new resource aws_neptune_cluster_instance

@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jul 29, 2018
@bflad bflad added new-resource Introduces a new resource. service/neptune Issues and PRs that pertain to the neptune service. labels Jul 30, 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.

Thanks for contributing this, @saravanan30erd! Overall this is looking pretty good -- a few minor feedback items and it should be good to go. Please let us know if you have any questions or do not have time to address them. 👍

}

if err := saveTagsNeptune(conn, d, aws.StringValue(db.DBInstanceArn)); err != nil {
log.Printf("[WARN] Failed to save tags for Neptune Cluster Instance (%s): %s", aws.StringValue(db.DBInstanceIdentifier), 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 return an error here instead of just logging 😄


log.Printf("[DEBUG] Neptune Cluster Instance destroy configuration: %s", opts)
if _, err := conn.DeleteDBInstance(&opts); err != nil {
return 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 allow previously deleted Neptune instances to not error on Terraform resource deletion:

if err != nil {
  if isAWSErr(err, neptune.ErrCodeDBInstanceNotFoundFault, "") {
    return nil
  }
  return fmt.Errorf("error deleting Neptune cluster instance %q: %s", d.Id(), err)
}


if len(resp.DBInstances) != 1 ||
aws.StringValue(resp.DBInstances[0].DBInstanceIdentifier) != id {
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Anytime err != nil, it is previously returned -- this conditional seems like it should be removed.

Default: 0,
},

"publicly_accessible": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this attribute updatable? It is not handled by the update function currently and should either be added there or have ForceNew: true added

requestUpdate = true
}

if d.HasChange("monitoring_role_arn") {
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 add an acceptance test to verify that both the MonitoringRoleArn and MonitoringInterval parameters do not need to specified at the same time during update. See also: #2188

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bflad Looks like there is no support for enhanced monitoring for neptune engine 👍

aws_neptune_cluster_instance.cluster_instances: error creating Neptune Instance: InvalidParameterCombination: Enhanced Monitoring is not supported for the neptune database engine. Go to the RDS documentation for information about supported database engines.

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

@bflad done all the changes

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

LGTM with 3 minor things which will be adjusted on merge so we can release this today. Thanks @saravanan30erd 🚀

=== RUN   TestAccAWSNeptuneClusterInstance_generatedName
--- PASS: TestAccAWSNeptuneClusterInstance_generatedName (637.04s)
=== RUN   TestAccAWSNeptuneClusterInstance_withSubnetGroup
--- PASS: TestAccAWSNeptuneClusterInstance_withSubnetGroup (682.77s)
=== RUN   TestAccAWSNeptuneClusterInstance_namePrefix
--- PASS: TestAccAWSNeptuneClusterInstance_namePrefix (707.84s)
=== RUN   TestAccAWSNeptuneClusterInstance_withaz
--- PASS: TestAccAWSNeptuneClusterInstance_withaz (726.35s)
=== RUN   TestAccAWSNeptuneClusterInstance_kmsKey
--- PASS: TestAccAWSNeptuneClusterInstance_kmsKey (764.09s)
=== RUN   TestAccAWSNeptuneClusterInstance_basic
--- PASS: TestAccAWSNeptuneClusterInstance_basic (1438.20s)

Computed: true,
},

"port": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this argument is missing documentation

}

if db.Endpoint != nil {
d.Set("endpoint", db.Endpoint.Address)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: with the aws_db_instance resource we have 3 attributes (address, endpoint, and port):

https://github.com/terraform-providers/terraform-provider-aws/blob/2c5c645f5a088c38ac490f032adaf1706e4c09a7/aws/resource_aws_db_instance.go#L987-L995

For a few reasons I think we should follow suit here:

  • Provides an attribute with only the hostname
  • Matches the API naming for address
  • Ancillary: Reduces any confusion working between the two resources

Read: resourceAwsNeptuneClusterInstanceRead,
Update: resourceAwsNeptuneClusterInstanceUpdate,
Delete: resourceAwsNeptuneClusterInstanceDelete,
Importer: &schema.ResourceImporter{
Copy link
Contributor

Choose a reason for hiding this comment

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

Resource import documentation is missing

@bflad bflad added this to the v1.30.0 milestone Aug 1, 2018
@bflad bflad merged commit e4e7908 into hashicorp:master Aug 1, 2018
bflad added a commit that referenced this pull request Aug 1, 2018
* Add address attribute
* Add port argument documentation
* Add import documentation
* Clarify configurable timeouts documentation
* Set identifier_prefix ConflictsWith identifier
bflad added a commit that referenced this pull request Aug 1, 2018
@bflad
Copy link
Contributor

bflad commented Aug 2, 2018

This has been released in version 1.30.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.

2 participants