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

Add 'name' property of ibm_is_instance resource to catalog metadata #184

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

luisarojas
Copy link
Collaborator

@luisarojas luisarojas commented Jul 31, 2024

Changes

  • Extract name property from Terraform resource ibm_is_instance
  • Include name property in metadata.catalog object within the cost.json Infracost output
  • Update ibm_is_instance test golden file

Testing

cost.json Snippet

"metadata": {
  "catalog": {
    "childResources": ["ibm_is_ssh_key", "ibm_is_floating_ip"],
    "configuration": {
      "name": "test-instance-1",
      "on_dedicated_host": false,
      "profile": "bx2d-32x128",
      "region": "us-east"
    },
    "pricingUrl": "https://cloud.ibm.com/vpc-ext/provision/vs",
    "serviceId": "is.instance"
  }
}

Regression Tests

 PASS  __tests__/regression/sanityGenEstimate.test.js (10.607 s)
  ✓ Generate estimate for SLZ (2299 ms)
  ✓ Generate estimate for SLZ using usage file (1804 ms)
  ✓ Create usage file for SAP power (1375 ms)
  ✓ Generate estimate for Power infrastructure (1000 ms)
  ✓ Generate estimate for SAP on Power instances (817 ms)
  ✓ Generate estimate for SLZ with Roks (1428 ms)
  ✓ Generate multi-plan estimate using config file (1602 ms)

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------

=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================
Test Suites: 2 passed, 2 total
Tests:       11 passed, 11 total
Snapshots:   0 total
Time:        10.733 s, estimated 11 s
Ran all test suites matching /sanity*/i.

@luisarojas luisarojas self-assigned this Jul 31, 2024
@luisarojas luisarojas requested a review from hiltol July 31, 2024 04:46
@luisarojas luisarojas added the enhancement New feature or request label Jul 31, 2024
@hiltol hiltol merged commit 5d757dc into master Jul 31, 2024
6 of 7 checks passed
@hiltol hiltol deleted the feat/name-prop-is-instance branch July 31, 2024 15:15
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.

2 participants