@@ -7,34 +7,36 @@ integrating the STACKIT Terraform provider with the Cloud Foundry Terraform
7
7
provider. The STACKIT Terraform provider will create a managed Cloud Foundry
8
8
organization and set up a technical "org manager" user with
9
9
` organization_manager ` permissions. These credentials, along with the Cloud
10
- Foundry API URL (retrieved dynamically from a platform data resource), will then
11
- be passed to the Cloud Foundry Terraform provider to manage resources within the
12
- newly created organization.
10
+ Foundry API URL (retrieved dynamically from a platform data resource), are
11
+ passed to the Cloud Foundry Terraform provider to manage resources within the
12
+ new organization.
13
13
14
14
### Output
15
15
16
- The example configuration provisions a Cloud Foundry organization, mirroring the
17
- structure created via the portal. It sets up three distinct spaces: ` dev ` , ` qa ` ,
18
- and ` prod ` . Furthermore , a specified user is assigned the ` organization_manager `
16
+ This configuration creates a Cloud Foundry organization, mirroring the structure
17
+ created via the portal. It sets up three distinct spaces: ` dev ` , ` qa ` , and
18
+ ` prod ` . The configuration assigns , a specified user the ` organization_manager `
19
19
and ` organization_user ` roles at the organization level, and the
20
- ` space_developer ` role within each of the ` dev ` , ` qa ` , and ` prod ` spaces .
20
+ ` space_developer ` role in each space .
21
21
22
- ### Outside of the scope
22
+ ### Scope
23
23
24
- This tutorial focuses specifically on the interaction between the STACKIT
25
- Terraform provider and the Cloud Foundry Terraform provider. It assumes
26
- familiarity with:
24
+ This tutorial covers the interaction between the STACKIT Terraform provider and
25
+ the Cloud Foundry Terraform provider. It assumes you are familiar with:
27
26
28
27
- Setting up a STACKIT project and configuring the STACKIT Terraform provider
29
- with a service account (details for which can be found in the general STACKIT
30
- documentation).
28
+ with a service account (see the general STACKIT documentation for details).
31
29
- Basic Terraform concepts, such as variables and locals.
32
30
33
- Therefore, this document will not delve into these foundational topics, nor will
34
- it cover every feature offered by the Cloud Foundry Terraform provider.
31
+ This document does not cover foundational topics or every feature of the Cloud
32
+ Foundry Terraform provider.
35
33
36
34
### Example configuration
37
35
36
+ The following Terraform configuration provisions a Cloud Foundry organization
37
+ and related resources using the STACKIT Terraform provider and the Cloud Foundry
38
+ Terraform provider:
39
+
38
40
```
39
41
terraform {
40
42
required_providers {
@@ -118,26 +120,26 @@ resource "cloudfoundry_space_role" "space_developer" {
118
120
}
119
121
```
120
122
121
- ## Taken apart
123
+ ## Explanation of configuration
122
124
123
- ### STACKIT Provider Configuration
125
+ ### STACKIT provider configuration
124
126
125
127
```
126
128
provider "stackit" {
127
129
default_region = "eu01"
128
130
}
129
131
```
130
132
131
- The SCF API is regionalized to ensure fault isolation, meaning each region
132
- operates independently. For this reason, we set ` default_region ` in the provider
133
- configuration, which applies to all resources unless explicitly overridden.
134
- Additionally, appropriate access data for the corresponding STACKIT project must
135
- be provided for the provider to function.
133
+ The STACKIT Cloud Foundry Application Programming Interface (SCF API) is
134
+ regionalized. Each region operates independently. Set ` default_region ` in the
135
+ provider configuration, to specify the region for all resources, unless you
136
+ override it for individual resources. You must also provide access data for the
137
+ relevant STACKIT project for the provider to function.
136
138
137
- See:
138
- [ STACKIT Terraform Provider Documentation ] ( https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs )
139
+ For more details, see
140
+ the: [ STACKIT Terraform Provider documentation. ] ( https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs )
139
141
140
- ### stackit_scf_organization.scf_org
142
+ ### stackit_scf_organization.scf_org resource
141
143
142
144
```
143
145
resource "stackit_scf_organization" "scf_org" {
@@ -146,15 +148,15 @@ resource "stackit_scf_organization" "scf_org" {
146
148
}
147
149
```
148
150
149
- This resource provisions the Cloud Foundry organization, which serves as the
150
- foundational container within the Cloud Foundry environment. Each Cloud Foundry
151
- provider configuration is scoped to a specific organization. The organization' s
152
- name, defined by a variable, must be unique across the platform. This
153
- organization is created within a designated STACKIT project, requiring the
151
+ This resource provisions a Cloud Foundry organization, which acts as the
152
+ foundational container in the Cloud Foundry environment. Each Cloud Foundry
153
+ provider configuration is scoped to a specific organization. The organization’ s
154
+ name, defined by a variable, must be unique across the platform. The
155
+ organization is created within a designated STACKIT project, which requires the
154
156
STACKIT provider to be configured with the necessary permissions for that
155
157
project.
156
158
157
- ### stackit_scf_organization_manager.scf_manager
159
+ ### stackit_scf_organization_manager.scf_manager resource
158
160
159
161
```
160
162
resource "stackit_scf_organization_manager" "scf_manager" {
@@ -163,13 +165,11 @@ resource "stackit_scf_organization_manager" "scf_manager" {
163
165
}
164
166
```
165
167
166
- This resource creates a technical user within the Cloud Foundry Organization,
167
- designated as an "organization manager." This user is intrinsically linked to
168
- the organization and will be automatically deleted when the organization is
169
- removed. The user is assigned the ` organization_manager ` permission within the
170
- Cloud Foundry organization.
168
+ This resource creates a technical user in the Cloud Foundry organization with
169
+ the organization_manager permission. The user is linked to the organization and
170
+ is automatically deleted when the organization is removed.
171
171
172
- ### stackit_scf_platform.scf_platform
172
+ ### stackit_scf_platform.scf_platform data source
173
173
174
174
```
175
175
data "stackit_scf_platform" "scf_platform" {
@@ -179,10 +179,10 @@ data "stackit_scf_platform" "scf_platform" {
179
179
```
180
180
181
181
This data source retrieves properties of the Cloud Foundry platform where the
182
- organization is provisioned. It does not create any resources within the
183
- project, but rather provides information about an existing platform.
182
+ organization is provisioned. It does not create resources, but provides
183
+ information about the existing platform.
184
184
185
- ### Cloud Foundry Provider Configuration
185
+ ### Cloud Foundry provider configuration
186
186
187
187
```
188
188
provider "cloudfoundry" {
@@ -192,53 +192,57 @@ provider "cloudfoundry" {
192
192
}
193
193
```
194
194
195
- The Cloud Foundry provider is configured to manage resources within the newly
196
- created organization. It uses the API URL retrieved from the
197
- ` stackit_scf_platform ` data source to communicate with the Cloud Foundry
198
- platform and authenticates using the credentials of the
199
- ` stackit_scf_organization_manager ` technical user.
195
+ The Cloud Foundry provider is configured to manage resources in the new
196
+ organization. The provider uses the API URL from the ` stackit_scf_platform ` data
197
+ source and authenticates using the credentials of the technical user created by
198
+ the ` stackit_scf_organization_manager ` resource.
199
+
200
+ For more information, see the:
201
+ [ Cloud Foundry Terraform Provider documentation.] ( https://registry.terraform.io/providers/cloudfoundry/cloudfoundry/latest/docs )
202
+
203
+ ## Deploy resources
200
204
201
- See:
202
- [ Cloud Foundry Terraform Provider Documentation ] ( https://registry.terraform.io/providers/cloudfoundry/cloudfoundry/latest/docs )
205
+ Follow these steps to initialize your environment and provision Cloud Foundry
206
+ resources using Terraform.
203
207
204
- ## Deployment
208
+ ### Initialize Terraform
205
209
206
- ### init
210
+ Run the following command to initialize the working directory and download the
211
+ required provider plugins:
207
212
208
213
```
209
214
terraform init
210
215
```
211
216
212
- The ` terraform init ` command initializes the working directory and downloads the
213
- necessary provider plugins.
217
+ ### Create the organization manager user
214
218
215
- ### Create Initial Resources
219
+ Run this command to provision the organization and technical user needed to
220
+ initialize the Cloud Foundry Terraform provider. This step is required only
221
+ during the initial setup. For later changes, you do not need the -target flag.
216
222
217
223
```
218
224
terraform apply -target stackit_scf_organization_manager.scf_manager
219
225
```
220
226
221
- This initial ` terraform apply ` command provisions the resources required to
222
- initialize the Cloud Foundry Terraform provider. This step is only required for
223
- the initial setup; subsequent ` terraform apply ` commands that modify resources
224
- within the Cloud Foundry organization do not require the ` -target ` flag.
227
+ ### Apply the full configuration
225
228
226
- ### Apply Complete Configuration
229
+ Run this command to provision all resources defined in your Terraform
230
+ configuration within the Cloud Foundry organization:
227
231
228
232
```
229
233
terraform apply
230
234
```
231
235
232
- This command applies the complete Terraform configuration, provisioning all
233
- defined resources within the Cloud Foundry organization.
234
-
235
- ## Verification
236
-
237
- To verify the deployment, use the ` cf apps ` , ` cf services ` , and ` cf routes `
238
- commands.
236
+ ## Verify the deployment
239
237
240
- see:
238
+ Verify that your Cloud Foundry resources are provisioned correctly. Use the
239
+ following Cloud Foundry CLI commands to check applications, services, and
240
+ routes:
241
241
242
- [ Cloud Foundry Documentation] ( https://docs.cloudfoundry.org/ )
242
+ - ` cf apps `
243
+ - ` cf services `
244
+ - ` cf routes `
243
245
244
- [ Cloud Foundry CLI Reference Guide] ( https://cli.cloudfoundry.org/ )
246
+ For more information, see the
247
+ [ Cloud Foundry documentation] ( https://docs.cloudfoundry.org/ ) and the
248
+ [ Cloud Foundry CLI Reference Guide] ( https://cli.cloudfoundry.org/ ) .
0 commit comments