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

r/aws_rds_cluster_endpoint: New Resource #6576

Merged
merged 10 commits into from
Dec 11, 2018

Conversation

kjmkznr
Copy link
Contributor

@kjmkznr kjmkznr commented Nov 25, 2018

Changes proposed in this pull request:

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSRDSClusterEndpoint'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSRDSClusterEndpoint -timeout 120m
=== RUN   TestAccAWSRDSClusterEndpoint_importBasic
=== PAUSE TestAccAWSRDSClusterEndpoint_importBasic
=== RUN   TestAccAWSRDSClusterEndpoint_basic
=== PAUSE TestAccAWSRDSClusterEndpoint_basic
=== CONT  TestAccAWSRDSClusterEndpoint_importBasic
=== CONT  TestAccAWSRDSClusterEndpoint_basic
--- PASS: TestAccAWSRDSClusterEndpoint_basic (912.30s)
--- PASS: TestAccAWSRDSClusterEndpoint_importBasic (999.30s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       999.313s

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 25, 2018
@bflad bflad added the new-resource Introduces a new resource. label Nov 26, 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.

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.

aws/resource_aws_rds_cluster_endpoint.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint_test.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint_test.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint_test.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint_test.go Outdated Show resolved Hide resolved
aws/resource_aws_rds_cluster_endpoint_test.go Outdated Show resolved Hide resolved
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Nov 26, 2018
@kjmkznr
Copy link
Contributor Author

kjmkznr commented Nov 26, 2018

@bflad
Thank you very much for review!
I will fix in this week.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 26, 2018
@bflad
Copy link
Contributor

bflad commented Dec 5, 2018

Looking pretty good, @kjmkznr! Let us know if you have any questions about the last items or don't have time to implement them. 😄

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Dec 5, 2018
@kjmkznr
Copy link
Contributor Author

kjmkznr commented Dec 9, 2018

Sorry, I missed some reviews.
I also fixed the rest.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Dec 9, 2018
@kjmkznr kjmkznr changed the title r/aws_rds_cluster_endpoint: New Resource WIP: r/aws_rds_cluster_endpoint: New Resource Dec 10, 2018
@kjmkznr kjmkznr changed the title WIP: r/aws_rds_cluster_endpoint: New Resource r/aws_rds_cluster_endpoint: New Resource Dec 10, 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.

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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.

Suggested change
return resp.DBClusterEndpoints[0], *resp.DBClusterEndpoints[0].Status, nil
return resp.DBClusterEndpoints[0], aws.StringValue(resp.DBClusterEndpoints[0].Status), nil

@bflad bflad added this to the v1.52.0 milestone Dec 11, 2018
@bflad bflad merged commit 5b975b8 into hashicorp:master Dec 11, 2018
bflad added a commit that referenced this pull request Dec 11, 2018
@kjmkznr
Copy link
Contributor Author

kjmkznr commented Dec 12, 2018

Thank you!

@kjmkznr kjmkznr deleted the f-r-aws_rds_cluster_custom_endpoint branch December 12, 2018 14:30
@bflad
Copy link
Contributor

bflad commented Dec 13, 2018

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.

@ghost
Copy link

ghost commented Apr 1, 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 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/rds Issues and PRs that pertain to the rds service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants