Skip to content

Commit

Permalink
Fix #960
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviGopal authored and hkantare committed Jan 28, 2020
1 parent 1d78c34 commit 70f32c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ibm/resource_ibm_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ func resourceIBMDatabaseInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"remote_leader_id": {
Description: "The CRN of leader database",
Type: schema.TypeString,
Optional: true,
},
"key_protect_instance": {
Description: "The CRN of Key protect instance",
Type: schema.TypeString,
Expand Down Expand Up @@ -459,6 +464,7 @@ type Params struct {
KeyProtectInstance string `json:"key_protect_instance,omitempty"`
ServiceEndpoints string `json:"service-endpoints,omitempty"`
BackupID string `json:"backup-id,omitempty"`
RemoteLeaderID string `json:"remote_leader_id,omitempty"`
}

// Replace with func wrapper for resourceIBMResourceInstanceCreate specifying serviceName := "database......."
Expand Down Expand Up @@ -552,6 +558,9 @@ func resourceIBMDatabaseInstanceCreate(d *schema.ResourceData, meta interface{})
if backupID, ok := d.GetOk("backup_id"); ok {
params.BackupID = backupID.(string)
}
if remoteLeader, ok := d.GetOk("remote_leader_id"); ok {
params.RemoteLeaderID = remoteLeader.(string)
}
serviceEndpoint := d.Get("service_endpoints").(string)
params.ServiceEndpoints = serviceEndpoint
parameters, _ := json.Marshal(params)
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/database.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ The following arguments are supported:
* `members_disk_allocation_mb` - (Optional) The disk size of the database, split across all members. As above.
* `members_cpu_allocation_count` - (Optional, int) Enables and allocates the number of specified dedicated cores to your deployment.
* `backup_id` - (Optional, string) A CRN of a backup resource to restore from. The backup must have been created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:<...>:backup:<uuid>. If omitted, the database is provisioned empty.
* `remote_leader_id` - (Optional, string) A CRN of the leader database to make the replica(read-only) deployment. The leader database must have been created by a database deployment with the same service ID. A read-only replica is set up to replicate all of your data from the leader deployment to the replica deployment using asynchronous replication. See the documentation related to Read-only Replicas here. https://cloud.ibm.com/docs/services/databases-for-postgresql?topic=databases-for-postgresql-read-only-replicas
* `key_protect_key` - (Optional, string) The CRN of a Key Protect key, which is then used for disk encryption. A key protect CRN is in the format crn:v1:<...>:key:<id>.
* `key_protect_instance` - (Optional, string) The CRN of a Key Protect instance, which is then used for disk encryption. A key protect CRN is in the format crn:v1:<...>::.
* `service_endpoints` - (Optional, string) Selects the types Service Endpoints supported on your deployment. Options are public, private, or public-and-private. The default is `public`.
Expand Down

0 comments on commit 70f32c2

Please sign in to comment.