Skip to content

Commit

Permalink
HUBS-2080 - changes to rename source_id to sourece_value as we suppor…
Browse files Browse the repository at this point in the history
…t both id/name in input and persist the same source_value as user inout and keep the source_id as recieved from dct response
  • Loading branch information
ankit-patil-hubs committed Oct 18, 2023
1 parent 2f9a77d commit ce16570
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/resources/appdata_dsource.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ resource "delphix_appdata_dsource" "dsource_name" {

## Argument Reference

* `source_id` - (Required) Id of the source to link.
* `source_value` - (Required) Id or Name of the source to link.

* `group_id` - (Required) Id of the dataset group where this dSource should belong to.

Expand Down
4 changes: 2 additions & 2 deletions examples/dsource/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ provider "delphix" {


# resource "delphix_appdata_dsource" "test_app_data_dsource" {
# source_id = "1-APPDATA_STAGED_SOURCE_CONFIG-6"
# source_name = "1-APPDATA_STAGED_SOURCE_CONFIG-6"
# group_id = "1-GROUP-1"
# log_sync_enabled = false
# make_current_account_owner = true
Expand Down Expand Up @@ -52,7 +52,7 @@ provider "delphix" {
# }

resource "delphix_appdata_dsource" "test_app_data_dsource_second" {
source_id = "1-APPDATA_STAGED_SOURCE_CONFIG-7"
source_name = "1-APPDATA_STAGED_SOURCE_CONFIG-7"
group_id = "1-GROUP-1"
log_sync_enabled = false
make_current_account_owner = true
Expand Down
8 changes: 6 additions & 2 deletions internal/provider/resource_appdata_dsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func resourceAppdataDsource() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"source_id": {
"source_value": {
Type: schema.TypeString,
Required: true,
},
Expand Down Expand Up @@ -250,6 +250,10 @@ func resourceAppdataDsource() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"source_id": {
Type: schema.TypeString,
Computed: true,
},
"database_type": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -390,7 +394,7 @@ func resourceAppdataDsourceCreate(ctx context.Context, d *schema.ResourceData, m
if v, has_v := d.GetOk("name"); has_v {
appDataDSourceLinkSourceParameters.SetName(v.(string))
}
if v, has_v := d.GetOk("source_id"); has_v {
if v, has_v := d.GetOk("source_value"); has_v {
appDataDSourceLinkSourceParameters.SetSourceId(v.(string))
}
if v, has_v := d.GetOk("group_id"); has_v {
Expand Down

0 comments on commit ce16570

Please sign in to comment.