-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from volcengine/feat/updateVke-v2.8.0
Feat/update vke v2.8.0
- Loading branch information
Showing
22 changed files
with
640 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
data "volcengine_vke_kubeconfigs" "default"{ | ||
cluster_ids = ["cce7hb97qtofmj1oi4udg"] | ||
types = ["Private", "Public"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resource "volcengine_vke_kubeconfig" "foo" { | ||
cluster_id = "cce7hb97qtofmj1oi4udg" | ||
type = "Private" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
volcengine/vke/kubeconfig/data_source_volcengine_vke_kubeconfigs.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
package kubeconfig | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | ||
"github.com/hashicorp/terraform-plugin-sdk/helper/validation" | ||
ve "github.com/volcengine/terraform-provider-volcengine/common" | ||
) | ||
|
||
func DataSourceVolcengineVkeKubeconfigs() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: dataSourceVolcengineVkeKubeconfigsRead, | ||
Schema: map[string]*schema.Schema{ | ||
"ids": { | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
Set: schema.HashString, | ||
Description: "A list of Kubeconfig IDs.", | ||
}, | ||
"name_regex": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringIsValidRegExp, | ||
Description: "A Name Regex of Kubeconfig.", | ||
}, | ||
"output_file": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Description: "File name where to save data source results.", | ||
}, | ||
"total_count": { | ||
Type: schema.TypeInt, | ||
Computed: true, | ||
Description: "The total count of Kubeconfig query.", | ||
}, | ||
"page_number": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Computed: true, | ||
Description: "The page number of Kubeconfigs query.", | ||
}, | ||
"page_size": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Computed: true, | ||
Description: "The page size of Kubeconfigs query.", | ||
}, | ||
|
||
"cluster_ids": { | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
Set: schema.HashString, | ||
Description: "A list of Cluster IDs.", | ||
}, | ||
"types": { | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
Set: schema.HashString, | ||
Description: "The type of Kubeconfigs query.", | ||
}, | ||
|
||
"kubeconfigs": { | ||
Description: "The collection of VkeKubeconfig query.", | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The ID of the Kubeconfig.", | ||
}, | ||
"kubeconfig_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The ID of the Kubeconfig.", | ||
}, | ||
"user_id": { | ||
Type: schema.TypeInt, | ||
Computed: true, | ||
Description: "The account ID of the Kubeconfig.", | ||
}, | ||
"cluster_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The Cluster ID of the Kubeconfig.", | ||
}, | ||
"type": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The type of the Kubeconfig.", | ||
}, | ||
"create_time": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The create time of the Kubeconfig.", | ||
}, | ||
"expire_time": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The expire time of the Kubeconfig.", | ||
}, | ||
"kubeconfig": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "Kubeconfig data with public/private network access, returned in BASE64 encoding.", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func dataSourceVolcengineVkeKubeconfigsRead(d *schema.ResourceData, meta interface{}) (err error) { | ||
kubeconfigService := NewVkeKubeconfigService(meta.(*ve.SdkClient)) | ||
return kubeconfigService.Dispatcher.Data(kubeconfigService, d, DataSourceVolcengineVkeKubeconfigs()) | ||
} |
Oops, something went wrong.