Git Product home page Git Product logo

Comments (3)

lechnerc77 avatar lechnerc77 commented on July 28, 2024 1

In general there is no need to interact actively with the Terraform state. All information that the resources expose is part of the documentation of the corresponding resource or data source.

Concerning your setup you must:

This procedure is part of the provider documentation. The Terraform configuration should look like (assuming your subaccount_id is defined as a variable:

resource "btp_subaccount_entitlement" "alert_notification_service" {
  subaccount_id = var.subaccount_id
  service_name  = "alert-notification"
  plan_name     = "free"
}


data "btp_subaccount_service_plan" "by_name" {
  subaccount_id = var.subaccount_id
  name          = "free"
  offering_name = "alert-notification"
  depends_on    = [btp_subaccount_entitlement.alert_notification_service]
}


resource "btp_subaccount_service_instance" "alert_notification_free" {
  subaccount_id  = var.subaccount_id
  serviceplan_id = data.btp_subaccount_service_plan.by_name.id
  name           = "my-alert-notification-instance-new"
}

Be aware that the dependency between the entitlement and the reading of the service plan must be modelled explicitly via depends_on.

from btp-terraform-samples.

lechnerc77 avatar lechnerc77 commented on July 28, 2024 1

I just tested it on a productive account and it worked (except for one typo in the code above that is now fixed).

The result is as expected:

btp_subaccount_entitlement.alert_notification_service: Creating...
btp_subaccount_entitlement.alert_notification_service: Still creating... [10s elapsed]
btp_subaccount_entitlement.alert_notification_service: Still creating... [20s elapsed]
btp_subaccount_entitlement.alert_notification_service: Creation complete after 21s [id=alert-notification-free]
data.btp_subaccount_service_plan.by_name: Reading...
data.btp_subaccount_service_plan.by_name: Read complete after 1s [id=xxx]
btp_subaccount_service_instance.alert_notification_free: Creating...
btp_subaccount_service_instance.alert_notification_free: Creation complete after 9s [id=xxx]

and the service instance got created. I assume that there is an issue in your subaccount in general.

from btp-terraform-samples.

Mohit-21 avatar Mohit-21 commented on July 28, 2024

I have utilized the above terraform configuration but I got the same error again

btp_subaccount_entitlement.alert_notification_service: Creating...
btp_subaccount_service_instance.alert_notification_free: Creating...
btp_subaccount_entitlement.alert_notification_service: Still creating... [10s elapsed]
btp_subaccount_entitlement.alert_notification_service: Still creating... [20s elapsed]
btp_subaccount_entitlement.alert_notification_service: Creation complete after 23s [id=alert-notification-free]
data.btp_subaccount_service_plan.by_name: Reading...
data.btp_subaccount_service_plan.by_name: Read complete after 0s [id=24b7e4c1-59f9-437d-8f2a-675c63c2829c]

│ Error: API Error Creating Resource Service Instance (Subaccount)

│ with btp_subaccount_service_instance.alert_notification_free,
│ on main.tf line 25, in resource "btp_subaccount_service_instance" "alert_notification_free":
│ 25: resource "btp_subaccount_service_instance" "alert_notification_free" {

│ NotFound

from btp-terraform-samples.

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.