Skip to content

Commit 203054c

Browse files
Merge pull request #53 from MagaluCloud/update-files-3a65e55800ac1e6ba3d4fb9267e7361ebaab56bf
Update files from source repository
2 parents d2bd483 + ae3f383 commit 203054c

27 files changed

+420
-263
lines changed

docs/data-sources/kubernetes_cluster.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ description: |-
1010

1111
Data source for Kubernetes cluster in MGC
1212

13-
```hcl
14-
data "mgc_kubernetes_cluster" "cluster" {
15-
id = {cluster_ID}
13+
## Example Usage
14+
15+
```terraform
16+
data "mgc_kubernetes_cluster_kubeconfig" "cluster" {
17+
cluster_id = mgc_kubernetes_cluster.my_cluster.id
18+
}
19+
20+
output "cluster" {
21+
value = data.mgc_kubernetes_cluster_kubeconfig.cluster
1622
}
1723
```
1824

1925
<!-- schema generated by tfplugindocs -->
20-
2126
## Schema
2227

2328
### Required
@@ -53,7 +58,6 @@ data "mgc_kubernetes_cluster" "cluster" {
5358
- `zone` (String) Identifier of the zone where the Kubernetes cluster is located.
5459

5560
<a id="nestedatt--controlplane"></a>
56-
5761
### Nested Schema for `controlplane`
5862

5963
Read-Only:
@@ -79,7 +83,6 @@ Read-Only:
7983
- `zone` (List of String) Availability zone for creating the Kubernetes cluster.
8084

8185
<a id="nestedatt--controlplane--taints"></a>
82-
8386
### Nested Schema for `controlplane.taints`
8487

8588
Read-Only:
@@ -88,8 +91,9 @@ Read-Only:
8891
- `key` (String) Key of the taint to be applied to the node.
8992
- `value` (String) Value corresponding to the taint key.
9093

91-
<a id="nestedatt--node_pools"></a>
9294

95+
96+
<a id="nestedatt--node_pools"></a>
9397
### Nested Schema for `node_pools`
9498

9599
Read-Only:
@@ -106,7 +110,6 @@ Read-Only:
106110
- `updated_at` (String) Date of the last change to the Kubernetes Node.
107111

108112
<a id="nestedatt--node_pools--taints"></a>
109-
110113
### Nested Schema for `node_pools.taints`
111114

112115
Read-Only:

docs/data-sources/kubernetes_cluster_kubeconfig.md

+13-62
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,27 @@ description: |-
88

99
# mgc_kubernetes_cluster_kubeconfig (Data Source)
1010

11-
Retrieves the kubeconfig for a specified Kubernetes cluster using its unique identifier.
12-
13-
## Schema
14-
15-
### Required
16-
17-
- **`cluster_id`** (String): The unique identifier of the Kubernetes cluster. This is used to fetch the corresponding kubeconfig.
18-
19-
### Read-Only
20-
21-
- **`kubeconfig`** (String): The kubeconfig of the specified Kubernetes cluster. This contains all necessary details to connect to your Kubernetes cluster, including API server addresses and authentication details.
11+
Get the kubeconfig of a Kubernetes cluster by cluster_id.
2212

2313
## Example Usage
2414

25-
The following example demonstrates how to use this data source to retrieve the kubeconfig for a Kubernetes cluster and then save it as a local file. This is particularly useful for configuring Kubernetes clients or CI/CD pipelines that need to interact with your cluster.
26-
27-
```hcl
28-
terraform {
29-
required_providers {
30-
mgc = {
31-
source = "registry.terraform.io/magalucloud/mgc"
32-
}
33-
local = {
34-
source = "hashicorp/local"
35-
version = "2.5.1"
36-
}
37-
}
15+
```terraform
16+
data "mgc_kubernetes_cluster" "cluster" {
17+
id = mgc_kubernetes_cluster.my_cluster.id
3818
}
3919
40-
provider "mgc" {
41-
alias = "sudeste"
42-
region = "br-se1"
43-
api_key = "YOUR_API_KEY"
20+
output "cluster" {
21+
value = data.mgc_kubernetes_cluster.cluster
4422
}
23+
```
4524

46-
# Fetch the kubeconfig for the specified Kubernetes cluster
47-
data "mgc_kubernetes_cluster_kubeconfig" "cluster" {
48-
cluster_id = "a132d346-cfe9-4f0e-bf88-4688437ee8fe"
49-
}
25+
<!-- schema generated by tfplugindocs -->
26+
## Schema
5027

51-
# Save the kubeconfig to a local file
52-
resource "local_file" "kubeconfig" {
53-
provider = local
54-
content = data.mgc_kubernetes_cluster_kubeconfig.cluster.kubeconfig
55-
filename = "${path.module}/kubeconfig.yaml"
56-
}
57-
```
28+
### Required
5829

59-
## Example Output
30+
- `cluster_id` (String) The unique identifier of the Kubernetes cluster.
6031

61-
Below is an example of the kubeconfig file content that will be saved as `kubeconfig.yaml`:
32+
### Read-Only
6233

63-
```yaml
64-
apiVersion: v1
65-
clusters:
66-
- cluster:
67-
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQVRFL0VYQU1QTEUtLS0tLS0tLS0=
68-
server: https://example-server:6443
69-
name: example-cluster
70-
contexts:
71-
- context:
72-
cluster: example-cluster
73-
user: example-admin
74-
name: example-admin@example-cluster
75-
current-context: example-admin@example-cluster
76-
kind: Config
77-
preferences: {}
78-
users:
79-
- name: example-admin
80-
user:
81-
client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQVRFL0VYQU1QTEUtLS0tLS0tLS0=
82-
client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLS0tLS0=
83-
```
34+
- `kubeconfig` (String) The full contents of the Kubernetes cluster's kubeconfig yaml file.

docs/data-sources/kubernetes_flavor.md

+3-15
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ description: |-
1010

1111
Available flavors for Kubernetes clusters.
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_kubernetes_flavor" "flavor" {
1517
}
1618
@@ -19,28 +21,14 @@ output "flavor_output" {
1921
}
2022
```
2123

22-
2324
<!-- schema generated by tfplugindocs -->
2425
## Schema
2526

2627
### Read-Only
2728

28-
- `bastion` (Attributes List) Bastion configuration. (see [below for nested schema](#nestedatt--bastion))
2929
- `controlplane` (Attributes List) Control plane configuration. (see [below for nested schema](#nestedatt--controlplane))
3030
- `nodepool` (Attributes List) Node pool configuration. (see [below for nested schema](#nestedatt--nodepool))
3131

32-
<a id="nestedatt--bastion"></a>
33-
### Nested Schema for `bastion`
34-
35-
Read-Only:
36-
37-
- `id` (String) ID of the flavor.
38-
- `name` (String) Name of the flavor.
39-
- `ram` (Number) Amount of RAM in MB.
40-
- `size` (Number) Size of the flavor.
41-
- `vcpu` (Number) Number of virtual CPUs.
42-
43-
4432
<a id="nestedatt--controlplane"></a>
4533
### Nested Schema for `controlplane`
4634

docs/data-sources/kubernetes_node.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ description: |-
1010

1111
Data source for Kubernetes cluster in MGC
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_kubernetes_node" "node" {
15-
nodepool_id = mgc_kubernetes_nodepool.gp1_small.id
16-
cluster_id = mgc_kubernetes_cluster.cluster_with_nodepool.id
17+
nodepool_id = mgc_kubernetes_nodepool.my_nodepool.id
18+
cluster_id = mgc_kubernetes_cluster.my_cluster.id
1719
}
18-
```
1920
21+
output "node" {
22+
value = data.mgc_kubernetes_node.node
23+
}
24+
```
2025

2126
<!-- schema generated by tfplugindocs -->
2227
## Schema

docs/data-sources/kubernetes_nodepool.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ description: |-
1010

1111
Data source for Kubernetes Nodepool
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_kubernetes_nodepool" "nodepool" {
15-
id = mgc_kubernetes_nodepool.gp1_small.id
16-
cluster_id = mgc_kubernetes_cluster.cluster_with_nodepool.id
17+
id = mgc_kubernetes_nodepool.my_nodepool.id
18+
cluster_id = mgc_kubernetes_cluster.my_cluster.id
1719
}
18-
```
1920
21+
output "nodepool" {
22+
value = data.mgc_kubernetes_nodepool.nodepool
23+
}
24+
```
2025

2126
<!-- schema generated by tfplugindocs -->
2227
## Schema

docs/data-sources/kubernetes_version.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ description: |-
1010

1111
Get the available versions of Kubernetes.
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_kubernetes_version" "cluster_version" {
1517
}
1618
@@ -19,7 +21,6 @@ output "cluster_version_output" {
1921
}
2022
```
2123

22-
2324
<!-- schema generated by tfplugindocs -->
2425
## Schema
2526

docs/data-sources/virtual_machine_images.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ description: |-
1010

1111
Get the available virtual-machine images.
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_virtual_machine_images" "images" {
1517
}
1618
@@ -19,7 +21,6 @@ output "vm_images" {
1921
}
2022
```
2123

22-
2324
<!-- schema generated by tfplugindocs -->
2425
## Schema
2526

@@ -32,6 +33,6 @@ output "vm_images" {
3233

3334
Read-Only:
3435

35-
- `id` (Boolean) ID of image.
36+
- `id` (String) ID of image.
3637
- `name` (String) The image name.
37-
- `plataform` (String) The image platform.
38+
- `platform` (String) The image platform.

docs/data-sources/virtual_machine_instance.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ description: |-
1010

1111
Get the available virtual-machine instance details
1212

13-
```hcl
13+
## Example Usage
14+
15+
```terraform
1416
data "mgc_virtual_machine_instances" "instances" {
15-
id = {instance id}
17+
id = mgc_virtual_machine_instances.my_vm.id
1618
}
1719
1820
output "vm_instances" {
1921
value = data.mgc_virtual_machine_instances.instances
2022
}
2123
```
2224

23-
2425
<!-- schema generated by tfplugindocs -->
2526
## Schema
2627

docs/data-sources/virtual_machine_instances.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
page_title: "mgc_virtual_machine_instances Data Source - terraform-provider-mgc"
44
subcategory: "Virtual Machine"
55
description: |-
6-
Get all yours virtual machine instances.
6+
Get the available virtual-machine instances.
77
---
88

99
# mgc_virtual_machine_instances (Data Source)
1010

11-
Get all yours virtual machine instances.
11+
Get the available virtual-machine instances.
1212

13-
```hcl
14-
data "mgc_virtual_machine_instances" "instances" {
13+
## Example Usage
1514

15+
```terraform
16+
data "mgc_virtual_machine_instances" "instances" {
1617
}
1718
1819
output "vm_instances" {
@@ -21,20 +22,18 @@ output "vm_instances" {
2122
```
2223

2324
<!-- schema generated by tfplugindocs -->
24-
2525
## Schema
2626

2727
### Read-Only
2828

2929
- `instances` (Attributes List) List of available VM instances. (see [below for nested schema](#nestedatt--instances))
3030

3131
<a id="nestedatt--instances"></a>
32-
3332
### Nested Schema for `instances`
3433

3534
Read-Only:
3635

37-
- `id` (Boolean) ID of machine-type.
36+
- `id` (String) ID of machine-type.
3837
- `image_id` (String) Image ID of instance
3938
- `machine_type_id` (String) Machine type ID of instance
4039
- `name` (String) Name of type.

docs/data-sources/virtual_machine_types.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ description: |-
1010

1111
Get the available virtual-machine types.
1212

13-
```hcl
14-
data "mgc_virtual_machine_types" "types" {
13+
## Example Usage
1514

15+
```terraform
16+
data "mgc_virtual_machine_types" "types" {
1617
}
1718
1819
output "vm_types" {
@@ -34,7 +35,7 @@ Read-Only:
3435

3536
- `disk` (Number) Disk
3637
- `gpu` (Number) GPU
37-
- `id` (Boolean) ID of machine-type.
38+
- `id` (String) ID of machine-type.
3839
- `name` (String) Name of type.
3940
- `ram` (Number) Ram
4041
- `vcpu` (Number) VCpu

0 commit comments

Comments
 (0)