Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Creating btp_subaccount_entitlement does not work for hana-cloud #930

Open
1 task done
Lasseses opened this issue Oct 18, 2024 · 3 comments
Open
1 task done
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Lasseses
Copy link

Lasseses commented Oct 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What version of the Terraform provider are you using?

1.7.0

What version of the Terraform CLI are you using?

1.9.7

What type of issue are you facing

bug report

Describe the bug

When trying to create a new entitlement for Hana cloud using service_name: hana-cloud and plan_name: hana, it fails with the following report:

More than one plan exists for service name
│ hana-cloud and plan name hana in the same
│ region. Specify the unique identifier of the
│ plan to assign. [Error: 30001/400]

Expected Behavior

Using the BTP CLI the expected behavior can be achieved by also setting the --plan-unique-identifier. When looking at the BTP Terraform Provider tests here, it appears that the readonly attributes id or plan_id seem to could fix this issue in tf.

btp assign accounts/entitlement --for-service hana-cloud --plan hana-cloud-hana --global-account <GAID> --to-subaccount <SAID> --plan-unique-identifier hana-cloud-hana

Steps To Reproduce

resource "btp_subaccount_entitlement" "hana_entitlement" {
subaccount_id =
service_name = "hana-cloud"
plan_name = "hana"
#id = "hana-cloud-hana" --> I have tried but it its readonly
#plan_id = "hana-cloud-hana" --> I have tried but it its readonly
}

User's Role Collections

No response

Add screenshots to help explain your problem

No response

Additional context

I am part of the Cloud Orchestrator team, working on the BTP Crossplane provider. Feel free to reach out to me also internally for further consolidation! Lasse, Friedrich

@Lasseses Lasseses added bug Something isn't working needs-triage For new issues labels Oct 18, 2024
@lechnerc77
Copy link
Member

@lechnerc77
Copy link
Member

Update: Still in process of clarifying the mismatches in the different provisioning flows (API/Terraform vs. BTP CLI)

@lechnerc77 lechnerc77 removed the needs-triage For new issues label Nov 7, 2024
@lechnerc77 lechnerc77 added this to the 1.9.0 milestone Nov 7, 2024
@lechnerc77
Copy link
Member

After internal clarification: the additional optional parameter plan-unique-identifier as available in the BTP CLI (see https://help.sap.com/docs/btp/btp-cli-command-reference/btp-assign-accounts-entitlement) must be added to the resources for entitlements

Tasks:

  • Enhance resource btp_suubaccount_entitlement with the new optional parameter plan-unique-identifier
  • Enhance the resource btp_directories_entitlement with the nw optional parameter for plan-unique-identifier
  • Record a test case for both resources with the additional parameter set
  • Enhance the datasources for entitlements with the optional parameter (global account, directory, subaccount)
  • Re-record the test cases for the data sources and validate that a value for the parameter is set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants