Skip to content

Commit

Permalink
add provision parameters in event streams sample
Browse files Browse the repository at this point in the history
  • Loading branch information
JunliWang authored and hkantare committed Aug 11, 2020
1 parent 3b885d5 commit ee41397
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
25 changes: 20 additions & 5 deletions examples/ibm-event-streams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
This example shows 3 usage scenarios.

#### Scenario 1: Create an Event Streams service instance and topic.

```hcl
resource "ibm_resource_instance" "es_instance_1" {
name = "terraform-integration-1"
service = "messagehub"
plan = "standard" # "lite", "enterprise-3nodes-2tb"
location = "us-south" # "us-east", "eu-gb", "eu-de", "jp-tok", "au-syd"
resource_group_id = data.ibm_resource_group.group.id
# parameters = {
# service-endpoint = "private" # for enterprise instance
# private_ip_allowlist = ["1.0.0.0/32", "1.0.0.1/32"] # for enterprise instance
# }
# timeouts {
# create = "15m" # use 3h when creating enterprise instance
# update = "15m" # use 1h when updating enterprise instance
# delete = "15m"
# }
}
resource "ibm_event_streams_topic" "es_topic_1" {
Expand All @@ -26,6 +38,7 @@ resource "ibm_event_streams_topic" "es_topic_1" {
```

#### Scenario 2: Create a topic on an existing Event Streams instance.

```hcl
data "ibm_resource_instance" "es_instance_2" {
name = "terraform-integration-2"
Expand All @@ -46,6 +59,7 @@ resource "ibm_event_streams_topic" "es_topic_2" {
```

#### Scenario 3: Create a kafka consumer application connecting to an existing Event Streams instance and its topics.

```hcl
data "ibm_resource_instance" "es_instance_3" {
name = "terraform-integration-3"
Expand All @@ -64,16 +78,17 @@ resource "kafka_consumer_app" "es_kafka_app" {
}
```


## Dependencies

- The owner of the `ibmcloud_api_key` has permission to create Event Streams instance under specified resource group and has Manager role to the created instance in order to create topic.

## 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.
## 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.

* `es_reader_api_key` - An service ID API key with reduced permission in scenario 3 if user wish to scope the access to Event Streams instance and topics.
- `es_reader_api_key` - An service ID API key with reduced permission in scenario 3 if user wish to scope the access to Event Streams instance and topics.

## Running the configuration
## Running the configuration

For planning phase

Expand Down
11 changes: 11 additions & 0 deletions examples/ibm-event-streams/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ resource "ibm_resource_instance" "es_instance_1" {
plan = "standard" # "lite", "enterprise-3nodes-2tb"
location = "us-south" # "us-east", "eu-gb", "eu-de", "jp-tok", "au-syd"
resource_group_id = data.ibm_resource_group.group.id

# parameters = {
# service-endpoint = "private" # for enterprise instance
# private_ip_allowlist = ["1.0.0.0/32", "1.0.0.1/32"] # for enterprise instance
# }

# timeouts {
# create = "15m" # use 3h when creating enterprise instance
# update = "15m" # use 1h when updating enterprise instance
# delete = "15m"
# }
}

resource "ibm_event_streams_topic" "es_topic_1" {
Expand Down

0 comments on commit ee41397

Please sign in to comment.