Skip to content

Commit 188a4f5

Browse files
authored
feat(k8s): add support for project id (#602)
1 parent 7722339 commit 188a4f5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/resources/k8s_cluster_beta.md

+2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ The following arguments are supported:
158158

159159
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the cluster is associated with.
160160

161+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the cluster is associated with.
162+
161163

162164
## Attributes Reference
163165

scaleway/resource_k8s_cluster_beta.go

+4
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ func resourceScalewayK8SClusterBeta() *schema.Resource {
280280
},
281281
"region": regionSchema(),
282282
"organization_id": organizationIDSchema(),
283+
"project_id": projectIDSchema(),
283284
// Computed elements
284285
"created_at": {
285286
Type: schema.TypeString,
@@ -362,6 +363,7 @@ func resourceScalewayK8SClusterBetaCreate(d *schema.ResourceData, m interface{})
362363
req := &k8s.CreateClusterRequest{
363364
Region: region,
364365
OrganizationID: expandStringPtr(d.Get("organization_id")),
366+
ProjectID: expandStringPtr(d.Get("project_id")),
365367
Name: expandOrGenerateString(d.Get("name"), "cluster"),
366368
Description: description.(string),
367369
Cni: k8s.CNI(d.Get("cni").(string)),
@@ -617,6 +619,8 @@ func resourceScalewayK8SClusterBetaRead(d *schema.ResourceData, m interface{}) e
617619

618620
_ = d.Set("region", string(region))
619621
_ = d.Set("name", response.Name)
622+
_ = d.Set("organization_id", response.OrganizationID)
623+
_ = d.Set("project_id", response.ProjectID)
620624
_ = d.Set("description", response.Description)
621625
_ = d.Set("cni", response.Cni)
622626
_ = d.Set("tags", response.Tags)

0 commit comments

Comments
 (0)