@@ -132,26 +132,8 @@ func resourceStackComponentCreate(ctx context.Context, d *schema.ResourceData, m
132132 return diag .FromErr (fmt .Errorf ("failed to create component: %w" , err ))
133133 }
134134
135- // Set the ID from the response
136135 d .SetId (resp .ID )
137-
138- // Set other attributes from the response
139- d .Set ("name" , resp .Name )
140- if resp .Body != nil {
141- d .Set ("type" , resp .Body .Type )
142- d .Set ("flavor" , resp .Body .Flavor )
143- }
144- if resp .Metadata != nil {
145- d .Set ("configuration" , resp .Metadata .Configuration )
146- if resp .Metadata .ConnectorResourceID != nil {
147- d .Set ("connector_resource_id" , * resp .Metadata .ConnectorResourceID )
148- }
149- if resp .Metadata .Labels != nil {
150- d .Set ("labels" , resp .Metadata .Labels )
151- }
152- }
153-
154- return nil
136+ return resourceStackComponentRead (ctx , d , m )
155137}
156138
157139func resourceStackComponentRead (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
@@ -180,6 +162,9 @@ func resourceStackComponentRead(ctx context.Context, d *schema.ResourceData, m i
180162 if component .Metadata != nil {
181163 d .Set ("configuration" , component .Metadata .Configuration )
182164
165+ if component .Metadata .Connector != nil {
166+ d .Set ("connector_id" , component .Metadata .Connector .ID )
167+ }
183168 if component .Metadata .ConnectorResourceID != nil {
184169 d .Set ("connector_resource_id" , * component .Metadata .ConnectorResourceID )
185170 }
0 commit comments