1.15.0 • Published 2 years ago

@skorfmann/terraform-cloud v1.15.0

Weekly downloads
2,490
License
MIT
Repository
github
Last release
2 years ago

terraform-cloud

@latest Build Status Maintainability Test Coverage Try terraform-cloud on RunKit

Terraform Cloud REST API client for javascript.

NOTE: This is a work in progress, please review the current implementation.

Instalation

yarn add terraform-cloud # With Yarn
npm install terraform-cloud # With NPM

Usage

import { TerraformCloud } from 'terraform-cloud'

// Set a your terraform cloud API token
const { Account, Plans, Runs } = new TerraformCloud('terraform-api-token')

// Make an API call

// Get Account Information
Account.getDetails().then(account => {
  // handle account data
})

// Update Account Password
const updatePasswordRequest = {
  data: {
    type: 'user',
    attributes: {
      current_password: 'current-password',
      password: 'new-password',
      password_confirmation: 'new-password',
    },
  },
}

Account.updatePassword(updatePasswordRequest).then(user => {
  // handle account password update
})

Plans.show('plan-id').then(plan => {
  // handle plan data
})

// Runs

Runs.show('run-id').then(run => {
  // handle run data
})

// Perform an action over a run ex: (apply, cancel, discard, force-cancel, force-execute)
Runs.action('cancel', 'run-id', { data: { comment: 'cancel run by id' } }).then(() => {
  // handle run action
})

Current implementation

TODO

  • Workspaces
  • ...

Contributing

We would love you to contribute to terraform-cloud, pull requests are very welcome! Please see CONTRIBUTING.md for more information.

LICENSE

MIT

1.15.0

2 years ago

1.14.0

2 years ago

1.13.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago