Skip to content

Commit 808401b

Browse files
committed
update docs
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
1 parent de65049 commit 808401b

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/resources/service_account_federated_identity_provider.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,40 @@ resource "stackit_service_account_federated_identity_provider" "provider" {
6868
6969
```
7070

71+
## Example Usage
72+
73+
```terraform
74+
resource "stackit_service_account" "sa" {
75+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
76+
name = "my-service-account"
77+
}
78+
79+
resource "stackit_service_account_federated_identity_provider" "provider" {
80+
project_id = stackit_service_account.sa.project_id
81+
service_account_email = stackit_service_account.sa.email
82+
name = "gh-actions"
83+
issuer = "https://token.actions.githubusercontent.com"
84+
85+
assertions = [
86+
{
87+
item = "aud"
88+
operator = "equals"
89+
value = "sts.accounts.stackit.cloud"
90+
}
91+
{
92+
item = "sub"
93+
operator = "equals"
94+
value = "repo:stackitcloud/terraform-provider-stackit:ref:refs/heads/main"
95+
}
96+
]
97+
}
7198
99+
# Only use the import statement, if you want to import an existing federated identity provider
100+
import {
101+
to = stackit_service_account_federated_identity_provider.import-example
102+
id = "${var.project_id},${var.service_account_email},${var.federation_id}"
103+
}
104+
```
72105

73106
<!-- schema generated by tfplugindocs -->
74107
## Schema

0 commit comments

Comments
 (0)