Skip to content

Commit 0e583ff

Browse files
JorTurFerJorge Turrado
authored andcommitted
Add test
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
1 parent cd4e912 commit 0e583ff

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

  • examples/resources/stackit_service_account_federated_identity_provider
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
resource "stackit_service_account" "sa" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
name = "my-service-account"
4+
}
5+
6+
resource "stackit_service_account_federated_identity_provider" "provider" {
7+
project_id = stackit_service_account.sa.project_id
8+
service_account_email = stackit_service_account.sa.email
9+
name = "gh-actions"
10+
issuer = "https://token.actions.githubusercontent.com"
11+
12+
assertions = [
13+
{
14+
item = "aud"
15+
operator = "equals"
16+
value = "sts.accounts.stackit.cloud"
17+
}
18+
{
19+
item = "sub"
20+
operator = "equals"
21+
value = "repo:stackitcloud/terraform-provider-stackit:ref:refs/heads/main"
22+
}
23+
]
24+
}
25+
26+
# Only use the import statement, if you want to import an existing federated identity provider
27+
import {
28+
to = stackit_service_account_federated_identity_provider.import-example
29+
id = "${var.project_id},${var.service_account_email},${var.federation_id}"
30+
}

0 commit comments

Comments
 (0)