aiven / terraform-provider-aiven

Aiven Terraform Provider
https://registry.terraform.io/providers/aiven/aiven/latest/docs
MIT License
129 stars 70 forks source link

`billing_emails` not stored in state for projects when set through `billing_group` so subsequent changes remove the emails #720

Closed encima closed 2 years ago

encima commented 2 years ago

Setting billing_emails in a billing_group does not store them for projects (but returned in response) so subsequent runs will show the projects as being modified by removing the billing_emails

resource "aiven_account" "tst-account" {
  name = "aivener-test"  
}

resource "aiven_billing_group" "tst-bg" {
    name             = "test-bg"
    billing_currency = "USD"
    vat_id           = "123ABC"
    account_id = aiven_account.tst-account.account_id
    billing_emails = [ "encima@aiven.fi", "encima+1@aiven.fi" ]
    depends_on = [
      aiven_account.tst-account
    ]
}

## Do not use this project, keep it as a template
resource "aiven_project" "template-proj" {
    project = "template-proj"
    account_id = aiven_account.tst-account.account_id
    billing_group = aiven_billing_group.tst-bg.id
    default_cloud = "aws-eu-west-1"
    depends_on = [
      aiven_billing_group.tst-bg,
      aiven_account.tst-account
    ]
}

Response on subsequent plan:

image
wanisfahmyDE commented 2 years ago

can confirm that it works, thanks!