|
1 | | -<!-- BEGIN MODULE HOOK --> |
| 1 | +# IBM Virtual Private Endpoints module |
2 | 2 |
|
3 | | -<!-- Update the title to match the module name and add a description --> |
4 | | -# Terraform Modules Template Project |
5 | | -<!-- UPDATE BADGE: Update the link for the following badge--> |
6 | 3 | [-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status) |
7 | | -[](https://github.com/terraform-ibm-modules/terraform-ibm-module-template/actions/workflows/ci.yml) |
| 4 | +[](https://github.com/terraform-ibm-modules/terraform-ibm-vpe-module/actions/workflows/ci.yml) |
8 | 5 | [](https://github.com/semantic-release/semantic-release) |
9 | 6 | [](https://github.com/pre-commit/pre-commit) |
10 | | -[](https://github.com/terraform-ibm-modules/terraform-ibm-module-template/releases/latest) |
| 7 | +[](https://github.com/terraform-ibm-modules/terraform-ibm-vpe-module/releases/latest) |
11 | 8 |
|
12 | | -<!-- Remove the content in this H2 heading after completing the steps --> |
| 9 | +You can use this module to create and configure virtual private endpoint gateways (https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-endpoint-gateway) for an IBM Cloud service. |
13 | 10 |
|
14 | | -## Submit a new module |
15 | | - |
16 | | -:+1::tada: Thank you for taking the time to contribute! :tada::+1: |
17 | | - |
18 | | -This template repository exists to help you create Terraform modules for IBM Cloud. |
19 | | - |
20 | | -The default structure includes the following files: |
21 | | - |
22 | | -- `README.md`: A description of the module |
23 | | -- `main.tf`: The logic for the module |
24 | | -- `version.tf`: The required terraform and provider versions |
25 | | -- `variables.tf`: The input variables for the module |
26 | | -- `outputs.tf`: The values that are output from the module |
27 | | -For more information, see [Module structure](https://terraform-ibm-modules.github.io/documentation/#/module-structure) in the project documentation. |
28 | | - |
29 | | -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. |
30 | | - |
31 | | -Follow this process to create and submit a Terraform module. |
32 | | - |
33 | | -### Create a repo from this repo template |
34 | | - |
35 | | -1. Create a repository from this repository template by clicking `Use this template` in the upper right of the GitHub UI. |
36 | | -    <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). |
37 | | -1. Select `terraform-ibm-modules` as the owner. |
38 | | -1. Enter a name for the module in format `terraform-ibm-<NAME>`, where `<NAME>` reflects the type of infrastructure that the module manages. |
39 | | -    <br>Use hyphens as delimiters for names with multiple words (for example, terraform-ibm-`activity-tracker`). |
40 | | -1. Provide a short description of the module. |
41 | | -    <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. |
42 | | - |
43 | | -### Clone the repo and set up your development environment |
44 | | - |
45 | | -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. |
46 | | - |
47 | | -### Update the repo name and description in source control |
48 | | - |
49 | | -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. |
50 | | - |
51 | | -Check to make sure that values are uncommented and correct: |
52 | | - |
53 | | -1. Open the [settings.yml](.github/settings.yml) file. |
54 | | -1. If not already updated, uncomment the `name` and `description` properties and set the values to what you specified when you requested the repo. |
55 | | - |
56 | | -### Update the Terraform files |
57 | | - |
58 | | -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). |
59 | | - |
60 | | -### Create examples and tests |
61 | | - |
62 | | -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). |
63 | | - |
64 | | -### Update the content in the readme file |
65 | | - |
66 | | -After you implement the logic for your module and create examples and tests, update this readme file in your repository by following these steps: |
67 | | - |
68 | | -1. Update the title heading and add a description about your module. |
69 | | -1. Update the badge links. |
70 | | -1. Remove all the content in this H2 heading section. |
71 | | -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. |
72 | | - |
73 | | -### Commit your code and submit your module for review |
74 | | - |
75 | | -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. |
76 | | -1. Create a pull request for review. |
77 | | - |
78 | | -### Post-merge steps |
79 | | - |
80 | | -After the first PR for your module is merged, follow these post-merge steps: |
81 | | - |
82 | | -1. Create a PR to enable the upgrade test by removing the `t.Skip` line in `tests/pr_test.go`. |
83 | | - |
84 | | -<!-- Remove the content in this previous H2 heading --> |
| 11 | +The module supports the following actions: |
| 12 | +- Create reserved IP addresses and endpoint gateways |
| 13 | +- Attach endpoint gateways to reserved IP addresses |
85 | 14 |
|
86 | 15 | ## Usage |
87 | 16 |
|
88 | | -<!-- |
89 | | -Add an example of the use of the module in the following code block. |
90 | | -
|
91 | | -Use real values instead of "var.<var_name>" or other placeholder values |
92 | | -unless real values don't help users know what to change. |
93 | | ---> |
94 | | - |
95 | 17 | ```hcl |
96 | | -
|
| 18 | +provider "ibm" { |
| 19 | + ibmcloud_api_key = "XXXXXXXXXX" # pragma: allowlist secret |
| 20 | + region = "us-south" |
| 21 | +} |
| 22 | +
|
| 23 | +# Creates: |
| 24 | +# - VPE |
| 25 | +module "vpes" { |
| 26 | + source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-vpe-module?ref=main" |
| 27 | + region = "us-south" |
| 28 | + prefix = "vpe" |
| 29 | + vpc_name = "my-vpc-instance" |
| 30 | + vpc_id = "r022-ae2a6785-gd62-7d4j-af62-b4891e949345" |
| 31 | + subnet_zone_list = [ |
| 32 | + { |
| 33 | + name = "subnet-1" |
| 34 | + cidr = "10.0.10.0/24" |
| 35 | + public_gateway = true |
| 36 | + acl_name = "acl" |
| 37 | + }, |
| 38 | + { |
| 39 | + name = "subnet-2" |
| 40 | + cidr = "10.0.11.0/24" |
| 41 | + acl_name = "acl" |
| 42 | + public_gateway = null |
| 43 | + } |
| 44 | + ] |
| 45 | + resource_group_id = "00ae4b38253f43a3acd14619dd385632" # pragma: allowlist secret |
| 46 | + security_group_ids = ["r014-2d4f8cd6-6g3s-4ab5-ac3f-8fc717ce2a1f"] |
| 47 | + cloud_services = ["kms", "cloud-object-storage"] |
| 48 | + cloud_service_by_crn = [ |
| 49 | + { |
| 50 | + name = "subnet-1" |
| 51 | + crn = "crn:v1:bluemix:public:kms:au-syd:a/abac0df06b644a9cabc6e44f55b3880e:12d2244b-g3d3-4978-7s3f-81b60a1fb7a4::" |
| 52 | + }, |
| 53 | + ] |
| 54 | + service_endpoints = "private" |
| 55 | +} |
97 | 56 | ``` |
98 | 57 |
|
99 | 58 | ## Required IAM access policies |
100 | | - |
101 | | -<!-- PERMISSIONS REQUIRED TO RUN MODULE |
102 | | -If this module requires permissions, uncomment the following block and update |
103 | | -the sample permissions, following the format. |
104 | | -Replace the sample Account and IBM Cloud service names and roles with the |
105 | | -information in the console at |
106 | | -Manage > Access (IAM) > Access groups > Access policies. |
107 | | ---> |
108 | | - |
109 | | -<!-- |
110 | 59 | You need the following permissions to run this module. |
111 | 60 |
|
112 | 61 | - Account Management |
113 | | - - **Sample Account Service** service |
| 62 | + - **Resource Group** service |
| 63 | + - `Viewer` platform access |
| 64 | +- IAM services |
| 65 | + - **VPE Infrastructure** services |
114 | 66 | - `Editor` platform access |
115 | | - - `Manager` service access |
116 | | - - IAM Services |
117 | | - - **Sample Cloud Service** service |
118 | | - - `Administrator` platform access |
119 | | ---> |
120 | | - |
121 | | -<!-- NO PERMISSIONS FOR MODULE |
122 | | -If no permissions are required for the module, uncomment the following |
123 | | -statement instead the previous block. |
124 | | ---> |
125 | | - |
126 | | -<!-- No permissions are needed to run this module.--> |
127 | | -<!-- END MODULE HOOK --> |
| 67 | + |
128 | 68 | <!-- BEGIN EXAMPLES HOOK --> |
129 | 69 | ## Examples |
130 | 70 |
|
131 | 71 | - [Examples](examples) |
132 | 72 | <!-- END EXAMPLES HOOK --> |
| 73 | + |
133 | 74 | <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
134 | 75 | ## Requirements |
135 | 76 |
|
@@ -169,13 +110,9 @@ No modules. |
169 | 110 |
|
170 | 111 | No outputs. |
171 | 112 | <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
172 | | -<!-- BEGIN CONTRIBUTING HOOK --> |
173 | 113 |
|
174 | | -<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow --> |
175 | 114 | ## Contributing |
176 | 115 |
|
177 | 116 | 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). |
178 | 117 |
|
179 | 118 | 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. |
180 | | -<!-- Source for this readme file: https://github.com/terraform-ibm-modules/common-dev-assets/tree/main/module-assets/ci/module-template-automation --> |
181 | | -<!-- END CONTRIBUTING HOOK --> |
0 commit comments