Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Data Source: azurerm_automation_variables #22216

Merged
merged 5 commits into from
Jul 3, 2023

Conversation

oWretch
Copy link
Contributor

@oWretch oWretch commented Jun 20, 2023

Create a data resource for fetching all the variables in an automation account. Modelled after azurerm_key_vault_secrets.

--- PASS: TestAccDataSourceAzureRMAutomationVariables_basic (143.66s)

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @oWretch.

I have a few suggestions and questions which need looking over. Once those are resolved I can proceed with my review.

I also wanted to call out that all new resources and data sources should be typed (this was copied from an untyped data source within the provider). We have some contributor docs on what that means here, there are also guides in that folder on how to write typed resources/data sources.

For the moment this is fine, but just something to keep in mind for any future resources/data sources you choose to contribute here - having them typed would help us out a lot!

},
},

"null": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What variable type is this? I don't see a resource for this variable type - so in what cases would this be populated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Microsoft offer a null type variable in an automation account. Currently there is no TF resource for it, but it can be populated from the Azure portal. I added to this data source to try and get all the different variables that might be created available.

If we want consistency, I could add a resource for the null variable type so we can create them in TF.

Co-authored-by: stephybun <steph@hashicorp.com>
@oWretch
Copy link
Contributor Author

oWretch commented Jun 27, 2023

Updated based on comments.

=== RUN   TestAccDataSourceAzureRMAutomationVariables_basic
=== PAUSE TestAccDataSourceAzureRMAutomationVariables_basic
=== CONT  TestAccDataSourceAzureRMAutomationVariables_basic
--- PASS: TestAccDataSourceAzureRMAutomationVariables_basic (147.25s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/automation	148.565s

I'll try to update to be a typed source…

@oWretch
Copy link
Contributor Author

oWretch commented Jun 28, 2023

@stephybun I've converted to a typed data source now too

=== RUN   TestAccDataSourceAzureRMAutomationVariables_basic
=== PAUSE TestAccDataSourceAzureRMAutomationVariables_basic
=== CONT  TestAccDataSourceAzureRMAutomationVariables_basic
--- PASS: TestAccDataSourceAzureRMAutomationVariables_basic (147.31s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/automation	148.590s

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for converting this to a typed resource @oWretch! LGTM 🦆

@stephybun stephybun merged commit 33ab054 into hashicorp:main Jul 3, 2023
14 checks passed
@github-actions github-actions bot added this to the v3.64.0 milestone Jul 3, 2023
stephybun added a commit that referenced this pull request Jul 3, 2023
@oWretch oWretch deleted the f/aa-vars branch July 19, 2023 23:13
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants