Skip to content

Commit f307154

Browse files
committed
mark as experimental
1 parent 9df5f98 commit f307154

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

docs/resources/secretsmanager_instance_role_binding.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ page_title: "stackit_secretsmanager_instance_role_binding Resource - stackit"
44
subcategory: ""
55
description: |-
66
IAM role binding resource schema.
7+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
78
---
89

910
# stackit_secretsmanager_instance_role_binding (Resource)
1011

1112
IAM role binding resource schema.
1213

14+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
15+
1316
## Example Usage
1417

1518
```terraform

docs/resources/secretsmanager_secret_group_role_binding.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ page_title: "stackit_secretsmanager_secret_group_role_binding Resource - stackit
44
subcategory: ""
55
description: |-
66
IAM role binding resource schema.
7+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
78
---
89

910
# stackit_secretsmanager_secret_group_role_binding (Resource)
1011

1112
IAM role binding resource schema.
1213

14+
~> This resource is part of the iam experiment and is likely going to undergo significant changes or be removed in the future. Use it at your own discretion.
15+
1316
## Example Usage
1417

1518
```terraform

stackit/internal/services/iam/rolebindings/generic/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (r *RoleBindingResource[C]) Configure(ctx context.Context, req resource.Con
8484
// Schema defines the schema for the resource.
8585
func (r *RoleBindingResource[C]) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
8686
resp.Schema = schema.Schema{
87-
Description: "IAM role binding resource schema.",
87+
Description: features.AddExperimentDescription("IAM role binding resource schema.", features.IamExperiment, core.Resource),
8888
Attributes: map[string]schema.Attribute{
8989
"id": schema.StringAttribute{
9090
Description: "Terraform's internal resource identifier. It is structured as \"`region`,`resource_id`,`role`,`subject`\".",

stackit/internal/services/iam/rolebindings/generic/resource_test.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
package generic
22

33
import (
4+
"fmt"
45
"testing"
56

7+
"github.com/google/uuid"
8+
"github.com/hashicorp/terraform-plugin-framework/types"
69
secretsmanagerV1Alpha "github.com/stackitcloud/stackit-sdk-go/services/secretsmanager/v1alphaapi"
710
)
811

912
func Test_mapFields(t *testing.T) {
13+
const testRegion = "eu01"
14+
resourceId := uuid.New().String()
15+
1016
type args struct {
1117
resp GenericRoleBindingResponse
1218
model *Model
@@ -19,10 +25,23 @@ func Test_mapFields(t *testing.T) {
1925
wantErr bool
2026
}{
2127
{
22-
name: "success",
28+
name: "default",
2329
args: args{
24-
resp: &secretsmanagerV1Alpha.RoleBinding{},
25-
model: &Model{},
30+
region: testRegion,
31+
resp: &secretsmanagerV1Alpha.RoleBinding{
32+
Role: "owner",
33+
Subject: "john.doe@example.com",
34+
},
35+
model: &Model{
36+
ResourceId: types.StringValue(resourceId),
37+
},
38+
},
39+
wantModel: &Model{
40+
Id: types.StringValue(fmt.Sprintf("%s,%s,owner,john.doe@example.com", testRegion, resourceId)),
41+
ResourceId: types.StringValue(resourceId),
42+
Role: types.StringValue("owner"),
43+
Subject: types.StringValue("john.doe@example.com"),
44+
Region: types.StringValue(testRegion),
2645
},
2746
wantErr: false,
2847
},

0 commit comments

Comments
 (0)