Skip to content

Commit

Permalink
feat: added quickstart variation of the DA (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshwarishikha authored Jun 27, 2024
1 parent 3e53b88 commit bc8f7c0
Show file tree
Hide file tree
Showing 19 changed files with 253 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .catalog-onboard-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ offerings:
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
offering_id: 8272d54f-b54f-46a6-8dd6-772c6db82e87
variations:
- name: standard
- name: quickstart
mark_ready: true
install_type: fullstack
scc:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ You need the following permissions to run this module.
| <a name="input_create_timeout"></a> [create\_timeout](#input\_create\_timeout) | The timeout value for creating an Event Streams instance. Specify `3h` for an Enterprise plan instance. Add 1 h for each level of non-default throughput. Add 30 min for each level of non-default storage size. | `string` | `"3h"` | no |
| <a name="input_delete_timeout"></a> [delete\_timeout](#input\_delete\_timeout) | The timeout value for deleting an Event Streams instance. | `string` | `"15m"` | no |
| <a name="input_es_name"></a> [es\_name](#input\_es\_name) | The name to give the Event Streams instance created by this module. | `string` | n/a | yes |
| <a name="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn) | The root key CRN of the key management service (Key Protect or Hyper Protect Crypto Services) to use to encrypt the payload data. Applies only if `kms_encryption_enabled` is set to `true`. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-managing_encryption) about integrating Hyper Protect Crypto Services with Event Streams. Configure an authorization policy to allow the Event Streams service to access the key management service instance with the reader role ([Learn more](https://cloud.ibm.com/docs/account?topic=account-serviceauth)). You can't manage the policy in the same Terraform state file as the Event Streams service instance ([Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-managing_encryption#using\_encryption)). | `string` | `null` | no |
| <a name="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn) | The root key CRN of the key management service (Key Protect or Hyper Protect Crypto Services) to use to encrypt the payload data. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-managing_encryption) about integrating Hyper Protect Crypto Services with Event Streams. Configure an authorization policy to allow the Event Streams service to access the key management service instance with the reader role ([Learn more](https://cloud.ibm.com/docs/account?topic=account-serviceauth)). You can't manage the policy in the same Terraform state file as the Event Streams service instance ([Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-managing_encryption#using\_encryption)). | `string` | `null` | no |
| <a name="input_plan"></a> [plan](#input\_plan) | The plan for the Event Streams instance. Possible values: `lite`, `standard`, `enterprise-3nodes-2tb`. | `string` | `"standard"` | no |
| <a name="input_region"></a> [region](#input\_region) | The region where the Event Streams are created. | `string` | `"us-south"` | no |
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where the Event Streams instance is created. | `string` | n/a | yes |
Expand Down
138 changes: 102 additions & 36 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,113 @@
"fscloud"
],
"short_description": "Supports provisioning and configuring IBM Event Streams for IBM Cloud.",
"long_description": "This architecture supports creating Event Streams with topics, partitions, throughput, storage size, cleanup policy, retention time, retention size, segment size, and schema.",
"long_description": "This architecture supports creation and configuration of IBM Cloud Event Streams.",
"offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-event-streams/blob/main/README.md",
"offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-event-streams/main/images/event_streams.svg",
"provider_name": "IBM",
"features": [
{
"title": "Create IBM Event Streams for IBM Cloud",
"description": "Create IBM Event Streams to build responsive, durable, and highly available architecture deployments."
"description": "Create and configure IBM Event Streams to build responsive, durable, and highly available architecture deployments."
},
{
"title": "Configure Event Streams",
"description": "Creates topics, partitions, throughput, storage size, cleanup policy, retention time, retention size, segment size, and schemas."
},
{
"title": "Create context-based restrictions",
"description": "Enhance cloud security by defining and enforcing access restrictions for Event Streams based on the context of the access request."
"title": "Creates topics in the Event Streams instance",
"description": "Creates topics in IBM Cloud Event Streams instance."
}
],
"flavors": [
{
"label": "standard",
"name": "standard",
"label": "quickstart",
"name": "quickstart",
"install_type": "fullstack",
"working_directory": "solutions/standard",
"compliance": {
"authority": "scc-v3",
"profiles": [
{
"profile_name": "IBM Cloud Framework for Financial Services",
"profile_version": "1.6.0"
}
]
},
"working_directory": "solutions/quickstart",
"configuration": [
{
"key": "ibmcloud_api_key"
},
{
"key": "prefix"
},
{
"key": "use_existing_resource_group"
},
{
"key": "resource_group_name"
},
{
"key": "es_name"
},
{
"key": "region",
"required": true,
"default_value": "",
"options": [
{
"displayname": "Dallas (us-south)",
"value": "us-south"
},
{
"displayname": "Frankfurt (eu-de)",
"value": "eu-de"
},
{
"displayname": "London (eu-gb)",
"value": "eu-gb"
},
{
"displayname": "Madrid (eu-es)",
"value": "eu-es"
},
{
"displayname": "Osaka (jp-osa)",
"value": "jp-osa"
},
{
"displayname": "Sydney (au-syd)",
"value": "au-syd"
},
{
"displayname": "Tokyo (jp-tok)",
"value": "jp-tok"
},
{
"displayname": "Osaka (jp-osa)",
"value": "jp-osa"
},
{
"displayname": "Sao Paulo (br-sao)",
"value": "br-sao"
},
{
"displayname": "Toronto (ca-tor)",
"value": "ca-tor"
},
{
"displayname": "Washington (us-east)",
"value": "us-east"
}
]
},
{
"key": "resource_tags"
},
{
"key": "plan",
"options": [
{
"displayname": "lite",
"value": "lite"
},
{
"displayname": "standard",
"value": "standard"
}
]
},
{
"key": "topics"
}
],
"iam_permissions": [
{
"role_crns": [
Expand All @@ -69,33 +143,25 @@
}
],
"architecture": {
"descriptions": "This architecture creates an Enterprise plan instance of IBM Event Streams for IBM Cloud that is IBM Cloud® Financial Services certified.",
"descriptions": "This architecture creates an instance of IBM Event Streams for IBM Cloud in lite and standard plan. It also supports the creation of topics in the Event Streams instance.",
"features": [
{
"title": "Event Streams instance",
"description": "Yes"
},
{
"title": "KMS encryption to encrypt data",
"description": "Yes"
},
{
"title": "Context-based restriction rules for the Event Streams instance",
"description": "Yes"
"title": "Creates an Event Streams instance",
"description": "Creates and configures the IBM Cloud Event Streams instance."
},
{
"title": "Event Streams topics and schemas",
"description": "Yes"
"title": "Creates topics in the Event Streams instance",
"description": "Creates topics in IBM Cloud Event Streams instance."
}
],
"diagrams": [
{
"diagram": {
"caption": "IBM Event Streams for IBM Cloud Enterprise plan instance that is IBM Cloud® Financial Services certified.",
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-event-streams/main/reference-architecture/da-fscloud.svg",
"caption": "IBM Event Streams for IBM Cloud.",
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-event-streams/main/reference-architecture/da-quickstart.svg",
"type": "image/svg+xml"
},
"description": "This architecture creates an Enterprise plan instance of IBM Event Streams for IBM Cloud that is IBM Cloud® Financial Services certified."
"description": "This architecture creates an instance of IBM Event Streams for IBM Cloud."
}
]
}
Expand Down
4 changes: 0 additions & 4 deletions reference-architecture/da-fscloud.svg

This file was deleted.

4 changes: 4 additions & 0 deletions reference-architecture/da-quickstart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions solutions/quickstart/DA-schemas-topics-cbr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Configuring topics in Event Streams

When you add a Event Streams deployable architecture from the IBM Cloud catalog to IBM Cloud Projects, you can configure topics. When you edit your project configuration, select the **Configure** panel, and then click the **Optional** tab.

To enter a custom value, use the edit action to open the "Edit Array" panel. Add the topics configurations to the array.


## Options with topics

- `name` (required): The name of the topic.
- `partitions` (optional): The number of partitions of the topic. The default value is `1`.
- `config` (optional): The configuration parameters of the topic. Supported configurations are: `cleanup.policy`, `retention.ms`, `retention.bytes`, `segment.bytes`, `segment.ms`, `segment.index.bytes`.

The following example includes all the configuration options for topics.

```hcl
[
{
name = "my-es-topic"
partitions = 1
config = {
"cleanup.policy" = "delete"
"retention.ms" = "86400000"
"retention.bytes" = "10485760"
"segment.bytes" = "10485760"
}
},
{
name = "topic-2"
partitions = 1
config = {
"cleanup.policy" = "compact,delete"
"retention.ms" = "86400000"
"retention.bytes" = "1073741824"
"segment.bytes" = "536870912"
}
}
]
```
11 changes: 11 additions & 0 deletions solutions/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Event Streams on IBM Cloud

This architecture creates an instance of IBM Event Streams for IBM Cloud.

The solution provisions the following resources:

- A resource group, if one is not passed in.
- An Event Streams instance using `lite` or `standard` plan.
- Topics to apply to resources. Only one topic is allowed for `lite` plan instances.

![da-quickstart](../../reference-architecture/da-quickstart.svg)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"ibmcloud_api_key": $VALIDATION_APIKEY,
"resource_tags": $TAGS,
"es_name": $PREFIX,
"kms_key_crn": $HPCS_US_SOUTH_ROOT_KEY_CRN,
"prefix": $PREFIX,
"resource_group_name": $PREFIX
}
22 changes: 22 additions & 0 deletions solutions/quickstart/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#######################################################################################################################
# Resource Group
#######################################################################################################################
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "1.1.6"
resource_group_name = var.use_existing_resource_group == false ? (var.prefix != null ? "${var.prefix}-${var.resource_group_name}" : var.resource_group_name) : null
existing_resource_group_name = var.use_existing_resource_group == true ? var.resource_group_name : null
}

#######################################################################################################################
# Event Streams Instance
#######################################################################################################################
module "event_streams" {
source = "../../"
resource_group_id = module.resource_group.resource_group_id
es_name = var.prefix != null ? "${var.prefix}-${var.es_name}" : var.es_name
plan = var.plan
region = var.region
topics = var.topics
tags = var.resource_tags
}
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions solutions/quickstart/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
variable "ibmcloud_api_key" {
type = string
description = "The IBM Cloud API key."
sensitive = true
}

variable "prefix" {
type = string
description = "Optional. The prefix to append to all resources that this solution creates."
default = null
}

variable "use_existing_resource_group" {
type = bool
description = "Whether to use an existing resource group."
default = false
}

variable "resource_group_name" {
type = string
description = "The name of a new or the existing resource group to provision the Event Streams instance. If a prefix input variable is passed, it is prefixed to the value in the `<prefix>-value` format."
default = null
}

variable "es_name" {
description = "The name of the Event Streams instance to create. If a prefix input variable is passed, it is prefixed to the value in the `<prefix>-value` format."
type = string
default = "event-streams"
}

variable "region" {
type = string
description = "The region where the Event Streams are created."
default = "us-south"
}

variable "resource_tags" {
type = list(string)
description = "The list of tags associated with the Event Streams instance."
default = []
}

variable "plan" {
type = string
description = "The plan for the Event Streams instance. Possible values: `lite` and `standard`."
default = "standard"
validation {
condition = contains(["lite", "standard"], var.plan)
error_message = "The specified plan is not a valid selection! Supported plans are: lite, standard."
}
}

variable "topics" {
type = list(object(
{
name = string
partitions = number
config = object({})
}
))
description = "The list of topics to apply to resources. Only one topic is allowed for Lite plan instances. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-event-streams/tree/main/solutions/quickstart/DA-schemas-topics-cbr.md)."
default = []
}
File renamed without changes.
Loading

0 comments on commit bc8f7c0

Please sign in to comment.