Closed jbyardi closed 8 months ago
Hi @jbyardi
Good news, there is no need to wait for the import to be implemented, it already exists. 🎉 It's only missing from the documentation 😕 Here are examples for import:
terraform import statuspage_component_group.my_group page-id/component-group-id
terraform import statuspage_component.my_component page-id/component-id
terraform {
required_providers {
statuspage = {
source = "sbecker59/statuspage"
version = "1.0.0"
}
}
}
provider "statuspage" {}
resource "statuspage_component" "my_component" {
page_id = "page-id"
name = "My Website"
description = "Status of my Website"
status = "operational"
lifecycle {
ignore_changes = [
status
]
}
}
resource "statuspage_component_group" "my_group" {
page_id = "page-id"
name = "Terraform"
description = "Created by terraform"
components = [ statuspage_component.my_component.id ]
}
import {
to = statuspage_component_group.my_group
id = "page-id/component-group-id"
}
import {
to = statuspage_component.my_component
id = "page-id/component-id"
}
Don't hesitate if you need more information. Regards.
Sébastien B.
Thanks Sébastien!
Tried running an import and got an authorization error. Perhaps the authorisation headers required have changed since you created this?
Have you set the api key? Several possible solutions
provider "statuspage" {
api_key = "...."
}
export STATUSPAGE_API_KEY=...
export SP_API_KEY=...
Okay retrying the import another day worked. Might have been a momentary issue with API calls. Tested a bad api key and got a proper 401 error.
Hi there,
Wondering if you could implement support for importing Statuspage resources. I've got a few components already active and it would be great to not have to recreate them.
Kind Regards, Jonathan B.