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

3394 redshift node output #4563

Merged
merged 4 commits into from
Aug 31, 2021

Conversation

russellsherman
Copy link
Contributor

@russellsherman russellsherman commented May 17, 2018

Fixes #3394.
Relates #20727.

Changes proposed in this pull request:

  • Adds cluster node IPs

Current output from acceptance testing:

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSRedshiftCluster_privateIps -timeout 120m
=== RUN   TestAccAWSRedshiftCluster_privateIps
FAIL  github.com/terraform-providers/terraform-provider-aws/aws       746.561s
make: *** [testacc] Error 1

Would really love some feedback on this as it's my first PR and not the most familiar with Go. I believe that setting this resource attribute is not possible at creation as the AWS response does not include this information. It's possible to obtain via a describe-cluster --cluster-name {clusterName} command after the cluster has been created though.

Is there an established method of adding this kind of post-creation computed value to a resource elsewhere in this provider I can reference?

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label May 17, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/redshift Issues and PRs that pertain to the redshift service. labels May 18, 2018
@aeschright aeschright requested a review from a team June 25, 2019 19:21
@natarajanc
Copy link

possible to merge this ?

@michieldhadamus
Copy link

Would be great if this could be merged!

@bflad
Copy link
Contributor

bflad commented Apr 6, 2020

Hi @russellsherman 👋 Are you still interested in working on this? If so, I can provide some initial feedback, otherwise please let us know if we can finish this. Thank you.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 6, 2020
@russellsherman
Copy link
Contributor Author

@bflad I'd love to see this through, and any feedback would be helpful.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 7, 2020
@wardiablo
Copy link

Can we have this merge to master and release out soon?

Base automatically changed from master to main January 23, 2021 00:55
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:55
@evilr00t
Copy link

evilr00t commented Jun 7, 2021

bump, any update on this?

@ewbankkit ewbankkit force-pushed the 3394_RedshiftNodeOutput branch from 88470db to b9db8a4 Compare August 31, 2021 12:03
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/M Managed by automation to categorize the size of a PR. labels Aug 31, 2021
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Aug 31, 2021
@ewbankkit ewbankkit changed the title [WIP] 3394 redshift node output 3394 redshift node output Aug 31, 2021
@ewbankkit ewbankkit force-pushed the 3394_RedshiftNodeOutput branch from dff5dbe to 96ba48e Compare August 31, 2021 17:52
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% ACCTEST_PARALLELISM=10 make testacc TEST=./aws TESTARGS='-run=TestAccAWSRedshiftCluster_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 10 -run=TestAccAWSRedshiftCluster_ -timeout 180m
=== RUN   TestAccAWSRedshiftCluster_basic
=== PAUSE TestAccAWSRedshiftCluster_basic
=== RUN   TestAccAWSRedshiftCluster_withFinalSnapshot
=== PAUSE TestAccAWSRedshiftCluster_withFinalSnapshot
=== RUN   TestAccAWSRedshiftCluster_kmsKey
=== PAUSE TestAccAWSRedshiftCluster_kmsKey
=== RUN   TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
=== PAUSE TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
=== RUN   TestAccAWSRedshiftCluster_loggingEnabled
=== PAUSE TestAccAWSRedshiftCluster_loggingEnabled
=== RUN   TestAccAWSRedshiftCluster_snapshotCopy
=== PAUSE TestAccAWSRedshiftCluster_snapshotCopy
=== RUN   TestAccAWSRedshiftCluster_iamRoles
=== PAUSE TestAccAWSRedshiftCluster_iamRoles
=== RUN   TestAccAWSRedshiftCluster_publiclyAccessible
=== PAUSE TestAccAWSRedshiftCluster_publiclyAccessible
=== RUN   TestAccAWSRedshiftCluster_updateNodeCount
=== PAUSE TestAccAWSRedshiftCluster_updateNodeCount
=== RUN   TestAccAWSRedshiftCluster_updateNodeType
=== PAUSE TestAccAWSRedshiftCluster_updateNodeType
=== RUN   TestAccAWSRedshiftCluster_tags
=== PAUSE TestAccAWSRedshiftCluster_tags
=== RUN   TestAccAWSRedshiftCluster_forceNewUsername
=== PAUSE TestAccAWSRedshiftCluster_forceNewUsername
=== RUN   TestAccAWSRedshiftCluster_changeAvailabilityZone
=== PAUSE TestAccAWSRedshiftCluster_changeAvailabilityZone
=== RUN   TestAccAWSRedshiftCluster_changeEncryption1
=== PAUSE TestAccAWSRedshiftCluster_changeEncryption1
=== RUN   TestAccAWSRedshiftCluster_changeEncryption2
=== PAUSE TestAccAWSRedshiftCluster_changeEncryption2
=== CONT  TestAccAWSRedshiftCluster_basic
=== CONT  TestAccAWSRedshiftCluster_updateNodeCount
=== CONT  TestAccAWSRedshiftCluster_changeEncryption2
=== CONT  TestAccAWSRedshiftCluster_changeEncryption1
=== CONT  TestAccAWSRedshiftCluster_publiclyAccessible
=== CONT  TestAccAWSRedshiftCluster_iamRoles
=== CONT  TestAccAWSRedshiftCluster_changeAvailabilityZone
=== CONT  TestAccAWSRedshiftCluster_loggingEnabled
=== CONT  TestAccAWSRedshiftCluster_forceNewUsername
=== CONT  TestAccAWSRedshiftCluster_snapshotCopy
--- PASS: TestAccAWSRedshiftCluster_basic (816.47s)
=== CONT  TestAccAWSRedshiftCluster_tags
--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (841.34s)
=== CONT  TestAccAWSRedshiftCluster_updateNodeType
--- PASS: TestAccAWSRedshiftCluster_loggingEnabled (1035.05s)
=== CONT  TestAccAWSRedshiftCluster_kmsKey
--- PASS: TestAccAWSRedshiftCluster_publiclyAccessible (1058.06s)
=== CONT  TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
--- PASS: TestAccAWSRedshiftCluster_tags (545.09s)
=== CONT  TestAccAWSRedshiftCluster_withFinalSnapshot
--- PASS: TestAccAWSRedshiftCluster_iamRoles (1435.67s)
--- PASS: TestAccAWSRedshiftCluster_changeAvailabilityZone (1654.82s)
--- PASS: TestAccAWSRedshiftCluster_changeEncryption1 (1666.13s)
--- PASS: TestAccAWSRedshiftCluster_changeEncryption2 (3640.62s)
--- PASS: TestAccAWSRedshiftCluster_updateNodeType (3116.47s)
=== CONT  TestAccAWSRedshiftCluster_updateNodeCount
    resource_aws_redshift_cluster_test.go:372: Step 2/2 error: Error running apply: exit status 1
        
        Error: Error Modifying Redshift Cluster (tf-redshift-cluster-6386239506091456576): timeout while waiting for state to become 'available' (last state: 'resizing', timeout: 1h15m0s)
        
          with aws_redshift_cluster.default,
          on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "default":
          12: resource "aws_redshift_cluster" "default" {
        
=== CONT  TestAccAWSRedshiftCluster_kmsKey
    resource_aws_redshift_cluster_test.go:150: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error waiting for Redshift Cluster state to be "available": timeout while waiting for state to become 'available' (last state: 'creating', timeout: 1h15m0s)
        
          with aws_redshift_cluster.default,
          on terraform_plugin_test.tf line 34, in resource "aws_redshift_cluster" "default":
          34: resource "aws_redshift_cluster" "default" {
        
=== CONT  TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
    resource_aws_redshift_cluster_test.go:186: Step 1/3 error: Error running apply: exit status 1
        
        Error: Error waiting for Redshift Cluster state to be "available": timeout while waiting for state to become 'available' (last state: 'creating', timeout: 1h15m0s)
        
          with aws_redshift_cluster.default,
          on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "default":
          12: resource "aws_redshift_cluster" "default" {
        
=== CONT  TestAccAWSRedshiftCluster_forceNewUsername
    resource_aws_redshift_cluster_test.go:484: Step 2/2 error: Error running apply: exit status 1
        
        Error: Error waiting for Redshift Cluster state to be "available": timeout while waiting for state to become 'available' (last state: 'creating', timeout: 1h15m0s)
        
          with aws_redshift_cluster.default,
          on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "default":
          12: resource "aws_redshift_cluster" "default" {
        
=== CONT  TestAccAWSRedshiftCluster_withFinalSnapshot
    resource_aws_redshift_cluster_test.go:116: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error waiting for Redshift Cluster state to be "available": timeout while waiting for state to become 'available' (last state: 'creating', timeout: 1h15m0s)
        
          with aws_redshift_cluster.default,
          on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "default":
          12: resource "aws_redshift_cluster" "default" {
        
=== CONT  TestAccAWSRedshiftCluster_updateNodeCount
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Redshift Cluster (tf-redshift-cluster-6386239506091456576): InvalidClusterState: Unable to delete the cluster tf-redshift-cluster-6386239506091456576. You can only delete clusters with ACTIVE, INCOMPATIBLE_NETWORK, INCOMPATIBLE_HSM, INCOMPATIBLE_RESTORE, INSUFFICIENT_CAPACITY, or HARDWARE_FAILURE lifecycle.
        	status code: 400, request id: 835907d5-cd54-4cda-93c1-5c8772baa19f
        
--- FAIL: TestAccAWSRedshiftCluster_updateNodeCount (6162.25s)
=== CONT  TestAccAWSRedshiftCluster_kmsKey
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Redshift Cluster (tf-redshift-cluster-3716214157216610256): InvalidClusterState: There is an operation running on the Cluster. Please try to delete it at a later time.
        	status code: 400, request id: cc964296-b7da-4748-a9af-f21d7d06f3b5
        
--- FAIL: TestAccAWSRedshiftCluster_kmsKey (5416.28s)
=== CONT  TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Redshift Cluster (tf-redshift-cluster-1978287369461619161): InvalidClusterState: There is an operation running on the Cluster. Please try to delete it at a later time.
        	status code: 400, request id: 9df93ac9-50df-4811-9a12-0ec0e833c4e8
        
--- FAIL: TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled (5407.58s)
=== CONT  TestAccAWSRedshiftCluster_forceNewUsername
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Redshift Cluster (tf-redshift-cluster-8343179712699957379): InvalidClusterState: There is an operation running on the Cluster. Please try to delete it at a later time.
        	status code: 400, request id: 6fed3058-75e4-4fde-b84d-807f4a30cc4f
        
--- FAIL: TestAccAWSRedshiftCluster_forceNewUsername (6555.76s)
=== CONT  TestAccAWSRedshiftCluster_withFinalSnapshot
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting Redshift Cluster (tf-redshift-cluster-6354952670254163188): InvalidClusterState: There is an operation running on the Cluster. Please try to delete it at a later time.
        	status code: 400, request id: f066c766-dea9-4df8-a490-2857bcbf26e8
        
--- FAIL: TestAccAWSRedshiftCluster_withFinalSnapshot (5407.84s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	6774.708s

Failures are unrelated to this change and are occurring in nightly CI.

@ewbankkit
Copy link
Contributor

@russellsherman Thanks for the contribution 🎉 👏.
In order to get this merged quicker I went ahead and made some changes:

  • Instead of a cluster_node_ips list of strings we now have a cluster_nodes list of objects that has node type, private and public IP address fields

@ewbankkit ewbankkit merged commit 72755fa into hashicorp:main Aug 31, 2021
@github-actions github-actions bot added this to the v3.57.0 milestone Aug 31, 2021
@russellsherman
Copy link
Contributor Author

@ewbankkit Many thanks for this 🙇

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

This functionality has been released in v3.57.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2022
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. enhancement Requests to existing resources that expand the functionality or scope. service/redshift Issues and PRs that pertain to the redshift 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.

Support for exporting Redshift cluster nodes and/or IP addresses
7 participants