Skip to content

Commit

Permalink
Merge pull request #4582 from saravanan30erd/issue-4566
Browse files Browse the repository at this point in the history
 issue #4566 add new attribute dns_name in aws_redshift_cluster
  • Loading branch information
bflad authored May 23, 2018
2 parents 3410683 + 1b64763 commit c7df9c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws/resource_aws_redshift_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ func resourceAwsRedshiftCluster() *schema.Resource {
Computed: true,
},

"dns_name": {
Type: schema.TypeString,
Computed: true,
},

"cluster_public_key": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -567,6 +572,7 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er
if rsc.Endpoint.Port != nil {
endpoint = fmt.Sprintf("%s:%d", endpoint, *rsc.Endpoint.Port)
}
d.Set("dns_name", rsc.Endpoint.Address)
d.Set("port", rsc.Endpoint.Port)
d.Set("endpoint", endpoint)
}
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_redshift_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestAccAWSRedshiftCluster_basic(t *testing.T) {
"aws_redshift_cluster.default", "cluster_type", "single-node"),
resource.TestCheckResourceAttr(
"aws_redshift_cluster.default", "publicly_accessible", "true"),
resource.TestMatchResourceAttr("aws_redshift_cluster.default", "dns_name", regexp.MustCompile(fmt.Sprintf("^tf-redshift-cluster-%d.*\\.redshift\\..*", ri))),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/redshift_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The following attributes are exported:
* `encrypted` - Whether the data in the cluster is encrypted
* `cluster_security_groups` - The security groups associated with the cluster
* `vpc_security_group_ids` - The VPC security group Ids associated with the cluster
* `dns_name` - The DNS name of the cluster
* `port` - The Port the cluster responds on
* `cluster_version` - The version of Redshift engine software
* `cluster_parameter_group_name` - The name of the parameter group to be associated with this cluster
Expand Down

0 comments on commit c7df9c9

Please sign in to comment.