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

Add managed_resources block to purview_account 14814 #14865

Merged
merged 5 commits into from
Jan 13, 2022

Conversation

Noel-Jones
Copy link
Contributor

Supports the managed_resource block requested in my enhancement resquest issue #14814

This is my first Terraform change therefore grateful for consideration in respect of any missed steps but hopefully I have covered it all!

With respect to the attribute names, I have kept them in sync with the Rest API - I considered it better to be in sync than to add "_id" to the attributes, however, I will do this if this is considered best practice for resource IDs. The documentation states that they are IDs.

Tested within our infrastructure, plan results in the following output against an existing resource and equivalent for a new resource.

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # azurerm_purview_account.purview_account has changed
  ~ resource "azurerm_purview_account" "purview_account" {
        id                                               = "/subscriptions/00000-0-0-00000/resourceGroups/rg-noel-jones/providers/Microsoft.Purview/accounts/purview-sandbox"
      + managed_resources                                = [
          + {
              + event_hub_namespace = "/subscriptions/00000-0-0-00000/resourceGroups/rg-purview-sandbox/providers/Microsoft.EventHub/namespaces/Atlas-00000-0-0-00000"
              + resource_group      = "/subscriptions/00000-0-0-00000/resourceGroups/rg-purview-sandbox"
              + storage_account     = "/subscriptions/00000-0-0-00000/resourceGroups/rg-purview-sandbox/providers/Microsoft.Storage/storageAccounts/scanuksouthhjswedh"
            },
        ]
        name                                             = "purview-sandbox"
        tags                                             = {}
        # (10 unchanged attributes hidden)
    }

Signed-off-by: Noel Jones [email protected]

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @Noel-Jones - LGTM 🏗️

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @Noel-Jones

Thanks for this PR - taking a look through here since these are all Resource IDs can we add an _id suffix to each of these fields, so that it's clear these are Resource IDs rather than the names?

Thanks!

internal/services/purview/purview_account_resource.go Outdated Show resolved Hide resolved
internal/services/purview/purview_account_resource.go Outdated Show resolved Hide resolved
website/docs/r/purview_account.html.markdown Outdated Show resolved Hide resolved
@Noel-Jones
Copy link
Contributor Author

Thanks for the reviews and suggestion. I have committed the suggestions and retested. All looks good.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @Noel-Jones - LGTM take 2 🚀🚀

@katbyte katbyte merged commit 22b0d1f into hashicorp:main Jan 13, 2022
@github-actions github-actions bot added this to the v2.92.0 milestone Jan 13, 2022
katbyte added a commit that referenced this pull request Jan 13, 2022
@github-actions
Copy link

This functionality has been released in v2.92.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
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 Feb 13, 2022
@Noel-Jones Noel-Jones deleted the purview-managed-resources-14814 branch November 2, 2022 19:14
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.

3 participants