Skip to content

Commit c38aa95

Browse files
author
Ryan Johnson
authored
Update install_provider.md
Address review comments from @frodenas in #407. Signed-off-by: Ryan Johnson <[email protected]>
1 parent c10e14c commit c38aa95

File tree

1 file changed

+57
-31
lines changed

1 file changed

+57
-31
lines changed

docs/install_provider.md

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Installing the Terraform Provider for VMware vRealize Automation
22

3-
![Terraform](https://img.shields.io/badge/Terraform-0.13%2B-blue?style=for-the-badge&logo=terraform)
4-
53
This document assumes the use of Terraform 0.13 or later.
64

75
## Automated Installation (Recommended)
@@ -19,27 +17,45 @@ terraform {
1917
required_providers {
2018
vra = {
2119
source = "vmware/vra"
22-
version = ">= 0.4.0"
2320
}
2421
}
2522
required_version = ">= 0.13"
2623
}
2724
```
25+
26+
You can use `version` locking and operators to require specific versions of the provider.
27+
28+
**Example**: A Terraform configuration block with the provider versions.
29+
30+
```hcl
31+
terraform {
32+
required_providers {
33+
vra = {
34+
source = "vmware/vra"
35+
version = ">= x.y.z"
36+
}
37+
}
38+
required_version = ">= 0.13"
39+
}
40+
```
41+
42+
To specify a particular provider version when installing released providers, see the Terrraform documentation [on provider versioning](https://www.terraform.io/docs/configuration/providers.html#version-provider-versions).
43+
2844
### Verify Terraform Initialization Using the Terraform Registry
2945

30-
To verify the initialization, navigate to the working directory for your Terraform configuration and run `terraform init`. You should see a message indicating that Terraform has been successfully initialized and downloaded the Terraform Provider for vRealize Automation from the Terraform Registry is installed.
46+
To verify the initialization, navigate to the working directory for your Terraform configuration and run `terraform init`. You should see a message indicating that Terraform has been successfully initialized and has installed the provider from the Terraform Registry.
3147

3248
**Example**: Initialize and Download the Provider.
3349

3450
```
35-
$ ./terraform init
51+
$ terraform init
3652
3753
Initializing the backend...
3854
3955
Initializing provider plugins...
40-
- Finding vmware/vra versions matching ">= 0.4.0"...
41-
- Installing vmware/vra v0.4.0...
42-
- Installed vmware/vra v0.4.0 (signed by a HashiCorp partner, key ID *************)
56+
- Finding vmware/vra versions matching ">= x.y.z" ...
57+
- Installing vmware/vra x.y.z ...
58+
- Installed vmware/vra x.y.z (signed by a HashiCorp partner, key ID *************)
4359
4460
...
4561
@@ -59,7 +75,7 @@ The following examples use Bash on Linux (x64).
5975
1. On an a Linux operating system with Internet access, download the plugin from GitHub using the shell.
6076

6177
```bash
62-
RELEASE=0.4.0
78+
RELEASE=x.y.z
6379
wget -q https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_linux_amd64.zip
6480
```
6581

@@ -68,17 +84,22 @@ The following examples use Bash on Linux (x64).
6884
```bash
6985
tar xvf terraform-provider-vra_${RELEASE}_linux_amd64.zip
7086
```
87+
3. Create a directory for the provider.
7188

72-
3. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
73-
74-
>**Note**: The directory directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.<br/>
89+
>**Note**: The directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.<br/>
7590
> `$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/`
7691

92+
```bash
93+
mkdir -p ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64
94+
```
95+
96+
4. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
97+
7798
```bash
7899
mv terraform-provider-vra_v${RELEASE} ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64
79100
```
80101

81-
4. Verify the presence of the plugin in the Terraform plugins directory.
102+
5. Verify the presence of the plugin in the Terraform plugins directory.
82103

83104
```bash
84105
cd ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/linux_amd64
@@ -98,7 +119,7 @@ The following example uses Bash (default) on macOS (Intel).
98119
2. Download the plugin from GitHub using the shell.
99120

100121
```bash
101-
RELEASE=0.4.0
122+
RELEASE=x.y.x
102123
wget -q https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_darwin_amd64.zip
103124
```
104125

@@ -107,12 +128,17 @@ The following example uses Bash (default) on macOS (Intel).
107128
```bash
108129
tar xvf terraform-provider-vra_${RELEASE}_darwin_amd64.zip
109130
```
131+
4. Create a directory for the provider.
110132

111-
5. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
112-
113-
>**Note**: The directory directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.<br/>
133+
>**Note**: The directory hierarchy that Terraform use to precisely determine the source of each provider it finds locally.<br/>
114134
> `$PLUGIN_DIRECTORY/$SOURCEHOSTNAME/$SOURCENAMESPACE/$NAME/$VERSION/$OS_$ARCH/`
115135

136+
```bash
137+
mkdir -p ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/darwin_amd64
138+
```
139+
140+
5. Copy the extracted plugin to a target system and move to the Terraform plugins directory.
141+
116142
```bash
117143
mv terraform-provider-vra_v${RELEASE} ~/.terraform.d/plugins/local/vmware/vra/${RELEASE}/darwin_amd64
118144
```
@@ -131,7 +157,7 @@ The following examples use PowerShell on Windows (x64).
131157
1. On a Windows operating system with Internet access, download the plugin using the PowerShell.
132158

133159
```powershell
134-
$RELEASE="0.4.0"
160+
$RELEASE="x.y.z"
135161
Invoke-WebRequest https://github.com/vmware/terraform-provider-vra/releases/download/v${RELEASE}/terraform-provider-vra_${RELEASE}_windows_amd64.zip -outfile terraform-provider-vra_${RELEASE}_windows_amd64.zip
136162
```
137163

@@ -163,7 +189,7 @@ The following examples use PowerShell on Windows (x64).
163189

164190
### Configure the Terraform Configuration Files
165191

166-
A working directory can be initialized with providers that are installed locally on a system by using `terraform init`. The Terraform configuration block is used to configure some behaviors of Terraform itself, such as the Terraform version and the required providers source and version.
192+
A working directory can be initialized with providers that are installed locally on a system by using `terraform init`. The Terraform configuration block is used to configure some behaviors of Terraform itself, such as the Terraform version and the required providers source and version.
167193

168194
**Example**: A Terraform configuration block.
169195

@@ -172,10 +198,10 @@ terraform {
172198
required_providers {
173199
vra = {
174200
source = "local/vmware/vra"
175-
version = ">= 0.4.0"
201+
version = ">= x.y.z"
176202
}
177203
}
178-
required_version = ">= 1.0.0"
204+
required_version = ">= 0.13"
179205
}
180206
```
181207

@@ -186,14 +212,14 @@ To verify the initialization, navigate to the working directory for your Terrafo
186212
**Example**: Initialize and Use a Manually Installed Provider
187213

188214
```
189-
$ ./terraform init
215+
$ terraform init
190216

191217
Initializing the backend...
192218

193219
Initializing provider plugins...
194-
- Finding local/vmware/vra versions matching ">= 0.4.0"...
195-
- Installing local/vmware/vra v0.4.0...
196-
- Installed local/vmware/vra v0.4.0 (unauthenticated)
220+
- Finding local/vmware/vra versions matching ">= x.y.x" ...
221+
- Installing local/vmware/vra x.y.x ...
222+
- Installed local/vmware/vra x.y.x (unauthenticated)
197223
...
198224

199225
Terraform has been successfully initialized!
@@ -205,16 +231,16 @@ To find the provider version, navigate to the working directory of your Terrafor
205231
**Example**: Terraform Provider Version from the Terraform Registry
206232
207233
```
208-
$ ./terraform version
209-
Terraform v1.0.0
234+
$ terraform version
235+
Terraform x.y.z
210236
on linux_amd64
211-
+ provider registry.terraform.io/vmware/vra v0.4.0
237+
+ provider registry.terraform.io/vmware/vra x.y.z
212238
```
213239
**Example**: Terraform Provider Version for a Manually Installed Provider
214240
215241
```
216-
$ ./terraform version
217-
Terraform v1.0.0
242+
$ terraform version
243+
Terraform x.y.z
218244
on linux_amd64
219-
+ provider local/vmware/vra v0.4.0
245+
+ provider local/vmware/vra x.y.z
220246
```

0 commit comments

Comments
 (0)