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

feat: add dashboard URL to service instance #865

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Conversation

lechnerc77
Copy link
Member

Purpose

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Test the code via automated test
go test ./...
  • Additional test steps
Regression test with provider version 1.4.0  

What to Check

Verify that the following are valid:

  • Automated tests are executed successfully
  • Validate that no change does not cause incompatible change

Other Information

n/a

Checklist for reviewer

The following organizational tasks must be completed before merging this PR:

  • The PR is assigned to the Terraform project and a status is set (typically "in review").
  • The PR has the matching labels assigned to it.
  • The PR has a milestone assigned to it.
  • If the PR closes an issue, the issue is referenced.
  • Possible follow-up items are created and linked.

@lechnerc77 lechnerc77 added the enhancement New feature or request label Jul 23, 2024
@lechnerc77 lechnerc77 added this to the 1.6.0 milestone Jul 23, 2024
@lechnerc77
Copy link
Member Author

lechnerc77 commented Jul 24, 2024

Regression test done with HANA Cloud that exposes the dashboard URL- due to computed field, change has no impact on existing states.

Customers can fetch the additional computed field via terraform refresh which will update the state without any impact on the provided resources on SAP BTP

Here is the sample configuration used to validate the setup:

provider.tf

terraform {
  required_providers {
    btp = {
      source  = "SAP/btp"
      version = "~>1.4.0"
    }
  }
}

# Configure the BTP Provider
provider "btp" {
  globalaccount  = var.globalaccount
  cli_server_url = var.cli_server_url
}

main.tf

resource "btp_subaccount" "sa_retest_hana_cloud" {
  name      = "retest-hana-cloud"
  subdomain = "retest-hana-cloud"
  region    = var.region
}


resource "btp_subaccount_entitlement" "se_hana-cloud" {
  subaccount_id = resource.btp_subaccount.sa_retest_hana_cloud.id
  service_name  = "hana-cloud"
  plan_name     = "hana"
}

data "btp_subaccount_service_plan" "sp_hana_cloud__hana" {
  subaccount_id = resource.btp_subaccount.sa_retest_hana_cloud.id
  offering_name = "hana-cloud"
  name          = "hana"
  depends_on    = [btp_subaccount_entitlement.se_hana-cloud]
}


resource "btp_subaccount_service_instance" "hana_cloud_hana_instance" {
  subaccount_id  = resource.btp_subaccount.sa_retest_hana_cloud.id
  serviceplan_id = data.btp_subaccount_service_plan.sp_hana_cloud__hana.id
  name           = "hana-cloud-test-tf"
  parameters = jsonencode({
    "data" = {
      "memory"                 = 32
      "generateSystemPassword" = true
      "edition"                = "cloud"
    }
  })
  timeouts = {
    create = "25m"
    update = "15m"
    delete = "15m"
  }
}

variables.tf

variable "globalaccount" {
  description = "The global account name"
  type        = string
  default     = <YOUR GLOBAL ACCOUNT SUBDOMAIN>
}

variable "cli_server_url" {
  description = "The BTP CLI server URL"
  type        = string
  default     = "https://cli.btp.cloud.sap"

}

variable "region" {
  description = "The region where the subaccount should be created"
  type        = string
  default     = "us10"
}

@lechnerc77 lechnerc77 marked this pull request as ready for review July 24, 2024 06:29
@lechnerc77
Copy link
Member Author

  • Fixture Drift Detection check fails => OKAY due to re-recording of test fixtures
  • Inclusive Language check fails => ACCEPTED due to upstream dependency

@lechnerc77 lechnerc77 self-assigned this Jul 24, 2024
@lechnerc77
Copy link
Member Author

@vipinvkmenon @CHERIANS: when doing the review, please also validate the regression e.g. via the sample configuration provided above.

@lechnerc77 lechnerc77 enabled auto-merge (squash) July 24, 2024 10:39
@vipinvkmenon
Copy link
Member

Verified

@lechnerc77 lechnerc77 merged commit ec29a47 into main Jul 26, 2024
21 of 22 checks passed
@lechnerc77 lechnerc77 deleted the feat/issue-864 branch July 26, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add dashboard_url property to btp_subaccount_service_instance Resource and Data Source
2 participants