Closed vndrzrfshKxR2 closed 5 months ago
@vndrzrfshKxR2 thanks for reaching out!
Quick question: with what id did you do the import? It should be the ID you use to fetch a product through the following call: https://docs.commercetools.com/api/projects/products#get-product-by-id. This is the same as what you can see as the last element in your browser when in the product view in the merchant center.
If you used the key or any other value it will have imported that as ID instead, and it will break when trying to apply because it is trying to create 2 products with the same key
We have manually setup commercetools dev environment using terraform from local machine for commercetools_product_type resource and store_specific_data. When we are deploying the same infra using terraform with TFC , apply is failing with duplicate keys issue.
Solution tried:
Resource:
resource "commercetools_product_type" "this" { key = product name = product }
error: Error: A duplicate value '"product"' exists for field 'key'. 752│ 753│ with module.product_type.commercetools_product_type.this, 754│ on modules/product_type/main.tf line 9, in resource "commercetools_product_type" "this": 755│ 9: resource "commercetools_product_type" "this" {
Suggest if anything is missed or is there other way to handle the same in commercetools TF.