generated from terraform-ibm-modules/terraform-ibm-module-template
- Notifications
You must be signed in to change notification settings - Fork 6
feat: added fscloud profile #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits Select commit Hold shift + click to select a range
b6a7564 feat: added fscloud profile
Ak-sky 8b29f34 feat: fixed pr_test
Ak-sky 3c642cd feat: fixed pr_test
Ak-sky bf390d5 feat: fixed ci env vars
Ak-sky 90bc1a4 feat: added kms_encryption_enabled variable and cra ignore
Ak-sky 9c4484f feat: fscloud profile fixes
Ak-sky 03eabd4 Merge branch 'main' into es-fscloud
Ak-sky ab1cf2e feat: fscloud profile fixes
Ak-sky 9014cf7 Merge branch 'main' into es-fscloud
Ak-sky decb6dd feat: fscloud profile fixes
Ak-sky d54c1a3 feat: fscloud profile fixes
Ak-sky e07df40 feat: fscloud profile fixes
Ak-sky 7ef88a3 Merge branch 'es-fscloud' of github.com:terraform-ibm-modules/terrafo…
Ak-sky 1e9433e refactor: added standard plan for basic ex.
Ak-sky 465a5a1 refactor: removed rule form ignore file (CRA v1.36)
Ak-sky a277093 Revert "refactor: removed rule form ignore file (CRA v1.36)"
Ak-sky c742a09 refactor: addressed the review comments
Ak-sky b70d544 Merge branch 'main' into es-fscloud
Ak-sky bf87ba2 Merge branch 'es-fscloud' of github.com:terraform-ibm-modules/terrafo…
Ak-sky 200ec56 refactor: addressed the review comments
Ak-sky 1bda608 refactor: addressed the review comments
Ak-sky 069d940 refactor: addressed the review comments
Ak-sky 1e91667 doc: addressed review comments
Ak-sky 091dfec doc: addressed review comments
Ak-sky 1acf14d refactor: removed cbr from complete ex and skipping upgrade test
Ak-sky a7509ef refactor: added the complete ex back in pr test
Ak-sky 4b09014 refactor: modified readme
Ak-sky 8cad5fa refactor: modified complete ex and SKIP UPGRADE TEST due to CBR in ma…
Ak-sky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| # Complete example with BYOK encryption and CBR rules | ||
| # Complete example with topics and schema creation and BYOK encryption | ||
| | ||
| An end-to-end example that creates an event streams instance with key protect. | ||
| This example uses the IBM Cloud terraform provider to: | ||
| - Create a new resource group if one is not passed in. | ||
| - Create a Key Protect instance and root key in the provided region. | ||
| - Create a new event streams instance in the resource group and region provided, encrypted with the root key created above, and configured with topics and schemas. | ||
| - A context-based restriction (CBR) rule to only allow Event Streams to be accessible from within the VPC. |
This file contains hidden or 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
This file contains hidden or 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,17 @@ | ||
| # Financial Services Cloud profile example | ||
| | ||
| An end-to-end example that uses the [Profile for IBM Cloud Framework for Financial Services](../../profiles/fscloud/) to deploy an instance of Event Streams. | ||
| | ||
| The example uses the IBM Cloud Terraform provider to create the following infrastructure: | ||
| | ||
| - A resource group, if one is not passed in. | ||
| - An IAM authorization between all Event Stream instances in the given resource group and the Hyper Protect Crypto Services instance that is passed in. | ||
| - An Event Streams instance that is encrypted with the Hyper Protect Crypto Services root key that is passed in. | ||
| - A sample virtual private cloud (VPC). | ||
| - A context-based restriction (CBR) rule to only allow Event Streams to be accessible from within the VPC. | ||
| | ||
| :exclamation: **Important:** In this example, only the Event Streams instance complies with the IBM Cloud Framework for Financial Services. Other parts of the infrastructure do not necessarily comply. | ||
| | ||
| ## Before you begin | ||
| | ||
| - You need a Hyper Protect Crypto Services instance and root key available in the region that you want to deploy your Event Streams instance to. |
This file contains hidden or 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,82 @@ | ||
| ############################################################################## | ||
| # Resource Group | ||
| ############################################################################## | ||
| | ||
| module "resource_group" { | ||
| source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-resource-group.git?ref=v1.0.5" | ||
| # if an existing resource group is not set (null) create a new one using prefix | ||
| resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null | ||
| existing_resource_group_name = var.resource_group | ||
| } | ||
| | ||
| ############################################################################## | ||
| # Get Cloud Account ID | ||
| ############################################################################## | ||
| | ||
| data "ibm_iam_account_settings" "iam_account_settings" { | ||
| } | ||
| | ||
| ############################################################################## | ||
| # VPC | ||
| ############################################################################## | ||
| resource "ibm_is_vpc" "example_vpc" { | ||
| name = "${var.prefix}-vpc" | ||
| resource_group = module.resource_group.resource_group_id | ||
| tags = var.resource_tags | ||
| } | ||
| | ||
Ak-sky marked this conversation as resolved. Show resolved Hide resolved | ||
| resource "ibm_is_subnet" "testacc_subnet" { | ||
| name = "${var.prefix}-subnet" | ||
| vpc = ibm_is_vpc.example_vpc.id | ||
| zone = "${var.region}-1" | ||
| total_ipv4_address_count = 256 | ||
| resource_group = module.resource_group.resource_group_id | ||
| } | ||
| | ||
| ############################################################################## | ||
| # Create CBR Zone | ||
| ############################################################################## | ||
| module "cbr_zone" { | ||
| source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-cbr//cbr-zone-module?ref=v1.2.0" | ||
| name = "${var.prefix}-VPC-network-zone" | ||
| zone_description = "CBR Network zone representing VPC" | ||
| account_id = data.ibm_iam_account_settings.iam_account_settings.account_id | ||
| addresses = [{ | ||
| type = "vpc", # to bind a specific vpc to the zone | ||
| value = ibm_is_vpc.example_vpc.crn, | ||
| }] | ||
| } | ||
| | ||
| | ||
| # ############################################################################# | ||
| # Events-streams-instance | ||
| # ############################################################################# | ||
| | ||
| module "event_streams" { | ||
| source = "../../profiles/fscloud" | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| es_name = "${var.prefix}-es-fs" | ||
| kms_key_crn = var.kms_key_crn | ||
| existing_kms_instance_guid = var.existing_kms_instance_guid | ||
| schemas = var.schemas | ||
| tags = var.resource_tags | ||
| topics = var.topics | ||
| cbr_rules = [ | ||
| { | ||
| description = "${var.prefix}-event stream access only from vpc" | ||
| enforcement_mode = "enabled" | ||
| account_id = data.ibm_iam_account_settings.iam_account_settings.account_id | ||
| rule_contexts = [{ | ||
| attributes = [ | ||
| { | ||
| "name" : "endpointType", | ||
| "value" : "private" | ||
| }, | ||
| { | ||
| name = "networkZoneId" | ||
| value = module.cbr_zone.zone_id | ||
| }] | ||
| }] | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or 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,33 @@ | ||
| ############################################################################## | ||
| # Outputs | ||
| ############################################################################## | ||
| | ||
| output "resource_group_name" { | ||
| description = "Resource group name" | ||
| value = module.resource_group.resource_group_name | ||
| } | ||
| | ||
| output "resource_group_id" { | ||
| description = "Resource group ID" | ||
| value = module.resource_group.resource_group_id | ||
| } | ||
| | ||
| output "crn" { | ||
| description = "Event Streams instance crn" | ||
| value = module.event_streams.crn | ||
| } | ||
| | ||
| output "guid" { | ||
| description = "Event Streams instance guid" | ||
| value = module.event_streams.guid | ||
| } | ||
| | ||
| output "kafka_brokers_sasl" { | ||
| description = "(Array of Strings) Kafka brokers use for interacting with Kafka native API" | ||
| value = module.event_streams.kafka_brokers_sasl | ||
| } | ||
| | ||
| output "kafka_http_url" { | ||
| description = "The API endpoint to interact with Event Streams REST API" | ||
| value = module.event_streams.kafka_http_url | ||
| } |
This file contains hidden or 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 hidden or 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,65 @@ | ||
| variable "ibmcloud_api_key" { | ||
| type = string | ||
| description = "The IBM Cloud API Key" | ||
| sensitive = true | ||
| } | ||
| | ||
| variable "region" { | ||
| type = string | ||
| description = "Region to provision all resources created by this example" | ||
| default = "us-south" | ||
| } | ||
| | ||
| variable "prefix" { | ||
| type = string | ||
| description = "Prefix to append to all resources created by this example" | ||
| default = "fs-cloud" | ||
| } | ||
| | ||
| variable "resource_group" { | ||
| type = string | ||
| description = "An existing resource group name to use for this example, if unset a new resource group will be created" | ||
| default = null | ||
| } | ||
| | ||
| variable "resource_tags" { | ||
| type = list(string) | ||
| description = "List of tags associated with the Event Steams instance" | ||
| default = [] | ||
| } | ||
| | ||
| variable "schemas" { | ||
| type = list(object( | ||
| { | ||
| schema_id = string | ||
| schema = object({ | ||
| type = string | ||
| name = string | ||
| }) | ||
| } | ||
| )) | ||
| description = "The list of schema object which contains schema id and format of the schema" | ||
| default = [] | ||
| } | ||
| | ||
| variable "topics" { | ||
| type = list(object( | ||
| { | ||
| name = string | ||
| partitions = number | ||
| config = object({}) | ||
| } | ||
| )) | ||
| description = "List of topics. For lite plan only one topic is allowed." | ||
| default = [] | ||
| } | ||
| | ||
| variable "existing_kms_instance_guid" { | ||
| description = "The GUID of the Hyper Protect Crypto service in which the key specified in var.kms_key_crn is coming from" | ||
| type = string | ||
| } | ||
| | ||
| variable "kms_key_crn" { | ||
| type = string | ||
| description = "The root key CRN of a Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs&interface=ui for more information on integrating HPCS with Event Streams instance." | ||
| } |
This file contains hidden or 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,9 @@ | ||
| terraform { | ||
| required_version = ">= 1.3.0" | ||
| required_providers { | ||
| ibm = { | ||
| source = "IBM-Cloud/ibm" | ||
| version = "1.49.0" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.