-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Import of azurerm_active_directory_domain_service into terraform state fails when existing Azure AD Domain Services is on Standard SKU #12728
Comments
Looks like the docs for this are wrong since we're using the Initial Replica Set ID as the Domain Service ID here:
|
Hi @tombuildsstuff, i just realized that this resource type has been added in the latest version 2.69.0 which was literally released 3 days ago. i was looking out for #10782 for quite some time and since its so new theres probably still a bunch of other issues. To follow up with this issue, i tried doing an import with your comment on initialReplicaSetId in one of our enviroments and i got the error that this was not found on the azure site. Also the resource address in azure is showing the resource address without the /initialReplicaSetId/ path at the end theragus@Theragus-MacBookPro % terraform import azurerm_active_directory_domain_service.AADDS/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/AADDS/providers/Microsoft.AAD/domainServices/int.domain.de/initialReplicaSetId/48066e1d-4e8c-42fb-aeef-2d40c5fa6940
Acquiring state lock. This may take a few moments...
╷
│ Error: Cannot import non-existent remote object
│
│ While attempting to import an existing object to "azurerm_active_directory_domain_service.AADDS", the provider detected that no object exists with the given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the
│ provider's configured region or endpoint, or use "terraform apply" to create a new remote object for this resource.
╵
|
@manicminer since you've got the context would you mind taking a look at this? |
I am also encountering the same issue when I try and import an existing Azure AD Domain Service into terraform. I am running standard SKU and so no replica sets. |
Hi @Theragus, @enorlando Thanks for reporting this! You are correct, there is a documentation bug for this resource - the resource ID format isn't shown in full. In order to import a domain service, you'll need to use the following format (the missing segment is at the end):
Apart from the obscured subscription ID, this is the exact command I used to import a Standard SKU domain service that I created in the portal. Note that whilst the portal doesn't show any replica sets when using the Standard SKU, it does have one (and only one). You can get the replica set ID by peeking at the API responses in your browser inspector - unfortunately the portal doesn't show it anywhere. Can you give this a try and advise if this allows you to import? We'll get a documentation fix out shortly. Thanks! |
Hi @manicminer, |
Hi @manicminer |
This functionality has been released in v2.72.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! |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_active_directory_domain_service
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
Succesful import of existing azurerm_active_directory_domain_service into the state.
Actual Behaviour
terraform exits with an error:
Steps to Reproduce
Important Factoids
References
The text was updated successfully, but these errors were encountered: