Skip to content

Commit

Permalink
Making the Source Resource ID computed
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jan 24, 2018
1 parent 09cd25d commit d46a134
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions azurerm/resource_arm_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func resourceArmSnapshot() *schema.Resource {
"source_resource_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},

Expand Down Expand Up @@ -172,16 +173,16 @@ func resourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error {
if data := props.CreationData; data != nil {
d.Set("create_option", string(data.CreateOption))

if data.SourceURI != nil {
d.Set("source_uri", data.SourceURI)
if uri := data.SourceURI; uri != nil {
d.Set("source_uri", uri)
}

if data.SourceResourceID != nil {
d.Set("source_resource_id", data.SourceResourceID)
if resourceId := data.SourceResourceID; resourceId != nil {
d.Set("source_resource_id", resourceId)
}

if data.StorageAccountID != nil {
d.Set("storage_account_id", *data.StorageAccountID)
if accountId := data.StorageAccountID; accountId != nil {
d.Set("storage_account_id", accountId)
}
}

Expand Down

0 comments on commit d46a134

Please sign in to comment.