GithubHelp home page GithubHelp logo

hkantare / ibmcloud-terraform-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloud-design-dev/terraform-ibmcloud-examples

0.0 0.0 1.0 54 KB

Examples on using Terraform with IBM Cloud

License: MIT License

HCL 83.69% Shell 15.77% HTML 0.53%

ibmcloud-terraform-examples's Introduction

Prerequisites

Configure Terraform

Create a ~/.terraformrc file that points to the Terraform binary. For example if you installed the binary to /usr/local/bin/terraform-provider-ibm the ~/.terraformrc would look like this:

providers {
    ibm = "/usr/local/bin/terraform-provider-ibm"
}

Configure Plugin to work with Terraform

To provide your credentials as environment variables, you can use the following code in your provider.tf file. Please Note: for the Kubernetes example you also need to add the region to the provider.tf file.

provider "ibm" {
   bluemix_api_key    = "${var.ibm_bx_api_key}"
   softlayer_username = "${var.ibm_sl_username}"
   softlayer_api_key  = "${var.ibm_sl_api_key}"
}

Be sure to also define the following variables in your var.tf files:

variable ibm_bx_api_key {}
variable ibm_sl_username {}
variable ibm_sl_api_key {}
variable ibm_account_guid {}
variable ibm_org_guid {}
variable ibm_space_guid {}

If you do not know your IBM Account/Org/Space GUID you can run the following commands to obtain them:

# Get account guid 
$ ibmcloud iam accounts

# Get Org guid
$ ibmcloud iam orgs --guid

# Get Space guid
$ ibmcloud iam space <SPACE NAME> --guid

With those gathered you can now export your environmental variables for use with Terraform.

export TF_VAR_ibm_bx_api_key="$VALUE"
export TF_VAR_ibm_sl_username="$VALUE"
export TF_VAR_ibm_sl_api_key="$VALUE"
export TF_VAR_ibm_account_guid="$VALUE"
export TF_VAR_ibm_org_guid="$VALUE"
export TF_VAR_ibm_space_guid="$VALUE"

Examples

ibmcloud-terraform-examples's People

Contributors

greyhoundforty avatar hkantare avatar

Forkers

akhiljain23

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.