@@ -249,6 +249,13 @@ func ResourcePool() *schema.Resource {
249249 Computed : true ,
250250 Description : "The status of the pool" ,
251251 },
252+ "security_group_id" : {
253+ Type : schema .TypeString ,
254+ Computed : true ,
255+ Optional : true ,
256+ ForceNew : true ,
257+ Description : "The ID of the security group" ,
258+ },
252259 },
253260 }
254261}
@@ -324,6 +331,10 @@ func ResourceK8SPoolCreate(ctx context.Context, d *schema.ResourceData, m any) d
324331 req .RootVolumeSize = & volumeSizeInBytes
325332 }
326333
334+ if securityGroupID , ok := d .GetOk ("security_group_id" ); ok {
335+ req .SecurityGroupID = types .ExpandStringPtr (locality .ExpandID (securityGroupID .(string )))
336+ }
337+
327338 // check if the cluster is waiting for a pool
328339 cluster , err := k8sAPI .GetCluster (& k8s.GetClusterRequest {
329340 ClusterID : locality .ExpandID (d .Get ("cluster_id" )),
@@ -422,6 +433,7 @@ func ResourceK8SPoolRead(ctx context.Context, d *schema.ResourceData, m any) dia
422433 _ = d .Set ("zone" , pool .Zone )
423434 _ = d .Set ("upgrade_policy" , poolUpgradePolicyFlatten (pool ))
424435 _ = d .Set ("public_ip_disabled" , pool .PublicIPDisabled )
436+ _ = d .Set ("security_group_id" , pool .SecurityGroupID )
425437
426438 if pool .PlacementGroupID != nil {
427439 _ = d .Set ("placement_group_id" , zonal .NewID (pool .Zone , * pool .PlacementGroupID ).String ())
0 commit comments