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

provider/aws: Redshift Cluster: Fix for master_username & password #9837

Merged
merged 1 commit into from
Dec 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

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

master_password has Sensitive: true set, which should keep it's contents out of the logs. We should optionally pgp encrypt it in the state, like we been doing for some other resources

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