Closed sja closed 7 months ago
I created a minimal example:
provider "cidaas" {
redirect_uri = "https://<tennant>.cidaas.eu/user-profile/editprofile"
base_url = "https://<tennant>.cidaas.eu"
}
locals {
pages = [
{ id = "register", uri = "/register" },
{ id = "register_success", uri = "/register" },
{ id = "login", uri = "/login" },
{ id = "login_success", uri = "/demo-app/redirect_uri" }
]
locales = [ "de", "en-US", "en-GB", "en" ]
}
resource "cidaas_hosted_page" "page" {
hosted_page_group_name = "TF-Test-LocalDev"
default_locale = "de"
dynamic "hosted_pages" {
for_each = setproduct(local.pages, local.locales)
content {
hosted_page_id = hosted_pages.value[0].id
locale = hosted_pages.value[1]
url = "http://localhost${hosted_pages.value[0].uri}"
}
}
}
On the first terraform apply
, the hosted pages are added:
cidaas_hosted_page.page: Creating...
cidaas_hosted_page.page: Creation complete after 0s [id=TF-Test-LocalDev]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
On the second run I got this:
cidaas_hosted_page.page: Refreshing state... [id=TF-Test-LocalDev]
╷
│ Error: failed to read hosted page TF-Test-LocalDev
│
│ with cidaas_hosted_page.page,
│ on main.tf line 17, in resource "cidaas_hosted_page" "page":
│ 17: resource "cidaas_hosted_page" "page" {
│
│ status code not 200. found 404, response body: {"success":true,"status":404}
│
I can provision Hosted Pages Group, but tf is never able to refresh it and therefore cannot update them.
For me it seems that the id is not used when fetching from cidaas API. When using the admin-ui and manually edit the HostedPages, i can see a successful call to
/hostedpages-srv/hpgroup/LocalDev
with the previously provisioned Hosted Page Group.I'm using provider version 2.4.5, tf v1.6.6 on macOS.