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

resource/aws_elasticache_*: Allow port to be optional #3835

Merged
merged 3 commits into from
Mar 26, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 19, 2018

Closes #341 by returning the first CacheNode port if ConfigurationEndpoint is not available (e.g. on Redis). Utilizing DiffSuppressFunc here instead of Computed: true so the resources can properly detect any out-of-band change.

Test failure unrelated

Tests failed: 1 (1 new), passed: 32
=== RUN   TestAccAWSElasticacheParameterGroup_only
--- PASS: TestAccAWSElasticacheParameterGroup_only (7.89s)
=== RUN   TestAccAWSElasticacheParameterGroup_importBasic
--- PASS: TestAccAWSElasticacheParameterGroup_importBasic (7.94s)
=== RUN   TestAccAWSElasticacheParameterGroup_UppercaseName
--- PASS: TestAccAWSElasticacheParameterGroup_UppercaseName (8.21s)
=== RUN   TestAccAWSElasticacheParameterGroup_basic
--- PASS: TestAccAWSElasticacheParameterGroup_basic (21.57s)
=== RUN   TestAccAWSElasticacheSubnetGroup_importBasic
--- PASS: TestAccAWSElasticacheSubnetGroup_importBasic (22.12s)
=== RUN   TestAccAWSElasticacheParameterGroup_removeParam
--- PASS: TestAccAWSElasticacheParameterGroup_removeParam (31.24s)
=== RUN   TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (22.15s)
=== RUN   TestAccAWSElasticacheCluster_Port_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Port_Ec2Classic (524.59s)
=== RUN   TestAccAWSElasticacheCluster_SecurityGroup
--- PASS: TestAccAWSElasticacheCluster_SecurityGroup (561.35s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic (566.30s)
=== RUN   TestAccAWSElasticacheSecurityGroup_basic
--- PASS: TestAccAWSElasticacheSecurityGroup_basic (14.64s)
=== RUN   TestAccAWSElasticacheSecurityGroup_Import
--- PASS: TestAccAWSElasticacheSecurityGroup_Import (16.32s)
=== RUN   TestAccAWSElasticacheSubnetGroup_basic
--- PASS: TestAccAWSElasticacheSubnetGroup_basic (8.88s)
=== RUN   TestAccAWSElasticacheSubnetGroup_update
--- PASS: TestAccAWSElasticacheSubnetGroup_update (16.31s)
=== RUN   TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_vpc (798.60s)
=== RUN   TestAccAWSElasticacheReplicationGroup_vpc
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (1076.66s)
=== RUN   TestAccAWSElasticacheReplicationGroup_basic
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (1092.30s)
=== RUN   TestAccAWSElasticacheCluster_multiAZInVpc
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (1151.74s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic (1180.64s)
=== RUN   TestAccAWSElasticacheReplicationGroup_Uppercase
--- PASS: TestAccAWSElasticacheReplicationGroup_Uppercase (1218.43s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption (828.27s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption (827.28s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateParameterGroup
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup (1385.35s)
=== RUN   TestAccAWSElasticacheReplicationGroup_nativeRedisCluster
--- PASS: TestAccAWSElasticacheReplicationGroup_nativeRedisCluster (1375.71s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow
--- PASS: TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow (1477.35s)
=== RUN   TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2
--- PASS: TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2 (1508.37s)
=== RUN   TestAccAWSElasticacheReplicationGroup_importBasic
--- PASS: TestAccAWSElasticacheReplicationGroup_importBasic (1572.59s)
=== RUN   TestAccAWSElasticacheCluster_snapshotsWithUpdates
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (1581.87s)
=== RUN   TestAccAWSElasticacheReplicationGroup_multiAzInVpc
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (1663.24s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (1737.07s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateNodeSize
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (1846.35s)
=== RUN   TestAccAWSElasticacheCluster_decreasingCacheNodes
--- PASS: TestAccAWSElasticacheCluster_decreasingCacheNodes (1912.24s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateDescription
--- FAIL: TestAccAWSElasticacheReplicationGroup_updateDescription (3012.23s)
    testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_elasticache_replication_group.bar: 1 error(s) occurred:
        
        * aws_elasticache_replication_group.bar: Error waiting for elasticache replication group (tf-creoirx98j) to be created: timeout while waiting for state to become 'available' (last state: 'creating', timeout: 50m0s)

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. labels Mar 19, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 19, 2018
@bflad bflad requested review from radeksimko and a team March 21, 2018 01:36
resource.TestCheckResourceAttr(resourceName, "port", strconv.Itoa(port)),
),
},
resource.TestStep{
Copy link
Contributor

Choose a reason for hiding this comment

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

This prefix is implied (like the one above), just need the open bracket: {

resource.TestCheckResourceAttr(resourceName, "port", "6379"),
),
},
resource.TestStep{
Copy link
Contributor

Choose a reason for hiding this comment

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

This prefix is implied in a slice, just {

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 21, 2018
@bflad bflad requested a review from paultyng March 21, 2018 15:10
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 21, 2018
@bflad
Copy link
Contributor Author

bflad commented Mar 21, 2018

Updated tests (failures unrelated):

 Tests failed: 2 (2 new), passed: 38
=== RUN   TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic (3.35s)
=== RUN   TestAccAWSElasticacheParameterGroup_only
--- PASS: TestAccAWSElasticacheParameterGroup_only (8.50s)
=== RUN   TestAccAWSElasticacheParameterGroup_importBasic
--- PASS: TestAccAWSElasticacheParameterGroup_importBasic (8.62s)
=== RUN   TestAccAWSElasticacheSubnetGroup_importBasic
--- PASS: TestAccAWSElasticacheSubnetGroup_importBasic (10.83s)
=== RUN   TestAccAWSElasticacheParameterGroup_UppercaseName
--- PASS: TestAccAWSElasticacheParameterGroup_UppercaseName (8.64s)
=== RUN   TestAccAWSElasticacheParameterGroup_basic
--- PASS: TestAccAWSElasticacheParameterGroup_basic (17.40s)
=== RUN   TestAccAWSElasticacheParameterGroup_removeParam
--- PASS: TestAccAWSElasticacheParameterGroup_removeParam (27.07s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic (492.75s)
=== RUN   TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic (493.44s)
=== RUN   TestAccAWSElasticacheCluster_Port_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Port_Ec2Classic (503.55s)
=== RUN   TestAccAWSElasticacheCluster_SecurityGroup
--- PASS: TestAccAWSElasticacheCluster_SecurityGroup (518.40s)
=== RUN   TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic (545.63s)
=== RUN   TestAccAWSElasticacheCluster_AZMode_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_AZMode_Memcached_Ec2Classic (599.44s)
=== RUN   TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError
--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (6.76s)
=== RUN   TestAccAWSElasticacheReplicationGroup_Uppercase
--- PASS: TestAccAWSElasticacheReplicationGroup_Uppercase (648.46s)
=== RUN   TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_vpc (677.29s)
=== RUN   TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic (743.67s)
=== RUN   TestAccAWSElasticacheSecurityGroup_basic
--- PASS: TestAccAWSElasticacheSecurityGroup_basic (14.69s)
=== RUN   TestAccAWSElasticacheSecurityGroup_Import
--- PASS: TestAccAWSElasticacheSecurityGroup_Import (16.00s)
=== RUN   TestAccAWSElasticacheSubnetGroup_basic
--- PASS: TestAccAWSElasticacheSubnetGroup_basic (8.94s)
=== RUN   TestAccAWSElasticacheSubnetGroup_update
--- PASS: TestAccAWSElasticacheSubnetGroup_update (16.85s)
=== RUN   TestAccAWSElasticacheCluster_multiAZInVpc
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (900.20s)
=== RUN   TestAccAWSElasticacheReplicationGroup_basic
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (965.50s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow
--- PASS: TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow (997.90s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateDescription
--- PASS: TestAccAWSElasticacheReplicationGroup_updateDescription (1010.33s)
=== RUN   TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic (1056.56s)
=== RUN   TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic (1145.69s)
=== RUN   TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic
--- PASS: TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic (1156.07s)
=== RUN   TestAccAWSElasticacheCluster_decreasingCacheNodes
--- PASS: TestAccAWSElasticacheCluster_decreasingCacheNodes (1167.01s)
=== RUN   TestAccAWSElasticacheReplicationGroup_vpc
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (878.35s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption (778.21s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (903.67s)
=== RUN   TestAccAWSElasticacheCluster_snapshotsWithUpdates
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (1519.47s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateParameterGroup
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup (1040.14s)
=== RUN   TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption (970.27s)
=== RUN   TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2
--- FAIL: TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2 (1240.07s)
    testing.go:518: Step 0 error: After applying this step, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_security_group.bar
          ingress.#:                             "0" => "1"
          ingress.1799340084.cidr_blocks.#:      "0" => "1"
          ingress.1799340084.cidr_blocks.0:      "" => "0.0.0.0/0"
          ingress.1799340084.description:        "" => ""
          ingress.1799340084.from_port:          "" => "-1"
          ingress.1799340084.ipv6_cidr_blocks.#: "0" => "0"
          ingress.1799340084.protocol:           "" => "icmp"
          ingress.1799340084.security_groups.#:  "0" => "0"
          ingress.1799340084.self:               "" => "false"
          ingress.1799340084.to_port:            "" => "-1"
=== RUN   TestAccAWSElasticacheReplicationGroup_updateNodeSize
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (1730.17s)
=== RUN   TestAccAWSElasticacheReplicationGroup_nativeRedisCluster
--- PASS: TestAccAWSElasticacheReplicationGroup_nativeRedisCluster (1284.94s)
=== RUN   TestAccAWSElasticacheReplicationGroup_multiAzInVpc
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (1382.88s)
=== RUN   TestAccAWSElasticacheReplicationGroup_importBasic
--- FAIL: TestAccAWSElasticacheReplicationGroup_importBasic (3011.92s)
    testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_elasticache_replication_group.bar: 1 error(s) occurred:
        
        * aws_elasticache_replication_group.bar: Error waiting for elasticache replication group (tf-vmbq0hni0b) to be created: timeout while waiting for state to become 'available' (last state: 'creating', timeout: 50m0s)

@bflad bflad requested a review from a team March 21, 2018 20:58
@bflad bflad added this to the v1.13.0 milestone Mar 26, 2018
@bflad bflad merged commit 2ac0b83 into master Mar 26, 2018
@bflad bflad deleted the f-aws_elasticache-optional-port branch March 26, 2018 13:53
bflad added a commit that referenced this pull request Mar 26, 2018
@bflad
Copy link
Contributor Author

bflad commented Mar 29, 2018

This has been released in version 1.13.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 7, 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 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imported state for aws_elasticache_cluster causes a problem with the port field
3 participants