-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
streamnative_service_account should be able to re-recreate a service account if someone accidentally deletes it.
Demo terraform:
terraform {
required_providers {
streamnative = {
source = "streamnative/streamnative"
version = "0.4.2"
}
}
}
provider "streamnative" {
}
variable "organization_name" {
type = string
description = "The name of the organization"
}
variable account_name {
type = string
description = "The name of the account to creaate"
default = "test-account"
}
resource "streamnative_service_account" "service_account" {
name = var.account_name
organization = var.organization_name
admin = false
}
Steps:
- plan and apply given terraform
- use stream native console to delete service account "test-account"
- plan given terraform
Gets error
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: ERROR_READ_SERVICE_ACCOUNT: serviceaccounts.cloud.streamnative.io "test-account" not found
│
│ with streamnative_service_account.service_account,
│ on main.tf line 24, in resource "streamnative_service_account" "service_account":
│ 24: resource "streamnative_service_account" "service_account" {
Should detect missing service account and re-create it.
Metadata
Metadata
Assignees
Labels
No labels