Skip to content

Proposal: merge commercetools_tax_category_rate into commercetools_tax_category #291

@mvantellingen

Description

@mvantellingen

We have created a separate resource for the rates within a tax category.

So now to define a tax category you need:

resource "commercetools_tax_category" "my-tax-category" {
  name        = "Standard tax category"
  description = "Example category"
}

resource "commercetools_tax_category_rate" "standard-tax-category-DE" {
  tax_category_id   = commercetools_tax_category.my-tax-category.id
  name              = "19% MwSt"
  amount            = 0.19
  included_in_price = false
  country           = "DE"
  sub_rate {
    name   = "example"
    amount = 0.19
  }
}

In commercetools there is only one resource: the category. By splitting them in terraform in two separate resources we created a 'virtual' resource which does all the actions on the tax category referenced in the resource. So create,update and delete are all updates on the tax category resource.

Alternative approach:

resource "commercetools_tax_category" "my-tax-category" {
  name        = "Standard tax category"
  description = "Example category"

  rate {
    name              = "19% MwSt"
    amount            = 0.19
    included_in_price = false
    country           = "DE"

    sub_rate {
      name   = "example"
      amount = 0.19
    }
  }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions