Skip to content

Commit 75b1ede

Browse files
Documentation update (#524)
* Update Auth guide * Update docs
1 parent fc5f63b commit 75b1ede

9 files changed

Lines changed: 71 additions & 46 deletions

File tree

docs/data-sources/postgresql_credential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "stackit_postgresql_credential Data Source - stackit"
44
subcategory: ""
55
description: |-
66
PostgreSQL credential data source schema. Must have a region specified in the provider configuration.
7-
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackitpostgresflexuser instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
7+
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackit_postgresflex_user instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
88
---
99

1010
# stackit_postgresql_credential (Data Source)

docs/data-sources/postgresql_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "stackit_postgresql_instance Data Source - stackit"
44
subcategory: ""
55
description: |-
66
PostgreSQL instance data source schema. Must have a region specified in the provider configuration.
7-
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackitpostgresflexinstance instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
7+
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackit_postgresflex_instance instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
88
---
99

1010
# stackit_postgresql_instance (Data Source)

docs/index.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,23 @@ When setting up authentication, the provider will always try to use the key flow
5959

6060
### Key flow
6161

62-
To use the key flow, you need to have a service account key and an RSA key-pair.
63-
To configure it, follow this steps:
62+
The following instructions assume that you have created a service account and assigned the necessary permissions to it, e.g. `project.owner`.
6463

65-
The following instructions assume that you have created a service account and assigned it the necessary permissions, e.g. project.owner.
64+
To use the key flow, you need to have a service account key, which must have an RSA key-pair attached to it.
6665

67-
1. In the Portal, go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key.
66+
When creating the service account key, a new pair can be created automatically, which will be included in the service account key. This will make it much easier to configure the key flow authentication in the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), by just providing the service account key.
6867

69-
- You can create your own RSA key-pair or have the Portal generate one for you.
68+
**Optionally**, you can provide your own private key when creating the service account key, which will then require you to also provide it explicitly to the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), additionally to the service account key. Check the STACKIT Knowledge Base for an [example of how to create your own key-pair](https://docs.stackit.cloud/stackit/en/usage-of-the-service-account-keys-in-stackit-175112464.html#UsageoftheserviceaccountkeysinSTACKIT-CreatinganRSAkey-pair).
7069

71-
2. Save the content of the service account key and the corresponding private key by copying them or saving them in a file.
70+
To configure the key flow, follow this steps:
7271

73-
**Hint:** If you have generated the RSA key-pair using the Portal, you can save the private key in a PEM encoded file by downloading the service account key as a PEM file and using `openssl storeutl -keys <path/to/sa_key_pem_file> > private.key` to extract the private key from the service account key.
72+
1. Create a service account key:
7473

75-
The expected format of the service account key is a **json** with the following structure:
74+
- Use the [STACKIT Portal](https://portal.stackit.cloud/): go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key. For more details, see [Create a service account key](https://docs.stackit.cloud/stackit/en/create-a-service-account-key-175112456.html)
75+
76+
2. Save the content of the service account key by copying it and saving it in a JSON file.
77+
78+
The expected format of the service account key is a **JSON** with the following structure:
7679

7780
```json
7881
{
@@ -94,10 +97,18 @@ The expected format of the service account key is a **json** with the following
9497
}
9598
```
9699

97-
3. Configure the service account key and private key for authentication in the provider by following one of the alternatives below:
98-
- setting the fiels in the provider block: `service_account_key` or `service_account_key_path`, `private_key` or `private_key_path`
99-
- setting environment variables: `STACKIT_SERVICE_ACCOUNT_KEY_PATH` and `STACKIT_PRIVATE_KEY_PATH`
100-
- setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` and `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above)
100+
3. Configure the service account key for authentication in the provider by following one of the alternatives below:
101+
102+
- setting the fields in the provider block: `service_account_key` or `service_account_key_path`
103+
- setting the environment variable: `STACKIT_SERVICE_ACCOUNT_KEY_PATH`
104+
- setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` in the credentials file (see above)
105+
106+
> **Optionally, only if you have provided your own RSA key-pair when creating the service account key**, you also need to configure your private key (takes precedence over the one included in the service account key, if present). **The private key must be PEM encoded** and can be provided using one of the options below:
107+
>
108+
> - setting the field in the provider block: `private_key` or `private_key_path`
109+
> - setting the environment variable: `STACKIT_PRIVATE_KEY_PATH`
110+
> - setting `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above)
111+
101112

102113
### Token flow
103114

docs/resources/loadbalancer.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@ description: |-
88
To automate the creation of load balancers, OpenStack can be used to setup the supporting infrastructure.
99
To set up the OpenStack provider, you can create a token through the STACKIT Portal, in your project's Infrastructure API page.
1010
There, the OpenStack user domain name, username, and password are generated and can be obtained. The provider can then be configured as follows:
11-
```terraform
11+
1212
terraform {
13-
required_providers {
14-
(...)
15-
openstack = {
16-
source = "terraform-provider-openstack/openstack"
17-
}
18-
}
13+
required_providers {
14+
(...)
15+
openstack = {
16+
source = "terraform-provider-openstack/openstack"
17+
}
18+
}
1919
}
20+
2021
provider "openstack" {
21-
userdomainname = "{OpenStack user domain name}"
22-
username = "{OpenStack username}"
23-
password = "{OpenStack password}"
24-
region = "RegionOne"
25-
authurl = "https://keystone.api.iaas.eu01.stackit.cloud/v3"
22+
user_domain_name = "{OpenStack user domain name}"
23+
user_name = "{OpenStack username}"
24+
password = "{OpenStack password}"
25+
region = "RegionOne"
26+
auth_url = "https://keystone.api.iaas.eu01.stackit.cloud/v3"
2627
}
27-
```
28+
29+
2830
Configuring the supporting infrastructure
2931
The example below uses OpenStack to create the network, router, a public IP address and a compute instance.
3032
---

docs/resources/postgresql_credential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "stackit_postgresql_credential Resource - stackit"
44
subcategory: ""
55
description: |-
66
PostgreSQL credential resource schema. Must have a region specified in the provider configuration.
7-
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackitpostgresflexuser instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
7+
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackit_postgresflex_user instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
88
---
99

1010
# stackit_postgresql_credential (Resource)

docs/resources/postgresql_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "stackit_postgresql_instance Resource - stackit"
44
subcategory: ""
55
description: |-
66
PostgreSQL instance resource schema. Must have a region specified in the provider configuration.
7-
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackitpostgresflexinstance instead. Check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html on how to backup and restore an instance from PostgreSQL to PostgreSQL Flex, then import the resource to Terraform using an "import" block (https://developer.hashicorp.com/terraform/language/import)
7+
!> The STACKIT PostgreSQL service has reached its end of support on June 30th 2024. Resources of this type have stopped working since then. Use stackit_postgresflex_instance instead. Check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html on how to backup and restore an instance from PostgreSQL to PostgreSQL Flex, then import the resource to Terraform using an "import" block (https://developer.hashicorp.com/terraform/language/import)
88
---
99

1010
# stackit_postgresql_instance (Resource)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ require (
4646
github.com/fatih/color v1.16.0 // indirect
4747
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
4848
github.com/golang/protobuf v1.5.4 // indirect
49-
github.com/hashicorp/errwrap v1.0.0 // indirect
49+
github.com/hashicorp/errwrap v1.1.0 // indirect
5050
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
5151
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
5252
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
@@ -73,7 +73,7 @@ require (
7373
github.com/mitchellh/mapstructure v1.5.0 // indirect
7474
github.com/mitchellh/reflectwalk v1.0.2 // indirect
7575
github.com/oklog/run v1.1.0 // indirect
76-
github.com/rogpeppe/go-internal v1.11.0 // indirect
76+
github.com/rogpeppe/go-internal v1.12.0 // indirect
7777
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.3.0
7878
github.com/stretchr/testify v1.8.4 // indirect
7979
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
4949
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
5050
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
5151
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
52-
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
5352
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
53+
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
54+
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
5455
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
5556
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
5657
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
@@ -140,8 +141,8 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK
140141
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
141142
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
142143
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
143-
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
144-
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
144+
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
145+
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
145146
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
146147
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
147148
github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A=

templates/index.md.tmpl

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,23 @@ When setting up authentication, the provider will always try to use the key flow
3333

3434
### Key flow
3535

36-
To use the key flow, you need to have a service account key and an RSA key-pair.
37-
To configure it, follow this steps:
36+
The following instructions assume that you have created a service account and assigned the necessary permissions to it, e.g. `project.owner`.
3837

39-
The following instructions assume that you have created a service account and assigned it the necessary permissions, e.g. project.owner.
38+
To use the key flow, you need to have a service account key, which must have an RSA key-pair attached to it.
4039

41-
1. In the Portal, go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key.
40+
When creating the service account key, a new pair can be created automatically, which will be included in the service account key. This will make it much easier to configure the key flow authentication in the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), by just providing the service account key.
4241

43-
- You can create your own RSA key-pair or have the Portal generate one for you.
42+
**Optionally**, you can provide your own private key when creating the service account key, which will then require you to also provide it explicitly to the [STACKIT Terraform Provider](https://github.com/stackitcloud/terraform-provider-stackit), additionally to the service account key. Check the STACKIT Knowledge Base for an [example of how to create your own key-pair](https://docs.stackit.cloud/stackit/en/usage-of-the-service-account-keys-in-stackit-175112464.html#UsageoftheserviceaccountkeysinSTACKIT-CreatinganRSAkey-pair).
4443

45-
2. Save the content of the service account key and the corresponding private key by copying them or saving them in a file.
44+
To configure the key flow, follow this steps:
4645

47-
**Hint:** If you have generated the RSA key-pair using the Portal, you can save the private key in a PEM encoded file by downloading the service account key as a PEM file and using `openssl storeutl -keys <path/to/sa_key_pem_file> > private.key` to extract the private key from the service account key.
46+
1. Create a service account key:
4847

49-
The expected format of the service account key is a **json** with the following structure:
48+
- Use the [STACKIT Portal](https://portal.stackit.cloud/): go to the `Service Accounts` tab, choose a `Service Account` and go to `Service Account Keys` to create a key. For more details, see [Create a service account key](https://docs.stackit.cloud/stackit/en/create-a-service-account-key-175112456.html)
49+
50+
2. Save the content of the service account key by copying it and saving it in a JSON file.
51+
52+
The expected format of the service account key is a **JSON** with the following structure:
5053

5154
```json
5255
{
@@ -68,10 +71,18 @@ The expected format of the service account key is a **json** with the following
6871
}
6972
```
7073

71-
3. Configure the service account key and private key for authentication in the provider by following one of the alternatives below:
72-
- setting the fiels in the provider block: `service_account_key` or `service_account_key_path`, `private_key` or `private_key_path`
73-
- setting environment variables: `STACKIT_SERVICE_ACCOUNT_KEY_PATH` and `STACKIT_PRIVATE_KEY_PATH`
74-
- setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` and `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above)
74+
3. Configure the service account key for authentication in the provider by following one of the alternatives below:
75+
76+
- setting the fields in the provider block: `service_account_key` or `service_account_key_path`
77+
- setting the environment variable: `STACKIT_SERVICE_ACCOUNT_KEY_PATH`
78+
- setting `STACKIT_SERVICE_ACCOUNT_KEY_PATH` in the credentials file (see above)
79+
80+
> **Optionally, only if you have provided your own RSA key-pair when creating the service account key**, you also need to configure your private key (takes precedence over the one included in the service account key, if present). **The private key must be PEM encoded** and can be provided using one of the options below:
81+
>
82+
> - setting the field in the provider block: `private_key` or `private_key_path`
83+
> - setting the environment variable: `STACKIT_PRIVATE_KEY_PATH`
84+
> - setting `STACKIT_PRIVATE_KEY_PATH` in the credentials file (see above)
85+
7586

7687
### Token flow
7788

0 commit comments

Comments
 (0)