Git Product home page Git Product logo

terraform-provider-ibm's Introduction

Terraform Provider

Requirements

  • Terraform 0.10.1+
  • Go 1.16 (to build the provider plugin)

Building The Provider

Clone repository

git clone [email protected]:IBM-Cloud/terraform-provider-ibm.git

Enter the provider directory and build the provider

cd terraform-provider-ibm
make build

Docker Image For The Provider

You can also pull the docker image for the ibmcloud terraform provider :

docker pull ibmterraform/terraform-provider-ibm-docker

Download the Provider from the Terraform Registry (Option 1)

Complete the following steps to configure the IBM Cloud provider plug-in for Terraform v0.13 and newer versions.

  1. Download and install Terraform for your system.

  2. Create a versions.tf file in in your Terraform module folder and add a terraform block using the syntax below. Note, you must be using Terraform v0.13.x or a newer version.

 terraform {
   required_providers {
      ibm = {
         source = "IBM-Cloud/ibm"
         version = "<provider version>"
      }
    }
  }
  1. Run terraform init to fetch the IBM Cloud provider plug-in for Terraform from the Terraform Registry.

Download the Provider Manually (Option 2)

If you want to run Terraform with the IBM Cloud provider plugin on your system, complete the following steps:

  1. Download and install Terraform for your system.

  2. Download the IBM Cloud provider plugin for Terraform.

  3. Unzip the release archive to extract the plugin binary (terraform-provider-ibm_vX.Y.Z).

  4. Move the binary into the Terraform plugins directory for the platform.

    • Linux/Unix/OS X: ~/.terraform.d/plugins
    • Windows: %APPDATA%\terraform.d\plugins
  5. Export API credential tokens as environment variables. This can either be IBM Cloud API keys or Softlayer API keys and usernames, depending on the resources you are provisioning.

export IC_API_KEY="IBM Cloud API Key"
export IAAS_CLASSIC_API_KEY="IBM Cloud Classic Infrastructure API Key"
export IAAS_CLASSIC_USERNAME="IBM Cloud Classic Infrastructure username associated with Classic Infrastructure API KEY".
  1. Add the plug-in provider to the Terraform configuration file.
provider "ibm" {}

See the official documentation for more details on using the IBM provider.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

make build
...
$GOPATH/bin/terraform-provider-ibm
...

In order to test the provider, you can simply run make test.

make test

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

make testacc

In order to run a particular Acceptance test, export the variable TESTARGS. For example

export TESTARGS="-run TestAccIBMNetworkVlan_Basic"

Issuing make testacc will now run the testcase with names matching TestAccIBMNetworkVlan_Basic. This particular testcase is present in ibm/resource_ibm_network_vlan_test.go

You will also need to export the following environment variables for running the Acceptance tests.

  • IC_API_KEY- The IBM Cloud API Key
  • IAAS_CLASSIC_API_KEY - The IBM Cloud Classic Infrastructure API Key
  • IAAS_CLASSIC_USERNAME - The IBM Cloud Classic Infrastructure username associated with the Classic InfrastAPI Key.

Additional environment variables may be required depending on the tests being run. Check console log for warning messages about required variables.

IBM Cloud Ansible Modules

An implementation of generated Ansible modules using the IBM Cloud Terraform Provider.

Prerequisites

  1. Install Python3

  2. RedHat Ansible 2.8+

    pip install "ansible>=2.8.0"
    

Install

  1. Download IBM Cloud Ansible modules from release page

  2. Extract module archive.

    unzip ibmcloud_ansible_modules.zip
    
  3. Add modules and module_utils to the Ansible search path. E.g.:

    cp build/modules/* $HOME/.ansible/plugins/modules/.
    cp build/module_utils/* $HOME/.ansible/plugins/module_utils/.
    
    

Example Projects

  1. VPC Virtual Server Instance

  2. Power Virtual Server Instance

terraform-provider-ibm's People

Contributors

anil-cm avatar anilkumarnagaraj avatar ashishth09 avatar astha-jain avatar deepaksibm avatar geethasathyamurthy avatar harshit777 avatar hasueki avatar hkantare avatar jsloyer avatar junliwang avatar kavya498 avatar kumarganesanibm avatar malarvizhik avatar mayukh-sarkar-1 avatar nimisha0092 avatar odaira avatar praveengostu avatar sakshan1 avatar sakshiag avatar smjtd avatar sunithagudisagaribm avatar sunithagudisagaribm1 avatar surajibm avatar testpod-source-p avatar ujjwal-ibm avatar umarali-nagoor avatar vaishnavigopal avatar vkalangu avatar wderezin avatar

terraform-provider-ibm's Issues

CVE-2017-16119 (High) detected in fresh-0.2.4.tgz

CVE-2017-16119 - High Severity Vulnerability

Vulnerable Library - fresh-0.2.4.tgz

HTTP response freshness testing

Library home page: https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/fresh/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/fresh/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • fresh-0.2.4.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

Fresh is a module used by the Express.js framework for HTTP response freshness testing. It is vulnerable to a regular expression denial of service when it is passed specially crafted input to parse. This causes the event loop to be blocked causing a denial of service condition.

Publish Date: 2018-06-07

URL: CVE-2017-16119

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.npmjs.com/advisories/526

Release Date: 2018-06-07

Fix Resolution: fresh - 0.5.2

CVE-2017-16138 (High) detected in mime-1.3.4.tgz

CVE-2017-16138 - High Severity Vulnerability

Vulnerable Library - mime-1.3.4.tgz

A comprehensive library for mime-type mapping

Library home page: https://registry.npmjs.org/mime/-/mime-1.3.4.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/mime/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/mime/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • send-0.12.3.tgz
      • mime-1.3.4.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

The mime module < 1.4.1, 2.0.1, 2.0.2 is vulnerable to regular expression denial of service when a mime lookup is performed on untrusted user input.

Publish Date: 2018-06-07

URL: CVE-2017-16138

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16138

Release Date: 2018-06-07

Fix Resolution: 1.4.1,2.0.3

CVE-2017-16137 (Medium) detected in debug-2.2.0.tgz

CVE-2017-16137 - Medium Severity Vulnerability

Vulnerable Library - debug-2.2.0.tgz

small debugging utility

Library home page: https://registry.npmjs.org/debug/-/debug-2.2.0.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/debug/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/debug/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • debug-2.2.0.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the o formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.

Publish Date: 2018-06-07

URL: CVE-2017-16137

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-16137

Release Date: 2018-06-07

Fix Resolution: 2.6.9

WS-2017-0247 (Low) detected in ms-0.7.1.tgz

WS-2017-0247 - Low Severity Vulnerability

Vulnerable Library - ms-0.7.1.tgz

Tiny ms conversion utility

Library home page: https://registry.npmjs.org/ms/-/ms-0.7.1.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/ms/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/ms/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • debug-2.2.0.tgz
      • ms-0.7.1.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS).

Publish Date: 2017-04-12

URL: WS-2017-0247

CVSS 2 Score Details (3.4)

Base Score Metrics not available

Suggested Fix

Type: Upgrade version

Origin: vercel/ms#89

Release Date: 2017-04-12

Fix Resolution: 2.1.1

WS-2019-0032 (High) detected in js-yaml-3.7.0.tgz

WS-2019-0032 - High Severity Vulnerability

Vulnerable Library - js-yaml-3.7.0.tgz

YAML 1.2 parser and serializer

Library home page: https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/js-yaml/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/js-yaml/package.json

Dependency Hierarchy:

  • cfenv-1.0.4.tgz (Root Library)
    • js-yaml-3.7.0.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

Versions js-yaml prior to 3.13.0 are vulnerable to Denial of Service. By parsing a carefully-crafted YAML file, the node process stalls and may exhaust system resources leading to a Denial of Service.

Publish Date: 2019-03-20

URL: WS-2019-0032

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.npmjs.com/advisories/788/versions

Release Date: 2019-03-20

Fix Resolution: js-yaml - 3.13.0

CVE-2017-1000048 (High) detected in qs-2.4.2.tgz

CVE-2017-1000048 - High Severity Vulnerability

Vulnerable Library - qs-2.4.2.tgz

A querystring parser that supports nesting and arrays, with a depth limit

Library home page: https://registry.npmjs.org/qs/-/qs-2.4.2.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/qs/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/qs/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • qs-2.4.2.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

the web framework using ljharb's qs module older than v6.3.2, v6.2.3, v6.1.2, and v6.0.4 is vulnerable to a DoS. A malicious user can send a evil request to cause the web framework crash.

Publish Date: 2017-07-17

URL: CVE-2017-1000048

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000048

Release Date: 2017-07-17

Fix Resolution: qs - 6.0.4,6.1.2,6.2.3,6.3.2

CVE-2021-23358 (High) detected in underscore-1.8.3.tgz

CVE-2021-23358 - High Severity Vulnerability

Vulnerable Library - underscore-1.8.3.tgz

JavaScript's functional programming helper library.

Library home page: https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/underscore/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/underscore/package.json

Dependency Hierarchy:

  • cfenv-1.0.4.tgz (Root Library)
    • underscore-1.8.3.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

The package underscore from 1.13.0-0 and before 1.13.0-2, from 1.3.2 and before 1.12.1 are vulnerable to Arbitrary Code Injection via the template function, particularly when a variable property is passed as an argument as it is not sanitized.

Publish Date: 2021-03-29

URL: CVE-2021-23358

CVSS 3 Score Details (7.2)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: High
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23358

Release Date: 2021-03-29

Fix Resolution: underscore - 1.12.1,1.13.0-2

CVE-2016-10539 (High) detected in negotiator-0.5.3.tgz

CVE-2016-10539 - High Severity Vulnerability

Vulnerable Library - negotiator-0.5.3.tgz

HTTP content negotiation

Library home page: https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/negotiator/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/negotiator/package.json

Dependency Hierarchy:

  • express-4.12.4.tgz (Root Library)
    • accepts-1.2.13.tgz
      • negotiator-0.5.3.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

negotiator is an HTTP content negotiator for Node.js and is used by many modules and frameworks including Express and Koa. The header for "Accept-Language", when parsed by negotiator 0.6.0 and earlier is vulnerable to Regular Expression Denial of Service via a specially crafted string.

Publish Date: 2018-05-31

URL: CVE-2016-10539

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.npmjs.com/advisories/106

Release Date: 2018-05-31

Fix Resolution: 0.6.1

WS-2019-0063 (High) detected in js-yaml-3.7.0.tgz

WS-2019-0063 - High Severity Vulnerability

Vulnerable Library - js-yaml-3.7.0.tgz

YAML 1.2 parser and serializer

Library home page: https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz

Path to dependency file: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/package.json

Path to vulnerable library: terraform-provider-ibm_depth_0/ibm/test-fixtures/app1/node_modules/js-yaml/package.json,terraform-provider-ibm_depth_0/ibm/test-fixtures/app2/node_modules/js-yaml/package.json

Dependency Hierarchy:

  • cfenv-1.0.4.tgz (Root Library)
    • js-yaml-3.7.0.tgz (Vulnerable Library)

Found in HEAD commit: 6e52527cd0dbe3409c04cafa7aaad3df375e13c9

Found in base branch: master

Vulnerability Details

Js-yaml prior to 3.13.1 are vulnerable to Code Injection. The load() function may execute arbitrary code injected through a malicious YAML file.

Publish Date: 2019-04-05

URL: WS-2019-0063

CVSS 2 Score Details (8.0)

Base Score Metrics not available

Suggested Fix

Type: Upgrade version

Origin: https://www.npmjs.com/advisories/813

Release Date: 2019-04-05

Fix Resolution: js-yaml - 3.13.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.