Skip to content

Commit d793342

Browse files
authored
chore(docs): add guide how to create service account in empty org (#862)
relates to #855
1 parent a47fac0 commit d793342

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
page_title: "Creating projects in empty organization via Terraform"
3+
---
4+
# Creating projects in empty organization via Terraform
5+
6+
Consider the following situation: You're starting with an empty STACKIT organization and want to create projects
7+
in this organization using the `stackit_resourcemanager_project` resource. Unfortunately it's not possible to create
8+
a service account on organization level which can be used for authentication in the STACKIT Terraform provider.
9+
The following steps will help you to get started:
10+
11+
1. Using the STACKIT portal, create a dummy project in your organization which will hold your service account, let's name it e.g. "dummy-service-account-project".
12+
2. In this "dummy-service-account-project", create a service account. Create and save a service account key to use for authentication for the STACKIT Terraform provider later as described in the docs. Now copy the e-mail address of the service account you just created.
13+
3. Here comes the important part: Navigate to your organization, open it and select "Access". Click on the "Grant access" button and paste the e-mail address of your service account. Be careful to grant the service account enough permissions to create projects in your organization, e.g. by assigning the "owner" role to it.
14+
15+
*This problem was brought up initially in [this](https://github.com/stackitcloud/terraform-provider-stackit/issues/855) issue on GitHub.*

docs/resources/resourcemanager_project.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ page_title: "stackit_resourcemanager_project Resource - stackit"
44
subcategory: ""
55
description: |-
66
Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.
7+
-> In case you're getting started with an empty STACKIT organization and want to use this resource to create projects in it, check out this guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/stackit_org_service_account for how to create a service account which you can use for authentication in the STACKIT Terraform provider.
78
---
89

910
# stackit_resourcemanager_project (Resource)
1011

1112
Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.
1213

14+
-> In case you're getting started with an empty STACKIT organization and want to use this resource to create projects in it, check out [this guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/stackit_org_service_account) for how to create a service account which you can use for authentication in the STACKIT Terraform provider.
15+
1316
## Example Usage
1417

1518
```terraform

stackit/internal/services/resourcemanager/project/resource.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
9191
// Schema defines the schema for the resource.
9292
func (r *projectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
9393
descriptions := map[string]string{
94-
"main": "Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.",
94+
"main": fmt.Sprintf("%s\n\n%s",
95+
"Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.",
96+
"-> In case you're getting started with an empty STACKIT organization and want to use this resource to create projects in it, check out [this guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/stackit_org_service_account) for how to create a service account which you can use for authentication in the STACKIT Terraform provider.",
97+
),
9598
"id": "Terraform's internal resource ID. It is structured as \"`container_id`\".",
9699
"project_id": "Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project.",
97100
"container_id": "Project container ID. Globally unique, user-friendly identifier.",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
page_title: "Creating projects in empty organization via Terraform"
3+
---
4+
# Creating projects in empty organization via Terraform
5+
6+
Consider the following situation: You're starting with an empty STACKIT organization and want to create projects
7+
in this organization using the `stackit_resourcemanager_project` resource. Unfortunately it's not possible to create
8+
a service account on organization level which can be used for authentication in the STACKIT Terraform provider.
9+
The following steps will help you to get started:
10+
11+
1. Using the STACKIT portal, create a dummy project in your organization which will hold your service account, let's name it e.g. "dummy-service-account-project".
12+
2. In this "dummy-service-account-project", create a service account. Create and save a service account key to use for authentication for the STACKIT Terraform provider later as described in the docs. Now copy the e-mail address of the service account you just created.
13+
3. Here comes the important part: Navigate to your organization, open it and select "Access". Click on the "Grant access" button and paste the e-mail address of your service account. Be careful to grant the service account enough permissions to create projects in your organization, e.g. by assigning the "owner" role to it.
14+
15+
*This problem was brought up initially in [this](https://github.com/stackitcloud/terraform-provider-stackit/issues/855) issue on GitHub.*

0 commit comments

Comments
 (0)