Skip to content

Commit 02debee

Browse files
Fixed variable name for ibmcloud api key
1 parent 2e40448 commit 02debee

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# SSH key template
22

3-
An [IBM Cloud Schematics](https://console.bluemix.net/docs/services/schematics/index.html) template that creates an [IBM Cloud SSH Key](https://ibm-bluemix.github.io/tf-ibm-docs/v0.4.0/r/compute_ssh_key.html) (`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.
3+
An [IBM Cloud Schematics](https://cloud.ibm.com/docs/services/schematics/) template that creates an [IBM Cloud SSH Key](https://ibm-cloud.github.io/tf-ibm-docs/v0.17.3/r/compute_ssh_key.html) (`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.
44

5-
Schematics uses [Terraform](https://www.terraform.io/) 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](https://console.bluemix.net/docs/iam/mnginfra.html#managing-infrastructure-access) and [IBM Cloud account](https://console.bluemix.net/docs/iam/mngiam.html#iammanidaccser) must have sufficient permissions.
5+
Schematics uses [Terraform](https://www.terraform.io/) 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](https://cloud.ibm.com/docs/iam?topic=iam-mngclassicinfra#managing-infrastructure-access) and [IBM Cloud account](https://cloud.ibm.com/docs/iam?topic=iam-iammanidaccser#iammanidaccser) must have sufficient permissions.
66

7-
See the [Terraform provider docs](https://ibm-bluemix.github.io/tf-ibm-docs/) for available resources for the IBM Cloud.
7+
See the [Terraform provider docs](https://ibm-cloud.github.io/tf-ibm-docs/) for available resources for the IBM Cloud.
88

99
**This configuration template is written for IBM Cloud provider version `v0.4.0`**
1010

1111
## Create an environment with this template
1212

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

15-
1. In IBM Cloud, go to the menu and select the [Schematics dashboard](https://console.bluemix.net/schematics).
15+
1. In IBM Cloud, go to the menu and select the [Schematics dashboard](https://cloud.ibm.com/schematics).
1616
2. In the left navigation menu, select **Templates** to access the template catalog.
1717
3. Click **Create** on the SSH key template. You are taken to a configuration page where you can define metadata about your environment.
1818
4. Define values for your variables according to the following table.
@@ -21,8 +21,8 @@ Environments can be used to separate software components into development tiers
2121

2222
|Variable Name|Description|Default Value|
2323
|-------------|-----------|-------------|
24-
|bxapikey|Your IBM Cloud API key. You can get the value by running `bx iam api-key-create <key name>`.||
25-
|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.||
24+
|icapikey|Your IBM Cloud API key. You can get the value by running `ic iam api-key-create <key name>`.||
25+
|datacenter|The data center for the SSH key. You can run `ic cs zones` to see a list of all data centers in your region.||
2626
|key_label|An identifying label to assign to the SSH key.||
2727
|key_note|Notes to store with the SSH key. | |
2828
|public_key|The public key contents for the SSH keypair. | |
@@ -34,7 +34,7 @@ Environments can be used to separate software components into development tiers
3434
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**.
3535

3636
## Using the Terraform binary on your local workstation
37-
You will need to [set up up IBM Cloud provider credentials](#setting-up-provider-credentials) on your local machine. Then you will need the [Terraform binary](https://www.terraform.io/intro/getting-started/install.html) and the [IBM Cloud Provider Plugin](https://github.com/IBM-Bluemix/terraform/releases). Then follow the instructions at [https://ibm-bluemix.github.io/tf-ibm-docs/v0.4.0/#developing-locally](https://ibm-bluemix.github.io/tf-ibm-docs/v0.4.0/#developing-locally).
37+
You will need to [set up up IBM Cloud provider credentials](#setting-up-provider-credentials) on your local machine. Then you will need the [Terraform binary](https://www.terraform.io/intro/getting-started/install.html) and the [IBM Cloud Provider Plugin](https://github.com/IBM-Cloud/terraform-provider-ibm/releases/). Then follow the instructions at [https://github.com/IBM-Cloud/terraform-provider-ibm.git](https://github.com/IBM-Cloud/terraform-provider-ibm.git).
3838

3939
To run this project locally, complete the following steps:
4040

@@ -44,11 +44,11 @@ To run this project locally, complete the following steps:
4444
- `terraform plan`: This command performs a dry run to show what infrastructure Terraform intends to create.
4545
- `terraform apply`: This command creates actual infrastructure.
4646
- Infrastructure can be seen in IBM Cloud under the following URLs:
47-
- SSH keys: https://control.bluemix.net/devices/sshkeys
47+
- SSH keys: https://cloud.ibm.com/classic/devices/sshkeys
4848
- `terraform destroy`: This command destroy all infrastructure that has been created.
4949

5050
### Available data centers
51-
You can run `bluemix cs locations` to see a list of all data centers in your region.
51+
You can run `ic cs zones` to see a list of all data centers in your region.
5252

5353
### Running in multiple data centers
5454
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.
@@ -59,15 +59,15 @@ To set up the IBM Cloud provider to work with this example there are a few optio
5959
### Exporting environment variables using IBMid credentials
6060
You'll need to export the following environment variables:
6161

62-
- `TF_VAR_bxapikey` - Your IBM Cloud API Key
63-
- `TF_VAR_slusername` - Your IBM Cloud Infrastructure (SoftLayer) username
64-
- `TF_VAR_slapikey` - Your IBM Cloud Infrastructure user name.
62+
- `IC_API_KEY` - Your IBM Cloud API Key
63+
- `SL_USERNAME` - Your IBM Cloud Infrastructure (SoftLayer) username
64+
- `SL_API_KEY` - Your IBM Cloud Infrastructure user name.
6565

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

68-
- `export TF_VAR_bxapikey=<value>`
69-
- `export TF_VAR_slusername=<value>`
70-
- `export TF_VAR_slapikey=<value>`
68+
- `export IC_API_KEY=<value>`
69+
- `export SL_USERNAME=<value>`
70+
- `export SL_API_KEY=<value>`
7171

7272
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).
7373

main.tf

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
terraform {
55
required_version = ">= 0.9.3"
66
}
7+
78
##############################################################################
89
# IBM Cloud Provider
910
##############################################################################
1011
# See the README for details on ways to supply these values
1112
provider "ibm" {
12-
bluemix_api_key = "${var.bxapikey}"
13+
ibmcloud_api_key = "${var.icapikey}"
1314
softlayer_username = "${var.slusername}"
14-
softlayer_api_key = "${var.slapikey}"
15+
softlayer_api_key = "${var.slapikey}"
1516
}
1617

1718
##############################################################################
@@ -20,31 +21,38 @@ provider "ibm" {
2021
resource "ibm_compute_ssh_key" "ssh_key" {
2122
label = "${var.key_label}"
2223
notes = "${var.key_note}"
24+
2325
# Public key, so this is completely safe
2426
public_key = "${var.public_key}"
2527
}
2628

2729
##############################################################################
2830
# Variables
2931
##############################################################################
30-
variable bxapikey {
32+
variable icapikey {
3133
description = "Your IBM Cloud API key. You can create an API key by running bx iam api-key-create <key name>."
3234
}
35+
3336
variable slusername {
3437
description = "Your IBM Cloud Infrastructure (SoftLayer) user name."
3538
}
39+
3640
variable slapikey {
3741
description = "Your IBM Cloud Infrastructure (SoftLayer) API key."
3842
}
43+
3944
variable datacenter {
4045
description = "The data center that you want to create resources in. You can run bluemix cs locations to see a list of all data centers in your region."
4146
}
47+
4248
variable public_key {
4349
description = "The public key material for the SSH keypair."
4450
}
51+
4552
variable key_label {
4653
description = "An identifying label to assign to the SSH key."
4754
}
55+
4856
variable key_note {
4957
description = "Notes to store with the SSH key."
5058
}

0 commit comments

Comments
 (0)