Closed akanevskys closed 4 months ago
@akanevskys I cannot reproduce the error you describe. The terraform apply
as well as an import work. I assume that the required IDs are not filled/propagated correctly maybe due to your modularized setup.
To narrow down the cause, can you please try the following setup:
provider.tf
looks like this; terraform {
required_providers {
btp = {
source = "SAP/btp"
version = "~>1.4.0"
}
}
}
provider "btp" {
globalaccount = <SUBDOMAIN OF YOUR GLOBAL ACCOUNT>
}
import.tf
with the following content:import {
to = btp_subaccount_subscription.subaccount_subscription
id = "<YOUR SUBACCOUNT ID>,feature-flags-dashboard,dashboard"
}
main.tf
file with the following content
resource "btp_subaccount_subscription" "subaccount_subscription" {
subaccount_id = <YOUR SUBACCOUNT ID>
app_name = "feature-flags-dashboard"
plan_name = "dashboard"
}
Execute a terraform init
and a terraform apply
and check if this setup works
If this works you should add the state backend and validate that this works too.
@lechnerc77 thank you so much! Your code was refreshing way to figure out proper global account subdomain value.
Global account subdomain should be copy-pasted from BTP Control Center not from BTP Cockpit, where it's wrong. Another way to figure out proper global account subdomain it's btp cli output after btp login --sso
@akanevskys Great that you figured it out. However the subdomain of the global account is correctly displayed in the cockpit (otherwise customers would have a hard time as they have no access to the BTP COntrol Center). Maybe a glitch when copying it as unortunatly there is no "copy" button for this attribute
Is there an existing issue for this?
What version of the Terraform provider are you using?
1.4.0
What version of the Terraform CLI are you using?
1.9.2
What type of issue are you facing
bug report
Describe the bug
Error: API Error Reading Resource Subscription (Subaccount) received response with unexpected status [Status: 404; Correlation ID: e5027ee5-f39d-a2b2-e198-949c4ed8e73c]
Expected Behavior
Finish apply or import without an error
Steps To Reproduce
TF_LOG=DEBUG terraform import module.btp_subaccount_subscription.subaccount_subscription "<subscription_id>","feature-flags-dashboard","dashboard"
orterraform apply
generates error "API Error Reading Resource Subscription (Subaccount)"Also tested with auditlog-viewer service, plan: free. With the same result
User's Role Collections
Subaccount Administrator Subaccount Service Administrator
Add screenshots to help explain your problem
Meanwhile,
btp list accounts/subscription --subaccount subaccount_id
show proper subscription to the application.Additional context
No response