GithubHelp home page GithubHelp logo

ecogit-stage / ssh-key Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloud-schematics/ssh-key

0.0 0.0 0.0 14 KB

Try Schematics by creating an SSH key in IBM Cloud Infrastructure (SoftLayer).

License: MIT License

HCL 100.00%

ssh-key's Introduction

SSH key template

An IBM Cloud Schematics template that creates an IBM Cloud SSH Key (ibm_compute_ssh_key). This template creates am SSH key in the specified IBM Cloud account. This is not a module, it is a Terraform configuration that should be cloned or forked to be used.

Schematics uses Terraform as the infrastructure as code engine. With this template, you can provision and manage infrastructure as a single unit. Note: To create the resources that this template requests, your IBM Cloud Infrastructure (Softlayer) account and IBM Cloud account must have sufficient permissions.

See the Terraform provider docs for available resources for the IBM Cloud.

This configuration template is written for IBM Cloud provider version v0.4.0

Create an environment with this template

Environments can be used to separate software components into development tiers (e.g. staging, QA, and production).

  1. In IBM Cloud, go to the menu and select the Schematics dashboard.
  2. In the left navigation menu, select Templates to access the template catalog.
  3. Click Create on the SSH key template. You are taken to a configuration page where you can define metadata about your environment.
  4. Define values for your variables according to the following table.

Variables

Variable Name Description Default Value
bxapikey Your IBM Cloud API key. You can get the value by running bx iam api-key-create <key name>.
datacenter The data center for the SSH key. You can run bluemix cs locations to see a list of all data centers in your region.
key_label An identifying label to assign to the SSH key.
key_note Notes to store with the SSH key.
public_key The public key contents for the SSH keypair.
slapikey Your IBM Cloud Infrastructure (SoftLayer) API key.
slusername Your IBM Cloud Infrastructure (SoftLayer) user name.

Next steps

After setting up your environment with this template, you can run Plan to preview how Schematics will deploy resources to your environment. When you are ready to deploy the cluster, run Apply.

Using the Terraform binary on your local workstation

You will need to set up up IBM Cloud provider credentials on your local machine. Then you will need the Terraform binary and the IBM Cloud Provider Plugin. Then follow the instructions at https://ibm-bluemix.github.io/tf-ibm-docs/v0.4.0/#developing-locally.

To run this project locally, complete the following steps:

Available data centers

You can run bluemix cs locations to see a list of all data centers in your region.

Running in multiple data centers

You can run terraform plan -var 'datacenter=lon02' -state=lon02.tfstate or whatever your preferred data center is (replace lon02 for both arguments), and repeat for terraform apply with the same arguments.

Setting up provider credentials

To set up the IBM Cloud provider to work with this example there are a few options for managing credentials safely. The preferred method is using environment variables. See the Terraform variable documentation for other methods.

Exporting environment variables using IBMid credentials

You'll need to export the following environment variables:

  • TF_VAR_bxapikey - Your IBM Cloud API Key
  • TF_VAR_slusername - Your IBM Cloud Infrastructure (SoftLayer) username
  • TF_VAR_slapikey - Your IBM Cloud Infrastructure user name.

On OS X, you can enter the following commands into your terminal:

  • export TF_VAR_bxapikey=<value>
  • export TF_VAR_slusername=<value>
  • export TF_VAR_slapikey=<value>

This is only temporary to your current terminal session. To make this permanent, add these export statements to your ~/.profile, ~/.bashrc, ~/.bash_profile or preferred terminal configuration file. If you go this route without running export ... in your command prompt, you'll need to source your terminal configuration file from the command prompt like so: source ~/.bashrc (or your preferred config file).

License

MIT; see LICENSE for details.

ssh-key's People

Contributors

davetropeano avatar ruediger-maass avatar rachael-graham avatar

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.