hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.62k forks source link

Implement data source for azurerm_automation_dsc_configuration_metadata #2162

Closed bastienfrancheteau closed 4 years ago

bastienfrancheteau commented 5 years ago

Community Note

When registering a VM as a DSC node, the Automation Account's key and DSC Registration URL values are required. These cannot be retrieved in Terraform. Creating an azurerm_automation_dsc_configuration_metadata module that returns these 2 values would enable us to dynamically register Azure VMs as DSC nodes.

Suggested name for new data source: azurerm_automation_dsc_configuration_metadata

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

whytoe commented 5 years ago

The resource already supports outputting the Primary Key/DSC Server Endpoint https://www.terraform.io/docs/providers/azurerm/r/automation_account.html

Is there a blocker for this? @tombuildsstuff

whytoe commented 4 years ago

@bastienfrancheteau were you able to find another solution other than use powershell?

@tombuildsstuff does the GoSDK support this now, its been almost a year

It is available in powershell

PS C:\WINDOWS\system32> $data = Get-AzAutomationRegistrationInfo -ResourceGroupName resourcegroup -AutomationAccountName AutomationAccount

ResourceGroupName     : resourcegroup
AutomationAccountName : AutomationAccount
PrimaryKey            : PrimaryKey            
SecondaryKey          : SecondaryKey
Endpoint              : https://cc-agentservice-prod-1.azure-automation.net/accounts/guid
mbfrahry commented 4 years ago

It looks like this issue is resolved through the #4740 that @whytoe created. That should go out in 1.37.0 of the provider. Feel free to create a new issue if more work needs to be done here.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!