Skip to content

Commit

Permalink
Merge pull request #11041 from smelchior/master
Browse files Browse the repository at this point in the history
add support for ca_cert_identifier parameter for docdb
  • Loading branch information
gdavison authored Nov 28, 2019
2 parents 60db856 + af03f9e commit 71f1f57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions aws/resource_aws_docdb_cluster_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ func resourceAwsDocDBClusterInstance() *schema.Resource {
Computed: true,
},

"ca_cert_identifier": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"tags": tagsSchema(),

"writer": {
Expand Down Expand Up @@ -306,6 +312,7 @@ func resourceAwsDocDBClusterInstanceRead(d *schema.ResourceData, meta interface{
d.Set("promotion_tier", db.PromotionTier)
d.Set("publicly_accessible", db.PubliclyAccessible)
d.Set("storage_encrypted", db.StorageEncrypted)
d.Set("ca_cert_identifier", db.CACertificateIdentifier)

if err := saveTagsDocDB(conn, d, aws.StringValue(db.DBInstanceArn)); err != nil {
return fmt.Errorf("error setting tags: %s", err)
Expand Down Expand Up @@ -346,6 +353,12 @@ func resourceAwsDocDBClusterInstanceUpdate(d *schema.ResourceData, meta interfac
requestUpdate = true
}

if d.HasChange("ca_cert_identifier") {
d.SetPartial("ca_cert_identifier")
req.CACertificateIdentifier = aws.String(d.Get("ca_cert_identifier").(string))
requestUpdate = true
}

log.Printf("[DEBUG] Send DB Instance Modification request: %#v", requestUpdate)
if requestUpdate {
log.Printf("[DEBUG] DB Instance Modification request: %#v", req)
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_docdb_cluster_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestAccAWSDocDBClusterInstance_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "dbi_resource_id"),
resource.TestCheckResourceAttrSet(resourceName, "availability_zone"),
resource.TestCheckResourceAttrSet(resourceName, "engine_version"),
resource.TestCheckResourceAttrSet(resourceName, "ca_cert_identifier"),
resource.TestCheckResourceAttr(resourceName, "engine", "docdb"),
),
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/docdb_cluster_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ In addition to all arguments above, the following attributes are exported:
* `preferred_backup_window` - The daily time range during which automated backups are created if automated backups are enabled.
* `storage_encrypted` - Specifies whether the DB cluster is encrypted.
* `writer` – Boolean indicating if this instance is writable. `False` indicates this instance is a read replica.
* `ca_cert_identifier` - (Optional) The identifier of the CA certificate for the DB instance.

[1]: /docs/providers/aws/r/docdb_cluster.html
[2]: https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-manage-performance.html#db-cluster-manage-scaling-instance
Expand Down

0 comments on commit 71f1f57

Please sign in to comment.