英文:
How to Terraform import azurerm_postgresql_active_directory_administrator for a postgresql flexible server on Azure
问题
我手动在Azure上创建了一个PostgreSQL的灵活服务器,因为通过Terraform创建时出现了错误。在创建灵活服务器时,有一个选项可以选择AAD服务器管理员:
在创建整个资源后,我试图将其导入到Terraform中。
为了指定AAD服务器管理员,我尝试使用以下资源:"azurerm_postgresql_active_directory_administrator"。对于该资源,文档中提供的导入命令是:
terraform import azurerm_postgresql_active_directory_administrator.administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/myserver
我的问题是,是否有替代方法?这个"azurerm_postgresql_active_directory_administrator.administrator"资源是否可以用于灵活服务器?是否需要使用它?
我尝试使用我的灵活服务器资源ID,但是出现了以下错误:
期望与服务器ID匹配:
│
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/servers/serverValue
│
│ 但提供了以下值:
│
│ > /subscriptions/<my__sensitive_subscription_id>/resourceGroups/hrpap-dev-db-postgres-rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/hrpap-dev-db-postgres-database-flex/administrators/<object_id>
│
│ 解析的资源ID在位置6处的段缺少一个值(应该是文字值"servers")。
如果还有其他需要翻译的内容,请提供。
英文:
I created a PostgreSQL flexible server on Azure manually, since there is an error creating it through Terraform. When creating the flexible server, there is an option to select AAD Server admin:
After creating the whole resource, I am trying to import it into Terraform.
For specifying the AAD Server admin, I tried using the following resource: "azurerm_postgresql_active_directory_administrator". For that resource, the import command that is available inside the documentation would be:
terraform import azurerm_postgresql_active_directory_administrator.administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/myserver
My question is, is there an alternative for this, can this "azurerm_postgresql_active_directory_administrator.administrator" resource even be used for flexible servers? Does it need to be used?
I tried using my flexible servers resource ID, but I get the following error:
Expected a Server ID that matched:
│
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/servers/serverValue
│
│ However this value was provided:
│
│ > /subscriptions/<my__sensitive_subscription_id>/resourceGroups/hrpap-dev-db-postgres-rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/hrpap-dev-db-postgres-database-flex/administrators/<object_id>
│
│ The parsed Resource ID was missing a value for the segment at position 6
│ (which should be the literal value "servers").
答案1
得分: 0
有一个新的资源可用,需要稍微不同的配置:
英文:
Apparently, there is a new resource for that, with a little bit different configuration required:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论