provider/aws: Guard against Nil Reference in Redshift Endpoints
This commit is contained in:
parent
38ab16a6b5
commit
66eb7c6055
|
@ -317,7 +317,13 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er
|
||||||
d.Set("encrypted", rsc.Encrypted)
|
d.Set("encrypted", rsc.Encrypted)
|
||||||
d.Set("automated_snapshot_retention_period", rsc.AutomatedSnapshotRetentionPeriod)
|
d.Set("automated_snapshot_retention_period", rsc.AutomatedSnapshotRetentionPeriod)
|
||||||
d.Set("preferred_maintenance_window", rsc.PreferredMaintenanceWindow)
|
d.Set("preferred_maintenance_window", rsc.PreferredMaintenanceWindow)
|
||||||
d.Set("endpoint", aws.String(fmt.Sprintf("%s:%d", *rsc.Endpoint.Address, *rsc.Endpoint.Port)))
|
if rsc.Endpoint != nil && rsc.Endpoint.Address != nil {
|
||||||
|
endpoint := *rsc.Endpoint.Address
|
||||||
|
if rsc.Endpoint.Port != nil {
|
||||||
|
endpoint = fmt.Sprintf("%s:%d", endpoint, *rsc.Endpoint.Port)
|
||||||
|
}
|
||||||
|
d.Set("endpoint", endpoint)
|
||||||
|
}
|
||||||
d.Set("cluster_parameter_group_name", rsc.ClusterParameterGroups[0].ParameterGroupName)
|
d.Set("cluster_parameter_group_name", rsc.ClusterParameterGroups[0].ParameterGroupName)
|
||||||
if len(rsc.ClusterNodes) > 1 {
|
if len(rsc.ClusterNodes) > 1 {
|
||||||
d.Set("cluster_type", "multi-node")
|
d.Set("cluster_type", "multi-node")
|
||||||
|
|
Loading…
Reference in New Issue