provider/aws: Support for Redshift Cluster encryption using a KMS key (#6712)

This commit is contained in:
Robert Conrad 2016-05-17 18:12:39 +02:00 committed by Clint
parent 91a1097041
commit faa6ddb2ee
2 changed files with 17 additions and 4 deletions

View File

@ -154,6 +154,13 @@ func resourceAwsRedshiftCluster() *schema.Resource {
Computed: true, Computed: true,
}, },
"kms_key_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"elastic_ip": &schema.Schema{ "elastic_ip": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
@ -244,6 +251,10 @@ func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{})
createOpts.Encrypted = aws.Bool(v.(bool)) createOpts.Encrypted = aws.Bool(v.(bool))
} }
if v, ok := d.GetOk("kms_key_id"); ok {
createOpts.KmsKeyId = aws.String(v.(string))
}
if v, ok := d.GetOk("elastic_ip"); ok { if v, ok := d.GetOk("elastic_ip"); ok {
createOpts.ElasticIp = aws.String(v.(string)) createOpts.ElasticIp = aws.String(v.(string))
} }
@ -311,6 +322,7 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er
d.Set("cluster_subnet_group_name", rsc.ClusterSubnetGroupName) d.Set("cluster_subnet_group_name", rsc.ClusterSubnetGroupName)
d.Set("availability_zone", rsc.AvailabilityZone) d.Set("availability_zone", rsc.AvailabilityZone)
d.Set("encrypted", rsc.Encrypted) d.Set("encrypted", rsc.Encrypted)
d.Set("kms_key_id", rsc.KmsKeyId)
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)
if rsc.Endpoint != nil && rsc.Endpoint.Address != nil { if rsc.Endpoint != nil && rsc.Endpoint.Address != nil {

View File

@ -52,6 +52,7 @@ string.
* `number_of_nodes` - (Optional) The number of compute nodes in the cluster. This parameter is required when the ClusterType parameter is specified as multi-node. Default is 1. * `number_of_nodes` - (Optional) The number of compute nodes in the cluster. This parameter is required when the ClusterType parameter is specified as multi-node. Default is 1.
* `publicly_accessible` - (Optional) If true, the cluster can be accessed from a public network. Default is `true`. * `publicly_accessible` - (Optional) If true, the cluster can be accessed from a public network. Default is `true`.
* `encrypted` - (Optional) If true , the data in the cluster is encrypted at rest. * `encrypted` - (Optional) If true , the data in the cluster is encrypted at rest.
* `kms_key_id` - (Optional) The KMS key ID for the cluster.
* `elastic_ip` - (Optional) The Elastic IP (EIP) address for the cluster. * `elastic_ip` - (Optional) The Elastic IP (EIP) address for the cluster.
* `skip_final_snapshot` - (Optional) Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If true , a final cluster snapshot is not created. If false , a final cluster snapshot is created before the cluster is deleted. Default is true. * `skip_final_snapshot` - (Optional) Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If true , a final cluster snapshot is not created. If false , a final cluster snapshot is created before the cluster is deleted. Default is true.
* `final_snapshot_identifier` - (Optional) The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, `skip_final_snapshot` must be false. * `final_snapshot_identifier` - (Optional) The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, `skip_final_snapshot` must be false.