generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
999 additions
and
326 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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
@@ -16,5 +17,7 @@ jobs: | |
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/[email protected] | ||
secrets: inherit | ||
with: | ||
craTarget: "examples/default" | ||
craGoalIgnoreFile: "cra-tf-validate-ignore-goals.json" | ||
craSCCv2: true | ||
craTarget: "examples/complete" | ||
craRuleIgnoreFile: "cra-tf-validate-ignore-rules.json" | ||
craEnvironmentVariables: "TF_VAR_existing_at_instance_crn=${{ vars.AT_INSTANCE_CRN }}" |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[submodule "common-dev-assets"] | ||
path = common-dev-assets | ||
url = https://github.com/terraform-ibm-modules/common-dev-assets | ||
branch = main | ||
url = https://github.com/terraform-ibm-modules/common-dev-assets.git |
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
Submodule common-dev-assets
updated
3 files
+1 −1 | module-assets/.pre-commit-config.yaml | |
+2 −2 | module-assets/ci/install-deps.sh | |
+1 −1 | scripts/update-source/requirements.txt |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
"scc_rules": [ | ||
{ | ||
"scc_rule_id": "rule-3b2768e5-d783-4b0c-a47f-81479af34689", | ||
"description": " Check whether Event Streams is accessible only by using private endpoints Found in: resource_address: module.event_streams.ibm_resource_instance.es_instance", | ||
"ignore_reason": "Private endpoint option is not available in Standard plan which the complete example uses. When we create an FSCloud profile example for this module, the CRA scan will be done against that, and that should use private endpoint only. (Tracked at https://github.com/terraform-ibm-modules/terraform-ibm-event-streams/issues/5)", | ||
"is_valid": true | ||
} | ||
] | ||
} |
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,8 @@ | ||
# Complete example with key protect | ||
|
||
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 new event streams instance with topics and schemas provided, and a new key protect instance in the resource group and region provided. | ||
|
||
<!-- Add your example and link to it from the module's main readme file. --> |
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,41 @@ | ||
############################################################################## | ||
# 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 | ||
} | ||
|
||
############################################################################## | ||
# Key Protect All Inclusive | ||
############################################################################## | ||
|
||
module "key_protect_all_inclusive" { | ||
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-key-protect-all-inclusive.git?ref=v4.0.0" | ||
key_protect_instance_name = "${var.prefix}-kp" | ||
resource_group_id = module.resource_group.resource_group_id | ||
region = var.region | ||
resource_tags = var.resource_tags | ||
key_map = { "es" = ["${var.prefix}-es"] } | ||
enable_metrics = false | ||
} | ||
|
||
############################################################################## | ||
# Events-streams-instance | ||
############################################################################## | ||
|
||
module "event_streams" { | ||
source = "../../" | ||
resource_group_id = module.resource_group.resource_group_id | ||
es_name = "${var.prefix}-es" | ||
plan = var.plan | ||
kms_key_crn = module.key_protect_all_inclusive.keys["es.${var.prefix}-es"].crn | ||
existing_kms_instance_guid = module.key_protect_all_inclusive.key_protect_guid | ||
schemas = var.schemas | ||
tags = var.resource_tags | ||
topics = var.topics | ||
service_endpoints = var.service_endpoints | ||
} |
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,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 | ||
} |
File renamed without changes.
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,109 @@ | ||
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 "plan" { | ||
type = string | ||
description = "Plan for the event stream instance. lite, standard or enterprise-3nodes-2tb" | ||
default = "standard" | ||
} | ||
|
||
variable "prefix" { | ||
type = string | ||
description = "Prefix to append to all resources created by this example" | ||
default = "event_streams" | ||
} | ||
|
||
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 "service_endpoints" { | ||
type = string | ||
description = "The type of service endpoint(public,private or public-and-private) to be used for connection. Default is public for Standard and lite plans" | ||
default = "public" | ||
} | ||
|
||
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 = [{ | ||
schema_id = "my-es-schema_1" | ||
schema = { | ||
type = "string" | ||
name = "name_1" | ||
} | ||
}, | ||
{ | ||
schema_id = "my-es-schema_2" | ||
schema = { | ||
type = "string" | ||
name = "name_2" | ||
} | ||
}, | ||
{ | ||
schema_id = "my-es-schema_3" | ||
schema = { | ||
type = "string" | ||
name = "name_3" | ||
} | ||
} | ||
] | ||
} | ||
|
||
variable "topics" { | ||
type = list(object( | ||
{ | ||
name = string | ||
partitions = number | ||
config = object({}) | ||
} | ||
)) | ||
description = "List of topics. For lite plan only one topic is allowed." | ||
default = [ | ||
{ | ||
name = "topic-1" | ||
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" | ||
} | ||
} | ||
] | ||
} |
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,9 @@ | ||
terraform { | ||
required_version = ">= 1.3.0" | ||
required_providers { | ||
ibm = { | ||
source = "IBM-Cloud/ibm" | ||
version = "1.49.0" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Default example | ||
# Default example using the modules default inputs | ||
|
||
An end-to-end example that uses the module's default variable values. | ||
An end-to-end example that creates an event streams instance. | ||
This example uses the IBM Cloud terraform provider to: | ||
- Create a new resource group if one is not passed in. | ||
- Create a new Cloud Object Storage instance. | ||
- Create a new event streams instance with default inputs in the resource group and region provided. | ||
|
||
<!-- Add your example and link to it from the module's main readme file. --> |
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
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
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
Oops, something went wrong.