-
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
r/aws_rds_cluster_endpoint: New Resource #6576
r/aws_rds_cluster_endpoint: New Resource #6576
Conversation
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 @kjmkznr 👋 Thanks for submitting this! I have left some initial comments below. Please let us know if you have any questions or do not have time to implement the feedback.
@bflad |
Looking pretty good, @kjmkznr! Let us know if you have any questions about the last items or don't have time to implement them. 😄 |
Sorry, I missed some reviews. |
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.
Let's get this in as none of the remaining review items are necessarily blocking. Thanks, @kjmkznr 🚀
--- PASS: TestAccAWSRDSClusterEndpoint_basic (1367.54s)
return nil | ||
} | ||
|
||
func DBClusterEndpointStateRefreshFunc(conn *rds.RDS, id string) resource.StateRefreshFunc { |
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.
Nit: In Go, capitalized function names mean they are exported and available for usage outside the current Go package (e.g. public
in Java). While we currently don't make any compatibility promises about using this codebase as a library, we should avoid exporting functions where possible. I believe this will be caught by golint
in the future (if we enable it in this codebase) since as its written this exported function does not have an associated comment.
return emptyResp, "destroyed", nil | ||
} else if resp != nil && len(resp.DBClusterEndpoints) == 0 { | ||
return emptyResp, "destroyed", nil | ||
} else { |
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.
Nit: Since the other conditionals here use return
, this else
and nesting are extraneous. I believe this will be caught by gosimple
linting in the future.
return emptyResp, "destroyed", nil | ||
} | ||
|
||
return resp.DBClusterEndpoints[0], *resp.DBClusterEndpoints[0].Status, nil |
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.
Nit: To prevent potential panics we should use the SDK provided helper function for dereferencing the Status
, e.g.
return resp.DBClusterEndpoints[0], *resp.DBClusterEndpoints[0].Status, nil | |
return resp.DBClusterEndpoints[0], aws.StringValue(resp.DBClusterEndpoints[0].Status), nil |
Thank you! |
This has been released in version 1.52.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! |
Changes proposed in this pull request:
aws_rds_cluster_endpoint
resource.Output from acceptance testing: