Skip to content

Commit

Permalink
Merge pull request #9837 from Ninir/redshift_cluster_password
Browse files Browse the repository at this point in the history
provider/aws: Redshift Cluster: Fix for master_username & password
  • Loading branch information
catsby authored Dec 16, 2016
2 parents 7995875 + c250c10 commit 7711952
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions builtin/providers/aws/resource_aws_redshift_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@ func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{})
d.SetId(*resp.Cluster.ClusterIdentifier)

} else {
if _, ok := d.GetOk("master_password"); !ok {
return fmt.Errorf(`provider.aws: aws_redshift_cluster: %s: "master_password": required field is not set`, d.Get("cluster_identifier").(string))
}

if _, ok := d.GetOk("master_username"); !ok {
return fmt.Errorf(`provider.aws: aws_redshift_cluster: %s: "master_username": required field is not set`, d.Get("cluster_identifier").(string))
}

createOpts := &redshift.CreateClusterInput{
ClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)),
Port: aws.Int64(int64(d.Get("port").(int))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ string.
If you do not provide a name, Amazon Redshift will create a default database called `dev`.
* `node_type` - (Required) The node type to be provisioned for the cluster.
* `cluster_type` - (Optional) The cluster type to use. Either `single-node` or `multi-node`.
* `master_password` - (Required) Password for the master DB user. Note that this may
show up in logs, and it will be stored in the state file. Password must contain at least 8 chars and
* `master_password` - (Required unless a `snapshot_identifier` is provided) Password for the master DB user.
Note that this may show up in logs, and it will be stored in the state file. Password must contain at least 8 chars and
contain at least one uppercase letter, one lowercase letter, and one number.
* `master_username` - (Required) Username for the master DB user
* `master_username` - (Required unless a `snapshot_identifier` is provided) Username for the master DB user.

* `cluster_security_groups` - (Optional) A list of security groups to be associated with this cluster.
* `vpc_security_group_ids` - (Optional) A list of Virtual Private Cloud (VPC) security groups to be associated with the cluster.
* `cluster_subnet_group_name` - (Optional) The name of a cluster subnet group to be associated with this cluster. If this parameter is not provided the resulting cluster will be deployed outside virtual private cloud (VPC).
Expand Down

0 comments on commit 7711952

Please sign in to comment.