juju.KubernetesCloud
Explore with Pulumi AI
A resource that represent a Juju Cloud for existing controller.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as juju from "@pulumi/juju";
const my_k8s_cloud = new juju.KubernetesCloud("my-k8s-cloud", {kubernetesConfig: fs.readFileSync("<path-to-my-kubennetes-cloud-config>.yaml", "utf8")});
const my_model = new juju.Model("my-model", {
credential: my_k8s_cloud.credential,
clouds: [{
name: my_k8s_cloud.name,
}],
});
import pulumi
import pulumi_juju as juju
my_k8s_cloud = juju.KubernetesCloud("my-k8s-cloud", kubernetes_config=(lambda path: open(path).read())("<path-to-my-kubennetes-cloud-config>.yaml"))
my_model = juju.Model("my-model",
credential=my_k8s_cloud.credential,
clouds=[{
"name": my_k8s_cloud.name,
}])
package main
import (
"os"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/juju/juju"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
my_k8s_cloud, err := juju.NewKubernetesCloud(ctx, "my-k8s-cloud", &juju.KubernetesCloudArgs{
KubernetesConfig: pulumi.String(readFileOrPanic("<path-to-my-kubennetes-cloud-config>.yaml")),
})
if err != nil {
return err
}
_, err = juju.NewModel(ctx, "my-model", &juju.ModelArgs{
Credential: my_k8s_cloud.Credential,
Clouds: juju.ModelCloudArray{
&juju.ModelCloudArgs{
Name: my_k8s_cloud.Name,
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Juju = Pulumi.Juju;
return await Deployment.RunAsync(() =>
{
var my_k8s_cloud = new Juju.KubernetesCloud("my-k8s-cloud", new()
{
KubernetesConfig = File.ReadAllText("<path-to-my-kubennetes-cloud-config>.yaml"),
});
var my_model = new Juju.Model("my-model", new()
{
Credential = my_k8s_cloud.Credential,
Clouds = new[]
{
new Juju.Inputs.ModelCloudArgs
{
Name = my_k8s_cloud.Name,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.juju.KubernetesCloud;
import com.pulumi.juju.KubernetesCloudArgs;
import com.pulumi.juju.Model;
import com.pulumi.juju.ModelArgs;
import com.pulumi.juju.inputs.ModelCloudArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var my_k8s_cloud = new KubernetesCloud("my-k8s-cloud", KubernetesCloudArgs.builder()
.kubernetesConfig(Files.readString(Paths.get("<path-to-my-kubennetes-cloud-config>.yaml")))
.build());
var my_model = new Model("my-model", ModelArgs.builder()
.credential(my_k8s_cloud.credential())
.clouds(ModelCloudArgs.builder()
.name(my_k8s_cloud.name())
.build())
.build());
}
}
resources:
my-k8s-cloud:
type: juju:KubernetesCloud
properties:
kubernetesConfig:
fn::readFile: <path-to-my-kubennetes-cloud-config>.yaml
my-model:
type: juju:Model
properties:
credential: ${["my-k8s-cloud"].credential}
clouds:
- name: ${["my-k8s-cloud"].name}
Create KubernetesCloud Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KubernetesCloud(name: string, args?: KubernetesCloudArgs, opts?: CustomResourceOptions);
@overload
def KubernetesCloud(resource_name: str,
args: Optional[KubernetesCloudArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def KubernetesCloud(resource_name: str,
opts: Optional[ResourceOptions] = None,
kubernetes_config: Optional[str] = None,
name: Optional[str] = None,
parent_cloud_name: Optional[str] = None,
parent_cloud_region: Optional[str] = None)
func NewKubernetesCloud(ctx *Context, name string, args *KubernetesCloudArgs, opts ...ResourceOption) (*KubernetesCloud, error)
public KubernetesCloud(string name, KubernetesCloudArgs? args = null, CustomResourceOptions? opts = null)
public KubernetesCloud(String name, KubernetesCloudArgs args)
public KubernetesCloud(String name, KubernetesCloudArgs args, CustomResourceOptions options)
type: juju:KubernetesCloud
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KubernetesCloudArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KubernetesCloudArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KubernetesCloudArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KubernetesCloudArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KubernetesCloudArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var kubernetesCloudResource = new Juju.KubernetesCloud("kubernetesCloudResource", new()
{
KubernetesConfig = "string",
Name = "string",
ParentCloudName = "string",
ParentCloudRegion = "string",
});
example, err := juju.NewKubernetesCloud(ctx, "kubernetesCloudResource", &juju.KubernetesCloudArgs{
KubernetesConfig: pulumi.String("string"),
Name: pulumi.String("string"),
ParentCloudName: pulumi.String("string"),
ParentCloudRegion: pulumi.String("string"),
})
var kubernetesCloudResource = new KubernetesCloud("kubernetesCloudResource", KubernetesCloudArgs.builder()
.kubernetesConfig("string")
.name("string")
.parentCloudName("string")
.parentCloudRegion("string")
.build());
kubernetes_cloud_resource = juju.KubernetesCloud("kubernetesCloudResource",
kubernetes_config="string",
name="string",
parent_cloud_name="string",
parent_cloud_region="string")
const kubernetesCloudResource = new juju.KubernetesCloud("kubernetesCloudResource", {
kubernetesConfig: "string",
name: "string",
parentCloudName: "string",
parentCloudRegion: "string",
});
type: juju:KubernetesCloud
properties:
kubernetesConfig: string
name: string
parentCloudName: string
parentCloudRegion: string
KubernetesCloud Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The KubernetesCloud resource accepts the following input properties:
- Kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- Name string
- Parent
Cloud stringName - Parent
Cloud stringRegion
- Kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- Name string
- Parent
Cloud stringName - Parent
Cloud stringRegion
- kubernetes
Config String - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name String
- parent
Cloud StringName - parent
Cloud StringRegion
- kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name string
- parent
Cloud stringName - parent
Cloud stringRegion
- kubernetes_
config str - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name str
- parent_
cloud_ strname - parent_
cloud_ strregion
- kubernetes
Config String - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name String
- parent
Cloud StringName - parent
Cloud StringRegion
Outputs
All input properties are implicitly available as output properties. Additionally, the KubernetesCloud resource produces the following output properties:
- Credential string
- The name of the credential created for this cloud.
- Id string
- The provider-assigned unique ID for this managed resource.
- Credential string
- The name of the credential created for this cloud.
- Id string
- The provider-assigned unique ID for this managed resource.
- credential String
- The name of the credential created for this cloud.
- id String
- The provider-assigned unique ID for this managed resource.
- credential string
- The name of the credential created for this cloud.
- id string
- The provider-assigned unique ID for this managed resource.
- credential str
- The name of the credential created for this cloud.
- id str
- The provider-assigned unique ID for this managed resource.
- credential String
- The name of the credential created for this cloud.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing KubernetesCloud Resource
Get an existing KubernetesCloud resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KubernetesCloudState, opts?: CustomResourceOptions): KubernetesCloud
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
credential: Optional[str] = None,
kubernetes_config: Optional[str] = None,
name: Optional[str] = None,
parent_cloud_name: Optional[str] = None,
parent_cloud_region: Optional[str] = None) -> KubernetesCloud
func GetKubernetesCloud(ctx *Context, name string, id IDInput, state *KubernetesCloudState, opts ...ResourceOption) (*KubernetesCloud, error)
public static KubernetesCloud Get(string name, Input<string> id, KubernetesCloudState? state, CustomResourceOptions? opts = null)
public static KubernetesCloud get(String name, Output<String> id, KubernetesCloudState state, CustomResourceOptions options)
resources: _: type: juju:KubernetesCloud get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Credential string
- The name of the credential created for this cloud.
- Kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- Name string
- Parent
Cloud stringName - Parent
Cloud stringRegion
- Credential string
- The name of the credential created for this cloud.
- Kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- Name string
- Parent
Cloud stringName - Parent
Cloud stringRegion
- credential String
- The name of the credential created for this cloud.
- kubernetes
Config String - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name String
- parent
Cloud StringName - parent
Cloud StringRegion
- credential string
- The name of the credential created for this cloud.
- kubernetes
Config string - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name string
- parent
Cloud stringName - parent
Cloud stringRegion
- credential str
- The name of the credential created for this cloud.
- kubernetes_
config str - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name str
- parent_
cloud_ strname - parent_
cloud_ strregion
- credential String
- The name of the credential created for this cloud.
- kubernetes
Config String - The kubernetes config file path for the cloud. Cloud credentials will be added to the Juju controller for you.
- name String
- parent
Cloud StringName - parent
Cloud StringRegion
Package Details
- Repository
- juju juju/terraform-provider-juju
- License
- Notes
- This Pulumi package is based on the
juju
Terraform Provider.