@@ -32,8 +32,9 @@ type resourceTFEAWSOIDCConfiguration struct {
32
32
}
33
33
34
34
type modelTFEAWSOIDCConfiguration struct {
35
- ID types.String `tfsdk:"id"`
36
- RoleARN types.String `tfsdk:"role_arn"`
35
+ ID types.String `tfsdk:"id"`
36
+ RoleARN types.String `tfsdk:"role_arn"`
37
+ Organization types.String `tfsdk:"organization"`
37
38
}
38
39
39
40
func (r * resourceTFEAWSOIDCConfiguration ) Configure (_ context.Context , req resource.ConfigureRequest , resp * resource.ConfigureResponse ) {
@@ -73,13 +74,20 @@ func (r *resourceTFEAWSOIDCConfiguration) Schema(_ context.Context, _ resource.S
73
74
stringplanmodifier .RequiresReplace (),
74
75
},
75
76
},
77
+ "organization" : schema.StringAttribute {
78
+ Description : "Name of the organization to which the TFE AWS OIDC configuration belongs." ,
79
+ Optional : true ,
80
+ Computed : true ,
81
+ PlanModifiers : []planmodifier.String {
82
+ stringplanmodifier .RequiresReplace (),
83
+ },
84
+ },
76
85
},
77
86
Description : "Generates a new TFE AWS OIDC Configuration." ,
78
87
}
79
88
}
80
89
81
90
func (r * resourceTFEAWSOIDCConfiguration ) ImportState (ctx context.Context , req resource.ImportStateRequest , resp * resource.ImportStateResponse ) {
82
- // TODO: confirm this is right
83
91
resource .ImportStatePassthroughID (ctx , path .Root ("id" ), req , resp )
84
92
}
85
93
@@ -115,7 +123,7 @@ func (r *resourceTFEAWSOIDCConfiguration) Create(ctx context.Context, req resour
115
123
116
124
func (r * resourceTFEAWSOIDCConfiguration ) Read (ctx context.Context , req resource.ReadRequest , resp * resource.ReadResponse ) {
117
125
// Read Terraform state into the model
118
- var state modelTFETeamToken
126
+ var state modelTFEAWSOIDCConfiguration
119
127
diags := req .State .Get (ctx , & state )
120
128
resp .Diagnostics .Append (diags ... )
121
129
if resp .Diagnostics .HasError () {
@@ -191,7 +199,8 @@ func (r *resourceTFEAWSOIDCConfiguration) Delete(ctx context.Context, req resour
191
199
192
200
func modelFromTFEAWSOIDCConfiguration (p * tfe.AWSOIDCConfiguration ) modelTFEAWSOIDCConfiguration {
193
201
return modelTFEAWSOIDCConfiguration {
194
- ID : types .StringValue (p .ID ),
195
- RoleARN : types .StringValue (p .RoleARN ),
202
+ ID : types .StringValue (p .ID ),
203
+ RoleARN : types .StringValue (p .RoleARN ),
204
+ Organization : types .StringValue (p .Organization .Name ),
196
205
}
197
206
}
0 commit comments