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 an identity block to azurerm_static_site #14911

Merged
merged 3 commits into from
Jan 17, 2022
Merged

Add an identity block to azurerm_static_site #14911

merged 3 commits into from
Jan 17, 2022

Conversation

heoelri
Copy link
Contributor

@heoelri heoelri commented Jan 12, 2022

This PR will add support for identity to the azurerm_static_site resource as requested in Issue #14878 (by @axc450).

UserAssigned

resource "azurerm_resource_group" "example" {
  name     = "issue14878"
  location = "West Europe"
}

resource "azurerm_user_assigned_identity" "example" {
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  name = "example-identity"
}

resource "azurerm_static_site" "example" {
  name                = "example"
  sku_size            = "Standard"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  identity {
    type         = "UserAssigned"
    identity_ids = [azurerm_user_assigned_identity.example.id]
  }
}

SystemAssigned

resource "azurerm_resource_group" "example" {
  name     = "issue14878"
  location = "West Europe"
}


resource "azurerm_static_site" "example" {
  name                = "example"
  sku_size            = "Standard"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  identity {
    type         = "SystemAssigned"
  }
}

It includes docs and testing for both scenarios. This will close #14878.

@heoelri
Copy link
Contributor Author

heoelri commented Jan 12, 2022

make acctests SERVICE='web' TESTARGS='-run=AzureStaticSite_with*' TESTTIMEOUT='60m'
==> 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/web -run=AzureStaticSite_with* -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureStaticSite_withUserAssignedIdentity
=== PAUSE TestAccAzureStaticSite_withUserAssignedIdentity
=== RUN   TestAccAzureStaticSite_withSystemAssignedIdentity
=== PAUSE TestAccAzureStaticSite_withSystemAssignedIdentity
=== CONT  TestAccAzureStaticSite_withUserAssignedIdentity
=== CONT  TestAccAzureStaticSite_withSystemAssignedIdentity
--- PASS: TestAccAzureStaticSite_withSystemAssignedIdentity (150.63s)
--- PASS: TestAccAzureStaticSite_withUserAssignedIdentity (155.67s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/web   155.697s

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

@tombuildsstuff tombuildsstuff added this to the v2.93.0 milestone Jan 17, 2022
@tombuildsstuff tombuildsstuff merged commit 59035ec 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 for azurerm_static_site
2 participants