Coder Social home page Coder Social logo

Comments (7)

seboudry avatar seboudry commented on July 17, 2024 1

Came into the same issue with an already created project.
Billing information is managed by finance team and we don't want to handle it with Terrafrom.

@phumberdroz I borrow your idea and simplify billing_emails list:

resource "aiven_project" "awesome" {
  project          = "${var.aiven_project_name}"
  technical_emails = [
    "[email protected]",
  ]

  lifecycle {
    # ignoring billing information
    ignore_changes = [
      "billing_address",
      "billing_emails",
      "card_id",
      "country_code",
    ]
  }
}

from terraform-provider-aiven.

mteiste avatar mteiste commented on July 17, 2024 1

You define and import the project as data "aiven_project" instead of resource "aiven_project".

from terraform-provider-aiven.

phumberdroz avatar phumberdroz commented on July 17, 2024

as a work around I changed my Project Resource to look like this:

resource "aiven_project" "project" {
  project           = "${terraform.workspace}"
  copy_from_project = "karl-3727"

  lifecycle {
    ignore_changes = [
      # Ignore Because it conflicts with copy_from_project see: https://github.com/aiven/terraform-provider-aiven/issues/47
      "billing_address",
      "billing_emails.#",
      "billing_emails.1238831172",
      "card_id",
      "country_code",
      "technical_emails.#",
      "technical_emails.1238831172",
    ]
  }
}

from terraform-provider-aiven.

seboudry avatar seboudry commented on July 17, 2024

But maybe another solution is to have a aiven_projet data source instead to only reference an existing resource. Like google_project one https://www.terraform.io/docs/providers/google/d/google_project.html

After a few time using this provider I also notice that Terraform's output variable type aren't used. All computed values are resource attributes. Am I wrong ?

from terraform-provider-aiven.

mteiste avatar mteiste commented on July 17, 2024

latest release (1.0.14) implements the suggested solution (datasources)

from terraform-provider-aiven.

jeff-knurek avatar jeff-knurek commented on July 17, 2024

latest release (1.0.14) implements the suggested solution (datasources)

can you elaborate?
I imported the aiven_projet resource and had to apply the lifecycle { ignore_changes } workaround in version v1.2.3

from terraform-provider-aiven.

eb-trigo avatar eb-trigo commented on July 17, 2024

Hey, @mteiste If I use the lifecycle feature it allows me to add another email address but if I want to delete some email from the list it ignores this change.

Can you please let me know what should I change in my aiven Terraform's resources?

resource "aiven_billing_group" "billing_group" {
    name = var.name
    vat_id = var.vat_id
    billing_currency = "USD"
    billing_emails = var.billing_emails
}

resource "aiven_project" "project" {
    project = var.project
    technical_emails  = var.technical_emails
    billing_group = aiven_billing_group.billing_group.id
    lifecycle {
      ignore_changes = [billing_emails]
    }
}

from terraform-provider-aiven.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.