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

Adding identity block to azurerm_logic_app_workflow data source #14896

Merged
merged 8 commits into from
Jan 17, 2022
Merged

Adding identity block to azurerm_logic_app_workflow data source #14896

merged 8 commits into from
Jan 17, 2022

Conversation

heoelri
Copy link
Contributor

@heoelri heoelri commented Jan 11, 2022

This PR adds an identity block to the azurerm_logic_app_workflow data source as requested in issue #14876 (@rikribbers).

resource "azurerm_resource_group" "example" {
  name     = "issue14876"
  location = "North Europe"
}

data "azurerm_client_config" "client" {} 

resource "azurerm_logic_app_workflow" "example" {
  name                = "workflow1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  identity {
      type = "SystemAssigned"
  }
}

data "azurerm_logic_app_workflow" "example" {
  name                = azurerm_logic_app_workflow.example.name
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_role_assignment" "reader" {
  scope                = "/subscriptions/${data.azurerm_client_config.client.subscription_id}"
  role_definition_name = "Reader"
  principal_id         = data.azurerm_logic_app_workflow.example.identity.0.principal_id
}
output "identity_type" {
    value = data.azurerm_logic_app_workflow.example.identity.0.type
}

output "identity_tenant_id" {
    value = data.azurerm_logic_app_workflow.example.identity.0.tenant_id
}

output "identity_principal_id" {
    value = data.azurerm_logic_app_workflow.example.identity.0.principal_id
}

image

This will close #14876.

@rikribbers
Copy link
Contributor

@heoelri thanks for this PR; Allthough I am not a maintainer I would like to see the merged a.s.a.p

2 remarks:

  • make sure the checks are all green
  • add a test that verifies the existence of the identity

@heoelri
Copy link
Contributor Author

heoelri commented Jan 11, 2022

The linting test failed due to a timeout. That's not related to the code, but reg. the test you're right. Adding one now.

@github-actions github-actions bot added size/M and removed size/XS labels Jan 11, 2022
@heoelri
Copy link
Contributor Author

heoelri commented Jan 11, 2022

==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/logic -run=LogicAppWorkflowDataSource_* -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccLogicAppWorkflowDataSource_identitySystemAssigned
=== PAUSE TestAccLogicAppWorkflowDataSource_identitySystemAssigned
=== RUN   TestAccLogicAppWorkflowDataSource_basic
=== PAUSE TestAccLogicAppWorkflowDataSource_basic
=== RUN   TestAccLogicAppWorkflowDataSource_tags
=== PAUSE TestAccLogicAppWorkflowDataSource_tags
=== CONT  TestAccLogicAppWorkflowDataSource_identitySystemAssigned
=== CONT  TestAccLogicAppWorkflowDataSource_tags
=== CONT  TestAccLogicAppWorkflowDataSource_basic
--- PASS: TestAccLogicAppWorkflowDataSource_tags (78.99s)
--- PASS: TestAccLogicAppWorkflowDataSource_identitySystemAssigned (81.10s)
--- PASS: TestAccLogicAppWorkflowDataSource_basic (81.24s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/logic 81.265s

@rikribbers
Copy link
Contributor

and now we wait for the maintainers.... but for it's good to go.

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 @heoelri

Thanks for this PR - I've taken a look through and left a few minor comments inline but if we can fix those up then this should otherwise be good to merge 👍

Thanks!

website/docs/r/logic_app_workflow.html.markdown Outdated Show resolved Hide resolved
website/docs/d/logic_app_workflow.html.markdown Outdated Show resolved Hide resolved
website/docs/d/logic_app_workflow.html.markdown Outdated Show resolved Hide resolved
@heoelri
Copy link
Contributor Author

heoelri commented Jan 17, 2022

hey @heoelri Heyko Oelrichs FTE

Thanks for this PR - I've taken a look through and left a few minor comments inline but if we can fix those up then this should otherwise be good to merge 👍

Thanks!

Thanks for reviewing and for your comments @tombuildsstuff!

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.

LGTM - thanks @heoelri

@tombuildsstuff tombuildsstuff added this to the v2.93.0 milestone Jan 17, 2022
@rikribbers
Copy link
Contributor

Thanks for providing the PR @heoelri and reviewing @tombuildsstuff !

@tombuildsstuff tombuildsstuff merged commit 1161e33 into hashicorp:main Jan 17, 2022
tombuildsstuff added a commit that referenced this pull request Jan 17, 2022
@github-actions
Copy link

This functionality has been released in v2.93.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 21, 2022
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.

Support for identity block in data source azurerm_logic_app_workflow
3 participants