Skip to content

Commit 48c4eb6

Browse files
author
Sean Sundberg
authored
Updates handling of provider configuration (#47)
Signed-off-by: Sean Sundberg <[email protected]>
1 parent 539d37a commit 48c4eb6

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Provisions a VPC instance and related resources. The full list of resources prov
99
- *public dns* - `161.26.0.10` and `161.26.0.11`
1010
- *private dns* - `161.26.0.7` and `161.26.0.8`
1111

12+
**Note:** This module follows the Terraform conventions regarding how provider configuration is defined within the Terraform template and passed into the module - https://www.terraform.io/docs/language/modules/develop/providers.html. The default provider configuration flows through to the module. If different configuration is required for a module, it can be explicitly passed in the `providers` block of the module - https://www.terraform.io/docs/language/modules/develop/providers.html#passing-providers-explicitly.
13+
1214
## Software dependencies
1315

1416
The module depends on the following software components:
@@ -28,6 +30,20 @@ The module depends on the following software components:
2830
## Example usage
2931

3032
```hcl-terraform
33+
terraform {
34+
required_providers {
35+
ibm = {
36+
source = "ibm-cloud/ibm"
37+
}
38+
}
39+
required_version = ">= 0.13"
40+
}
41+
42+
provider "ibm" {
43+
ibmcloud_api_key = var.ibmcloud_api_key
44+
region = var.region
45+
}
46+
3147
module "dev_vpc" {
3248
source = "github.com/cloud-native-toolkit/terraform-ibm-vpc.git?ref=v1.7.2"
3349

module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ tags:
66
- networking
77
versions:
88
- platforms: []
9+
providers:
10+
- name: ibm
11+
source: "ibm-cloud/ibm"
912
dependencies:
1013
- id: resource_group
1114
refs:
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
provider "ibm" {
2-
generation = 2
32
region = var.region
43
ibmcloud_api_key = var.ibmcloud_api_key
54
}

test/stages/stage0.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@ terraform {
88
}
99
}
1010
}
11-
12-
provider "ibm" {
13-
ibmcloud_api_key = var.ibmcloud_api_key
14-
}
15-

test/stages/stage1-resource-group.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module "resource_group" {
33

44
resource_group_name = var.resource_group_name
55
provision = false
6-
ibmcloud_api_key = var.ibmcloud_api_key
76
}

0 commit comments

Comments
 (0)