Configuring your BTP Subaccount and adding the first user with the Subaccount Viewer Role

The Code


######################### SAP BTP provider configuration ############################

provider "btp" {
  globalaccount = var.globalaccount_subdomain
  username      = var.admin_user
  password      = var.admin_password
}

#provider "btp" {
#  globalaccount = "Your BTP Global Account Subdomain"
#  username      = "******@gmail.com"
#  password      = "**********"
#}


######################### Subaccount Config ############################

resource "btp_subaccount" "DevACloudGuruji" {
  name        = "DevACloudGuruji"
  subdomain   = "dev-acloudguruji"
  region      = "us10"
  description = "managed by Terraform and created by ACloudGuruji.com"
}


######################### SubAccount User & Roles ############################

resource "btp_subaccount_role_collection_assignment" "subaccount-viewer" {
  subaccount_id        = btp_subaccount.DevACloudGuruji.id
  role_collection_name = "Subaccount Viewer"
  user_name            = "[email protected]"
}

Last updated