While creating Commercetools Token Rotation for AWS secrets manager, receiving below error in workflow.
Error: The scope 'manage_orders: view_products:' is invalid.
on .terraform/modules/chargebee_subscription/terraform/commercetools.tf line 1, in resource "commercetools_api_client" "chargebee_subscription":
1: resource "commercetools_api_client" "chargebee_subscription" {
Below is the terraform configuration.
resource "commercetools_api_client" "chargebee_subscription" {
name = "chargebee_subscription"
scope = local.ct_scopes
}
locals {
project_key = var.ct_project_key
ct_scopes = ["manage_orders:${local.project_key}", "view_products:${local.project_key}"]
store_variables = flatten([
for store_key, store in var.ct_stores : [
for variable_key, variable_value in store.variables : {
"${store_key}_${variable_key}" : variable_value
}
]
])
}
variable "ct_project_key" {
type = string
description = "commercetools project key"
default = ""
}
The error is saying scope is invalid. Could you please suggest if the declarations are correct.