Skip to content

Commit

Permalink
azurerm_automation_account - support for the hybrid_service_url p…
Browse files Browse the repository at this point in the history
…roperty (#18320)

Co-authored-by: Xu Wu <xuwu1@microsoft.com>
  • Loading branch information
wuxu92 and wuxu92 authored Sep 13, 2022
1 parent 74c225d commit 1b35e60
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func dataSourceAutomationAccount() *pluginsdk.Resource {
},
},
},

"hybrid_service_url": {
Type: pluginsdk.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -94,6 +99,7 @@ func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}
d.Set("endpoint", iresp.Endpoint)
if resp.Model != nil && resp.Model.Properties != nil {
d.Set("private_endpoint_connection", flattenPrivateEndpointConnections(resp.Model.Properties.PrivateEndpointConnections))
d.Set("hybrid_service_url", resp.Model.Properties.AutomationHybridServiceUrl)
}
return nil
}
Expand Down
12 changes: 12 additions & 0 deletions internal/services/automation/automation_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,25 @@ func resourceAutomationAccount() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Computed: true,
},

"dsc_primary_access_key": {
Type: pluginsdk.TypeString,
Computed: true,
Sensitive: true,
},

"dsc_secondary_access_key": {
Type: pluginsdk.TypeString,
Computed: true,
Sensitive: true,
},

"public_network_access_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: true,
},

"private_endpoint_connection": {
Type: pluginsdk.TypeList,
Computed: true,
Expand All @@ -129,13 +133,19 @@ func resourceAutomationAccount() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Computed: true,
},

"id": {
Type: pluginsdk.TypeString,
Computed: true,
},
},
},
},

"hybrid_service_url": {
Type: pluginsdk.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -313,6 +323,8 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{})
d.Set("dsc_secondary_access_key", keys.Secondary)
}

d.Set("hybrid_service_url", prop.AutomationHybridServiceUrl)

identity, err := identity.FlattenSystemAndUserAssignedMap(resp.Model.Identity)
if err != nil {
return fmt.Errorf("flattening `identity`: %+v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func TestAccAutomationAccount_basic(t *testing.T) {
check.That(data.ResourceName).Key("dsc_server_endpoint").Exists(),
check.That(data.ResourceName).Key("dsc_primary_access_key").Exists(),
check.That(data.ResourceName).Key("dsc_secondary_access_key").Exists(),
check.That(data.ResourceName).Key("hybrid_service_url").Exists(),
),
},
data.ImportStep(),
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/automation_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ output "automation_account_id" {

* `endpoint` - The Endpoint for this Automation Account.

* `hybrid_service_url` - The URL of automation hybrid service which is used for hybrid worker on-boarding With this Automation Account.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions:
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/automation_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The following attributes are exported:

* `dsc_secondary_access_key` - The Secondary Access Key for the DSC Endpoint associated with this Automation Account.

* `hybrid_service_url` - The URL of automation hybrid service which is used for hybrid worker on-boarding With this Automation Account.
---

An `identity` block exports the following:
Expand Down

0 comments on commit 1b35e60

Please sign in to comment.