From 60158742737216bd5cb0ce49be92a0eeb6665f59 Mon Sep 17 00:00:00 2001 From: clint shryock Date: Thu, 3 Dec 2015 10:48:34 -0600 Subject: [PATCH] providers/aws: Update DB Replica to honor storage type DB Replica can be of a different storage type, but we were skipping that part. Note that they are created as the default (or as the primary?) initially, and then modified to be of the correct type --- builtin/providers/aws/resource_aws_db_instance.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go index 3e9cb9d80..c078b5791 100644 --- a/builtin/providers/aws/resource_aws_db_instance.go +++ b/builtin/providers/aws/resource_aws_db_instance.go @@ -290,6 +290,10 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error opts.AvailabilityZone = aws.String(attr.(string)) } + if attr, ok := d.GetOk("storage_type"); ok { + opts.StorageType = aws.String(attr.(string)) + } + if attr, ok := d.GetOk("publicly_accessible"); ok { opts.PubliclyAccessible = aws.Bool(attr.(bool)) } @@ -297,6 +301,8 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error if attr, ok := d.GetOk("db_subnet_group_name"); ok { opts.DBSubnetGroupName = aws.String(attr.(string)) } + + log.Printf("[DEBUG] DB Instance Replica create configuration: %#v", opts) _, err := conn.CreateDBInstanceReadReplica(&opts) if err != nil { return fmt.Errorf("Error creating DB Instance: %s", err)