Skip to content

Commit 3625c02

Browse files
committed
Add doc's for SCF resources
1 parent 13a189f commit 3625c02

File tree

13 files changed

+565
-69
lines changed

13 files changed

+565
-69
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_scf_organization Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
STACKIT Cloud Foundry organization datasource schema. Must have a region specified in the provider configuration.
7+
---
8+
9+
# stackit_scf_organization (Data Source)
10+
11+
STACKIT Cloud Foundry organization datasource schema. Must have a `region` specified in the provider configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_scf_organization" "example" {
17+
guid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `org_id` (String) The ID of the organization
28+
- `project_id` (String) The ID of the project associated with the organization
29+
30+
### Optional
31+
32+
- `platform_id` (String) The ID of the platform associated with the organization
33+
- `quota_id` (String) The ID of the quota associated with the organization
34+
- `region` (String) The region where the organization is located
35+
- `suspended` (Boolean) A boolean indicating whether the organization is suspended
36+
37+
### Read-Only
38+
39+
- `created_at` (String) The time when the organization was created
40+
- `id` (String) Terraform's internal resource ID, structured as "`project_id`,`org_id`".
41+
- `name` (String) The name of the organization
42+
- `status` (String) The status of the organization (e.g., deleting, delete_failed)
43+
- `updated_at` (String) The time when the organization was last updated
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_scf_organization_manager Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
STACKIT Cloud Foundry organization manager datasource schema. Must have a region specified in the provider configuration.
7+
---
8+
9+
# stackit_scf_organization_manager (Data Source)
10+
11+
STACKIT Cloud Foundry organization manager datasource schema. Must have a `region` specified in the provider configuration.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `org_id` (String) The ID of the organization
21+
- `project_id` (String) The ID of the project associated with the organization of the organization manager
22+
23+
### Optional
24+
25+
- `region` (String) The region where the organization of the organization manager is located
26+
27+
### Read-Only
28+
29+
- `created_at` (String) The time when the organization manager was created
30+
- `id` (String) Terraform's internal resource ID, structured as "`project_id`,`org_id`,`user_id`".
31+
- `password` (String) An auto-generated password
32+
- `platform_id` (String) The ID of the platform associated with the organization of the organization manager
33+
- `updated_at` (String) The time when the organization manager was last updated
34+
- `user_id` (String) The ID of the organization manager user
35+
- `username` (String) An auto-generated organization manager user name

docs/data-sources/scf_platform.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_scf_platform Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
STACKIT Cloud Foundry Platform datasource schema.
7+
---
8+
9+
# stackit_scf_platform (Data Source)
10+
11+
STACKIT Cloud Foundry Platform datasource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_scf_platform" "example" {
17+
guid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `guid` (String) The unique id of the platform
28+
- `project_id` (String) The ID of the project associated with the platform
29+
30+
### Read-Only
31+
32+
- `api_url` (String) The CF API Url of the platform
33+
- `console_url` (String) The Stratos URL of the platform
34+
- `display_name` (String) The name of the platform
35+
- `id` (String) Terraform's internal resource ID, structured as "`project_id`,`guid`".
36+
- `region` (String) The region where the platform is located
37+
- `system_id` (String) The ID of the platform System

docs/guides/scf_cloudfoundry.md

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,36 @@ integrating the STACKIT Terraform provider with the Cloud Foundry Terraform
77
provider. The STACKIT Terraform provider will create a managed Cloud Foundry
88
organization and set up a technical "org manager" user with
99
`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.
1313

1414
### Output
1515

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`
1919
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.
2121

22-
### Outside of the scope
22+
### Scope
2323

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:
2726

2827
- 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).
3129
- Basic Terraform concepts, such as variables and locals.
3230

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.
3533

3634
### Example configuration
3735

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+
3840
```
3941
terraform {
4042
required_providers {
@@ -118,26 +120,26 @@ resource "cloudfoundry_space_role" "space_developer" {
118120
}
119121
```
120122

121-
## Taken apart
123+
## Explanation of configuration
122124

123-
### STACKIT Provider Configuration
125+
### STACKIT provider configuration
124126

125127
```
126128
provider "stackit" {
127129
default_region = "eu01"
128130
}
129131
```
130132

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.
136138

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)
139141

140-
### stackit_scf_organization.scf_org
142+
### stackit_scf_organization.scf_org resource
141143

142144
```
143145
resource "stackit_scf_organization" "scf_org" {
@@ -146,15 +148,15 @@ resource "stackit_scf_organization" "scf_org" {
146148
}
147149
```
148150

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 organizations
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
154156
STACKIT provider to be configured with the necessary permissions for that
155157
project.
156158

157-
### stackit_scf_organization_manager.scf_manager
159+
### stackit_scf_organization_manager.scf_manager resource
158160

159161
```
160162
resource "stackit_scf_organization_manager" "scf_manager" {
@@ -163,13 +165,11 @@ resource "stackit_scf_organization_manager" "scf_manager" {
163165
}
164166
```
165167

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.
171171

172-
### stackit_scf_platform.scf_platform
172+
### stackit_scf_platform.scf_platform data source
173173

174174
```
175175
data "stackit_scf_platform" "scf_platform" {
@@ -179,10 +179,10 @@ data "stackit_scf_platform" "scf_platform" {
179179
```
180180

181181
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.
184184

185-
### Cloud Foundry Provider Configuration
185+
### Cloud Foundry provider configuration
186186

187187
```
188188
provider "cloudfoundry" {
@@ -192,53 +192,57 @@ provider "cloudfoundry" {
192192
}
193193
```
194194

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
200204

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.
203207

204-
## Deployment
208+
### Initialize Terraform
205209

206-
### init
210+
Run the following command to initialize the working directory and download the
211+
required provider plugins:
207212

208213
```
209214
terraform init
210215
```
211216

212-
The `terraform init` command initializes the working directory and downloads the
213-
necessary provider plugins.
217+
### Create the organization manager user
214218

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.
216222

217223
```
218224
terraform apply -target stackit_scf_organization_manager.scf_manager
219225
```
220226

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
225228

226-
### Apply Complete Configuration
229+
Run this command to provision all resources defined in your Terraform
230+
configuration within the Cloud Foundry organization:
227231

228232
```
229233
terraform apply
230234
```
231235

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
239237

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:
241241

242-
[Cloud Foundry Documentation](https://docs.cloudfoundry.org/)
242+
- `cf apps`
243+
- `cf services`
244+
- `cf routes`
243245

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/).

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
177177
- `redis_custom_endpoint` (String) Custom endpoint for the Redis service
178178
- `region` (String, Deprecated) Region will be used as the default location for regional services. Not all services require a region, some are global
179179
- `resourcemanager_custom_endpoint` (String) Custom endpoint for the Resource Manager service
180+
- `scf_custom_endpoint` (String) Custom endpoint for the Cloud Foundry (SCF) service
180181
- `secretsmanager_custom_endpoint` (String) Custom endpoint for the Secrets Manager service
181182
- `server_backup_custom_endpoint` (String) Custom endpoint for the Server Backup service
182183
- `server_update_custom_endpoint` (String) Custom endpoint for the Server Update service

0 commit comments

Comments
 (0)