-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding OpenPages as part of UX030 (#5051)
* add openpages service * fix comments and add sample data parameter * fix readme sample data example
- Loading branch information
1 parent
134c7bd
commit d24bb72
Showing
7 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# OpenPages example | ||
|
||
This example shows 1 usage scenario. | ||
|
||
#### Scenario 1: Create an OpenPages service instance. | ||
|
||
```terraform | ||
resource "ibm_resource_instance" "openpages_instance" { | ||
name = "terraform-automation" | ||
service = "openpages" | ||
plan = "essentials" | ||
location = "global" | ||
resource_group_id = data.ibm_resource_group.default_group.id | ||
parameters_json = <<EOF | ||
{ | ||
"aws_region": "us-east-1", | ||
"baseCurrency": "USD", | ||
"initialContentType": "_no_samples", | ||
"selectedSolutions": ["ORM"] | ||
} | ||
EOF | ||
timeouts { | ||
create = "200m" | ||
} | ||
} | ||
To provison your instance with the correct configuration, update the `parameters_json` field with the appropriate values. | ||
``` | ||
|
||
## Dependencies | ||
|
||
- The owner of the `ibmcloud_api_key` has permission to create an OpenPages instance under the specified resource group. | ||
|
||
## Configuration | ||
|
||
- `ibmcloud_api_key` - An API key for IBM Cloud services. If you don't have one already, go to https://cloud.ibm.com/iam/#/apikeys and create a new key. | ||
|
||
## Running the configuration | ||
|
||
For the planning phase | ||
|
||
```bash | ||
terraform init | ||
terraform plan | ||
``` | ||
|
||
For the apply phase | ||
|
||
```bash | ||
terraform apply | ||
``` | ||
|
||
For the destroy | ||
|
||
```bash | ||
terraform destroy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
data "ibm_resource_group" "default_group" { | ||
is_default = true | ||
} | ||
|
||
resource "ibm_resource_instance" "openpages_instance" { | ||
name = "terraform-automation" | ||
service = "openpages" | ||
plan = "essentials" | ||
location = "global" | ||
resource_group_id = data.ibm_resource_group.default_group.id | ||
parameters_json = <<EOF | ||
{ | ||
"aws_region": "us-east-1", | ||
"baseCurrency": "USD", | ||
"initialContentType": "_no_samples", | ||
"selectedSolutions": ["ORM"] | ||
} | ||
EOF | ||
|
||
timeouts { | ||
create = "200m" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
provider "ibm" { | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
region = var.region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Enter your IBM Cloud API Key. If you don't have one already, go to IBM Cloud to get an API Key: https://cloud.ibm.com/iam#/apikeys | ||
# Use the global region | ||
ibmcloud_api_key = "" | ||
region = "global" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
variable "ibmcloud_api_key" { | ||
description = "IBM Cloud API key" | ||
type = string | ||
} | ||
|
||
variable "region" { | ||
description = "Region" | ||
type = string | ||
default = "global" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
ibm = { | ||
source = "IBM-Cloud/ibm", | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters