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

azurerm_shared_image_version deployment #3517

Closed
rohrerb opened this issue May 24, 2019 · 3 comments
Closed

azurerm_shared_image_version deployment #3517

rohrerb opened this issue May 24, 2019 · 3 comments

Comments

@rohrerb
Copy link
Contributor

rohrerb commented May 24, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Deployments for azurerm_shared_image_version can take 30 minutes to a hour due to terraform waiting for the image replication to complete. Is it possible for terraform to create he resource and complete without waiting for replication to multiple regions.

New or Affected Resource(s)

azurerm_shared_image_version

Example Terraform Configuration

resource "azurerm_shared_image_version" "version" {
  count               = "${var.create ? 1 : 0}"
  name                = "${var.global_image_version}"
  gallery_name        = "${var.gallery_name}"
  image_name          = "${var.image_name}"
  resource_group_name = "${var.resource_group_name}"
  location            = "${var.location}"
  managed_image_id    = "${var.managed_image_id}"

  target_region {
    name                   = "UK South"
    regional_replica_count = 1
  }

  target_region {
    name                   = "Australia East"
    regional_replica_count = 1
  }

  target_region {
    name                   = "Canada Central"
    regional_replica_count = 1
  }
}

@rohrerb
Copy link
Contributor Author

rohrerb commented May 24, 2019

9 times out of 10 you end up with...

1 error occurred:
        * module.version-windows-com.azurerm_shared_image_version.version: 1 error occurred:
        * azurerm_shared_image_version.version: Error waiting for the creation of Shared Image Version "1.0.1" (Image "Windows" / Gallery "global_image_gallery" / Resource Group "Global"): azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/7d559a72-xxxx-xxxx-xxxx-5ca5b14a25e7/providers/Microsoft.Compute/locations/uksouth/capsOperations/c29a9c25-xxxx-xxxx-xxxx-6bcef62f9ea9?api-version=2018-06-01: StatusCode=0 -- Original Error: Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token

@tombuildsstuff
Copy link
Contributor

hi @rohrerb

Thanks for opening this issue :)

Deployments for azurerm_shared_image_version can take 30 minutes to a hour due to terraform waiting for the image replication to complete. Is it possible for terraform to create he resource and complete without waiting for replication to multiple regions.

Terraform intentionally waits (ignoring bugs) for a resource to be fully provisioned so that it's possible to chain resources together (to for instance, create a Virtual Machine then add it to a Load Balancer) - as such unfortunately that's not an approach we'd taken.

Taking a look into this, the root cause of this appears to be hashicorp/go-azure-helpers#22 which I'm going to close this in favour of. In addition once version 2.0 of the Azure Provider becomes available you'll be able to use custom timeouts for resources to set a timeout as needed.

Thanks!

@ghost
Copy link

ghost commented Jun 25, 2019

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!

@ghost ghost locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants