-
Notifications
You must be signed in to change notification settings - Fork 43
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 #598 from anvial/JUJU-6811-implement-kubernetes-cl…
…oud-resource-create-function #598 ## Description - Added CRUD methods in `kubernetesCloudsClient` to handle the creation of Kubernetes clouds. - Integrated the new method into the Terraform provider's CRUD functions in `kubernetesCloudResource`. - Updated the schema and model to include necessary attributes for Kubernetes cloud create/read/update/delete. ## Type of change - Change existing resource ## Environment - Juju controller version: - Terraform version: ## QA steps ```bash # get k8s cloud config yaml microk8s.config view > test-k8s-config.yaml ``` ```tf terraform { required_providers { juju = { version = "0.15.0" source = "juju/juju" } } } resource "juju_kubernetes_cloud" "test-k8s-cloud" { name = "test-k8s-cloud" kubernetesconfig = file("<path-to-test-k8s-config.yaml>") } ``` ``` juju clouds --controller <controller_name> # output should demonstrate freshly added cloud to the controller ```
- Loading branch information
Showing
15 changed files
with
880 additions
and
90 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
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,46 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "juju_kubernetes_cloud Resource - terraform-provider-juju" | ||
subcategory: "" | ||
description: |- | ||
A resource that represent a Juju Cloud for existing controller. | ||
--- | ||
|
||
# juju_kubernetes_cloud (Resource) | ||
|
||
A resource that represent a Juju Cloud for existing controller. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "juju_kubernetes_cloud" "my-k8s-cloud" { | ||
name = "my-k8s-cloud" | ||
kubernetes_config = file("<path-to-my-kubennetes-cloud-config>.yaml") | ||
} | ||
resource "juju_model" "my-model" { | ||
name = "my-model" | ||
credential = juju_kubernetes_cloud.my-k8s-cloud.credential | ||
cloud { | ||
name = juju_kubernetes_cloud.my-k8s-cloud.name | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. | ||
|
||
### Optional | ||
|
||
- `kubernetes_config` (String, Sensitive) The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you. | ||
- `parent_cloud_name` (String) The parent cloud name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. | ||
- `parent_cloud_region` (String) The parent cloud region name in case adding k8s cluster from existed cloud. Changing this value will cause the cloud to be destroyed and recreated by terraform. | ||
|
||
### Read-Only | ||
|
||
- `credential` (String) The name of the credential created for this cloud. | ||
- `id` (String) The ID of this resource. |
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,12 @@ | ||
resource "juju_kubernetes_cloud" "my-k8s-cloud" { | ||
name = "my-k8s-cloud" | ||
kubernetes_config = file("<path-to-my-kubennetes-cloud-config>.yaml") | ||
} | ||
|
||
resource "juju_model" "my-model" { | ||
name = "my-model" | ||
credential = juju_kubernetes_cloud.my-k8s-cloud.credential | ||
cloud { | ||
name = juju_kubernetes_cloud.my-k8s-cloud.name | ||
} | ||
} |
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
Oops, something went wrong.