This repository was archived by the owner on Jan 22, 2024. It is now read-only.
generated from terraform-ibm-modules/terraform-ibm-module-template
- Notifications
You must be signed in to change notification settings - Fork 0
feat: initial commit #1
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits Select commit Hold shift + click to select a range
a440e4a feat: initial commit
Aayush-Abhyarthi bde7da7 feat: initial commit
Aayush-Abhyarthi 1248336 feat: initial commit
Aayush-Abhyarthi a000a9e feat: initial commit
Aayush-Abhyarthi 8d23b56 fix: few fixes
Aashiq-J 1fd2641 fix: resolved comments
Aayush-Abhyarthi aa70c84 Merge branch 'main' into migrate-to-tim
Aayush-Abhyarthi 2b6194c fix: resolved comments
Aayush-Abhyarthi f3e976a fix: resolved comments
Aayush-Abhyarthi c1164d9 Merge branch 'migrate-to-tim' of https://github.com/terraform-ibm-mod…
Aayush-Abhyarthi 7fdb9ae fix: comments resolved
91a5a63 fix: cra file location
Aashiq-J c9a83eb fix: revert the ghe_instance
Aashiq-J bf30105 fix: resolved comments
Aayush-Abhyarthi c4356ce fix: auth policy logic update
Aayush-Abhyarthi 04c3d5b Merge branch 'main' into migrate-to-tim
Aayush-Abhyarthi 52913fe fix: resolve conflicts
Aayush-Abhyarthi 989cfa5 fix: resolved conflicts
Aayush-Abhyarthi cfed9f7 fix: cleanup
ocofaigh 4fc7652 ci: update ci.yml
ocofaigh bf84da6 ci: update baseline
ocofaigh b393d64 fix: add plan logic
ocofaigh 94aea42 fix: fix complete example
ocofaigh 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,176 +1,102 @@ | ||
| <!-- BEGIN MODULE HOOK --> | ||
| # Data Engine (SQL Query) Module | ||
| | ||
| <!-- Update the title to match the module name and add a description --> | ||
| # Terraform Modules Template Project | ||
| <!-- UPDATE BADGE: Update the link for the following badge--> | ||
| [-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status) | ||
| [](https://github.com/terraform-ibm-modules/terraform-ibm-module-template/actions/workflows/ci.yml) | ||
| [-green?style=plastic)](https://terraform-ibm-modules.github.io/documentation/#/badge-status) | ||
| [](https://github.com/terraform-ibm-modules/terraform-ibm-data-engine/actions/workflows/ci.yml) | ||
| [](https://github.com/pre-commit/pre-commit) | ||
| [](https://github.com/terraform-ibm-modules/terraform-ibm-module-template/releases/latest) | ||
| [](https://github.com/terraform-ibm-modules/terraform-ibm-data-engine/releases/latest) | ||
| [](https://renovatebot.com/) | ||
| [](https://github.com/semantic-release/semantic-release) | ||
| | ||
| <!-- Remove the content in this H2 heading after completing the steps --> | ||
| | ||
| ## Submit a new module | ||
| | ||
| :+1::tada: Thank you for taking the time to contribute! :tada::+1: | ||
| | ||
| This template repository exists to help you create Terraform modules for IBM Cloud. | ||
| | ||
| The default structure includes the following files: | ||
| | ||
| - `README.md`: A description of the module | ||
| - `main.tf`: The logic for the module | ||
| - `version.tf`: The required terraform and provider versions | ||
| - `variables.tf`: The input variables for the module | ||
| - `outputs.tf`: The values that are output from the module | ||
| For more information, see [Module structure](https://terraform-ibm-modules.github.io/documentation/#/module-structure) in the project documentation. | ||
| | ||
| You can add other content to support what your module does and how it works. For example, you might add a `scripts/` directory that contains shell scripts that are run by a `local-exec` `null_resource` in the Terraform module. | ||
| | ||
| Follow this process to create and submit a Terraform module. | ||
| | ||
| ### Create a repo from this repo template | ||
| | ||
| 1. Create a repository from this repository template by clicking `Use this template` in the upper right of the GitHub UI. | ||
|     <br>For more information about creating a repository from a template, see the [GitHub docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). | ||
| 1. Select `terraform-ibm-modules` as the owner. | ||
| 1. Enter a name for the module in format `terraform-ibm-<NAME>`, where `<NAME>` reflects the type of infrastructure that the module manages. | ||
|     <br>Use hyphens as delimiters for names with multiple words (for example, terraform-ibm-`activity-tracker`). | ||
| 1. Provide a short description of the module. | ||
|     <br>The description is displayed under the repository name on the [organization page](https://github.com/terraform-ibm-modules) and in the **About** section of the repository. Use the description to help users understand the purpose of your module. For more information, see [module names and descriptions](https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=module-names-and-descriptions) in the docs. | ||
| | ||
| ### Clone the repo and set up your development environment | ||
| | ||
| Locally clone the new repository and set up your development environment by completing the tasks in [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation. | ||
| | ||
| ### Update the repo name and description in source control | ||
| | ||
| To help make sure that the repo name and description are not changed except through pull requests, they are defined in the `settings.yml` file. | ||
| | ||
| Check to make sure that values are uncommented and correct: | ||
| | ||
| 1. Open the [settings.yml](.github/settings.yml) file. | ||
| 1. If not already updated, uncomment the `name` and `description` properties and set the values to what you specified when you requested the repo. | ||
| | ||
| ### Update the Terraform files | ||
| | ||
| Implement the logic for your module by updating the `main.tf`, `version.tf`, `variables.tf`, and `outputs.tf` Terraform files. For more information, see [Creating Terraform on IBM Cloud templates](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-create-tf-config). | ||
| | ||
| ### Create examples and tests | ||
| | ||
| Add one or more examples in the `examples` directory that consume your new module, and configure tests for them in the `tests` directory. For more information about tests, see [Tests](https://terraform-ibm-modules.github.io/documentation/#/tests). | ||
| | ||
| ### Update the content in the readme file | ||
| | ||
| After you implement the logic for your module and create examples and tests, update this readme file in your repository by following these steps: | ||
| | ||
| 1. Update the title heading and add a description about your module. | ||
| 1. Update the badge links. | ||
| 1. Remove all the content in this H2 heading section. | ||
| 1. Complete the [Usage](#usage) and [Required IAM access policies](#required-iam-access-policies) sections. The [Examples](#examples) and [Requirements](#requirements) section are populated by a pre-commit hook. | ||
| | ||
| ### Commit your code and submit your module for review | ||
| | ||
| 1. Before you commit any code, review [Contributing to the IBM Cloud Terraform modules project](https://terraform-ibm-modules.github.io/documentation/#/contribute-module) in the project documentation. | ||
| 1. Create a pull request for review. | ||
| | ||
| ### Post-merge steps | ||
| | ||
| After the first PR for your module is merged, follow these post-merge steps: | ||
| | ||
| 1. Create a PR to enable the upgrade test by removing the `t.Skip` line in `tests/pr_test.go`. | ||
| | ||
| <!-- Remove the content in this previous H2 heading --> | ||
| ## Reference architectures | ||
| | ||
| <!-- | ||
| Add links to any reference architectures for this module. | ||
| (Usually in the `/reference-architectures` directory.) | ||
| See "Reference architecture" in Authoring Guidelines in the public documentation at | ||
| https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture | ||
| --> | ||
| This module provisions an [IBM Cloud® Data Engine](https://cloud.ibm.com/docs/sql-query?topic=sql-query-getting-started) instance. | ||
| | ||
| ## Usage | ||
| | ||
| <!-- | ||
| Add an example of the use of the module in the following code block. | ||
| | ||
| Use real values instead of "var.<var_name>" or other placeholder values | ||
| unless real values don't help users know what to change. | ||
| --> | ||
| | ||
| ```hcl | ||
| | ||
| provider "ibm" { | ||
| ibmcloud_api_key = "XXXXXXXXXX" | ||
| region = "us-south" | ||
| } | ||
| | ||
| module "data_engine" { | ||
| # Replace "main" with a GIT release version to lock into a specific release | ||
| source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-data-engine.git?ref=main" | ||
| resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" | ||
| region = "us-south" | ||
| } | ||
Aayush-Abhyarthi marked this conversation as resolved. Show resolved Hide resolved | ||
| ``` | ||
| | ||
| ## Required IAM access policies | ||
| | ||
| <!-- PERMISSIONS REQUIRED TO RUN MODULE | ||
| If this module requires permissions, uncomment the following block and update | ||
| the sample permissions, following the format. | ||
| Replace the sample Account and IBM Cloud service names and roles with the | ||
| information in the console at | ||
| Manage > Access (IAM) > Access groups > Access policies. | ||
| --> | ||
| | ||
| <!-- | ||
| You need the following permissions to run this module. | ||
| | ||
| - Account Management | ||
| - **Sample Account Service** service | ||
| - `Editor` platform access | ||
| - `Manager` service access | ||
| - IAM Services | ||
| - **Sample Cloud Service** service | ||
| - `Administrator` platform access | ||
| --> | ||
| | ||
| <!-- NO PERMISSIONS FOR MODULE | ||
| If no permissions are required for the module, uncomment the following | ||
| statement instead the previous block. | ||
| --> | ||
| | ||
| <!-- No permissions are needed to run this module.--> | ||
| <!-- END MODULE HOOK --> | ||
| - **All Identity and Access Enabled** service | ||
| - `Viewer` platform access | ||
| - **All Resource Groups** service | ||
| - `Viewer` platform access | ||
| - IAM Services | ||
| - **Data Engine** service | ||
| - `Editor` platform access | ||
| - `Manager` service access | ||
| | ||
| <!-- BEGIN EXAMPLES HOOK --> | ||
| ## Examples | ||
| | ||
| - [ Default example](examples/default) | ||
| - [ Example that uses existing resources](examples/existing-resources) | ||
| - [ Non default example](examples/non-default) | ||
| - [ Basic Example](examples/basic) | ||
| - [ Complete example with BYOK encryption](examples/complete) | ||
| <!-- END EXAMPLES HOOK --> | ||
| <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
| ## Requirements | ||
| | ||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 | | ||
| | <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.49.0 | | ||
| | ||
| ## Modules | ||
| | ||
| No modules. | ||
| | ||
| ## Resources | ||
| | ||
| No resources. | ||
| | Name | Type | | ||
| |------|------| | ||
| | [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource | | ||
| | [ibm_resource_instance.data_engine_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource | | ||
| | ||
| ## Inputs | ||
| | ||
| No inputs. | ||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid) | The GUID the Key Protect instance in which the key specified in var.kms\_key\_crn is coming from. Required only if var.kms\_encryption\_enabled is set to true, var.skip\_iam\_authorization\_policy is set to false. NOTE: Hyper Protect Crypto Services is not currently supported by Data Engine. | `string` | `null` | no | | ||
| | <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | The name to give the Data Engine instance. | `string` | n/a | yes | | ||
| | <a name="input_kms_encryption_enabled"></a> [kms\_encryption\_enabled](#input\_kms\_encryption\_enabled) | Set this to true to control the encryption keys used to encrypt the data that you store in Data Engine. If set to false, the data is encrypted by using randomly generated keys. For more info on Key Protect integration, see https://cloud.ibm.com/docs/sql-query?topic=sql-query-securing-data. | `bool` | `false` | no | | ||
| | <a name="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn) | The root key CRN of a Key Protect key that you want to use for disk encryption. Only used if var.kms\_encryption\_enabled is set to true. NOTE: Hyper Protect Crypto Services is not currently supported by Data Engine. | `string` | `null` | no | | ||
| | <a name="input_kms_region"></a> [kms\_region](#input\_kms\_region) | The region where KMS instance exists if using KMS encryption. | `string` | `"us-south"` | no | | ||
| | <a name="input_plan"></a> [plan](#input\_plan) | The plan for the Data Engine instance. Supported plans: standard or lite. | `string` | `"lite"` | no | | ||
| | <a name="input_region"></a> [region](#input\_region) | The region where you want to deploy your instance. | `string` | `"us-south"` | no | | ||
| | <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where the Data Engine instance will be created. | `string` | n/a | yes | | ||
| | <a name="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints) | Specify whether you want to enable the public, private, or both service endpoints. Supported values are 'public', 'private', or 'public-and-private'. | `string` | `"private"` | no | | ||
| | <a name="input_skip_iam_authorization_policy"></a> [skip\_iam\_authorization\_policy](#input\_skip\_iam\_authorization\_policy) | Set to true to skip the creation of an IAM authorization policy that permits all Data Engine instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the existing\_kms\_instance\_guid variable. In addition, no policy is created if var.kms\_encryption\_enabled is set to false. | `bool` | `false` | no | | ||
| | <a name="input_tags"></a> [tags](#input\_tags) | (Optional, Array of Strings) A list of tags that you want to add to your instance. | `list(any)` | `[]` | no | | ||
| | ||
| ## Outputs | ||
| | ||
| No outputs. | ||
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_crn"></a> [crn](#output\_crn) | data engine crn | | ||
| | <a name="output_guid"></a> [guid](#output\_guid) | data engine guid | | ||
| | <a name="output_id"></a> [id](#output\_id) | data engine id | | ||
| <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
| <!-- BEGIN CONTRIBUTING HOOK --> | ||
| | ||
| <!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow --> | ||
| | ||
| ## Contributing | ||
| | ||
| You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md). | ||
| | ||
| To set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation. | ||
| | ||
| <!-- Source for this readme file: https://github.com/terraform-ibm-modules/common-dev-assets/tree/main/module-assets/ci/module-template-automation --> | ||
| <!-- END CONTRIBUTING HOOK --> | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
| { | ||
| "scc_rules": [] | ||
| } |
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,6 @@ | ||
| # Basic Example | ||
| | ||
| An end-to-end example that creates the following infrastructure: | ||
| | ||
| - A resource group, if one is not passed in. | ||
| - An IBM Cloud® Data Engine 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
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 @@ | ||
| ############################################################################## | ||
| # Outputs | ||
| ############################################################################## | ||
| output "id" { | ||
| description = "ID of data engine instance" | ||
| value = module.data_engine.id | ||
| } | ||
| | ||
| output "guid" { | ||
| description = "GUID of data engine instance" | ||
| value = module.data_engine.guid | ||
| } | ||
| | ||
| output "crn" { | ||
| description = "crn of data engine instance" | ||
| value = module.data_engine.crn | ||
| } |
File renamed without changes.
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
File renamed without changes.
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,7 @@ | ||
| # Complete example with BYOK encryption | ||
| | ||
| An end-to-end example that uses the IBM Cloud Terraform provider to create the following infrastructure: | ||
| | ||
| - A resource group, if one is not passed in. | ||
| - A Key Protect instance with a root key. | ||
| - An instance of IBM Cloud® Data Engine with BYOK encryption. |
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.