1. Packages
  2. Xen Orchestra
  3. API Docs
  4. CloudConfig
xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates

xenorchestra.CloudConfig

Explore with Pulumi AI

Creates a Xen Orchestra cloud config resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as xenorchestra from "@vates/pulumi-xenorchestra";

const demo = new xenorchestra.CloudConfig("demo", {
    name: "cloud config name",
    template: `#cloud-config

runcmd:
 - [ ls, -l, / ]
 - [ sh, -xc, "echo (date) ': hello world!'" ]
 - [ sh, -c, echo "=========hello world'=========" ]
 - ls -l /root
`,
});
const bar = new xenorchestra.Vm("bar", {cloudConfig: demo.template});
Copy
import pulumi
import pulumi_xenorchestra as xenorchestra

demo = xenorchestra.CloudConfig("demo",
    name="cloud config name",
    template="""#cloud-config

runcmd:
 - [ ls, -l, / ]
 - [ sh, -xc, "echo $(date) ': hello world!'" ]
 - [ sh, -c, echo "=========hello world'=========" ]
 - ls -l /root
""")
bar = xenorchestra.Vm("bar", cloud_config=demo.template)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/vatesfr/pulumi-xenorchestra/sdk/go/xenorchestra"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		demo, err := xenorchestra.NewCloudConfig(ctx, "demo", &xenorchestra.CloudConfigArgs{
			Name: pulumi.String("cloud config name"),
			Template: pulumi.String(`#cloud-config

runcmd:
 - [ ls, -l, / ]
 - [ sh, -xc, "echo $(date) ': hello world!'" ]
 - [ sh, -c, echo "=========hello world'=========" ]
 - ls -l /root
`),
		})
		if err != nil {
			return err
		}
		_, err = xenorchestra.NewVm(ctx, "bar", &xenorchestra.VmArgs{
			CloudConfig: demo.Template,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Xenorchestra = Pulumi.Xenorchestra;

return await Deployment.RunAsync(() => 
{
    var demo = new Xenorchestra.CloudConfig("demo", new()
    {
        Name = "cloud config name",
        Template = @"#cloud-config

runcmd:
 - [ ls, -l, / ]
 - [ sh, -xc, ""echo $(date) ': hello world!'"" ]
 - [ sh, -c, echo ""=========hello world'========="" ]
 - ls -l /root
",
    });

    var bar = new Xenorchestra.Vm("bar", new()
    {
        CloudConfig = demo.Template,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.xenorchestra.CloudConfig;
import com.pulumi.xenorchestra.CloudConfigArgs;
import com.pulumi.xenorchestra.Vm;
import com.pulumi.xenorchestra.VmArgs;
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 demo = new CloudConfig("demo", CloudConfigArgs.builder()
            .name("cloud config name")
            .template("""
#cloud-config

runcmd:
 - [ ls, -l, / ]
 - [ sh, -xc, "echo $(date) ': hello world!'" ]
 - [ sh, -c, echo "=========hello world'=========" ]
 - ls -l /root
            """)
            .build());

        var bar = new Vm("bar", VmArgs.builder()
            .cloudConfig(demo.template())
            .build());

    }
}
Copy
resources:
  demo:
    type: xenorchestra:CloudConfig
    properties:
      name: cloud config name
      template: |
        #cloud-config

        runcmd:
         - [ ls, -l, / ]
         - [ sh, -xc, "echo $(date) ': hello world!'" ]
         - [ sh, -c, echo "=========hello world'=========" ]
         - ls -l /root        
  bar:
    type: xenorchestra:Vm
    properties:
      cloudConfig: ${demo.template}
Copy

Create CloudConfig Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new CloudConfig(name: string, args: CloudConfigArgs, opts?: CustomResourceOptions);
@overload
def CloudConfig(resource_name: str,
                args: CloudConfigArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def CloudConfig(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                template: Optional[str] = None,
                name: Optional[str] = None)
func NewCloudConfig(ctx *Context, name string, args CloudConfigArgs, opts ...ResourceOption) (*CloudConfig, error)
public CloudConfig(string name, CloudConfigArgs args, CustomResourceOptions? opts = null)
public CloudConfig(String name, CloudConfigArgs args)
public CloudConfig(String name, CloudConfigArgs args, CustomResourceOptions options)
type: xenorchestra:CloudConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CloudConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CloudConfigArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CloudConfigArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CloudConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CloudConfigArgs
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 cloudConfigResource = new Xenorchestra.CloudConfig("cloudConfigResource", new()
{
    Template = "string",
    Name = "string",
});
Copy
example, err := xenorchestra.NewCloudConfig(ctx, "cloudConfigResource", &xenorchestra.CloudConfigArgs{
	Template: pulumi.String("string"),
	Name:     pulumi.String("string"),
})
Copy
var cloudConfigResource = new CloudConfig("cloudConfigResource", CloudConfigArgs.builder()
    .template("string")
    .name("string")
    .build());
Copy
cloud_config_resource = xenorchestra.CloudConfig("cloudConfigResource",
    template="string",
    name="string")
Copy
const cloudConfigResource = new xenorchestra.CloudConfig("cloudConfigResource", {
    template: "string",
    name: "string",
});
Copy
type: xenorchestra:CloudConfig
properties:
    name: string
    template: string
Copy

CloudConfig 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 CloudConfig resource accepts the following input properties:

Template
This property is required.
Changes to this property will trigger replacement.
string
The cloud init config. See the cloud init docs for more information.
Name Changes to this property will trigger replacement. string
The name of the cloud config.
Template
This property is required.
Changes to this property will trigger replacement.
string
The cloud init config. See the cloud init docs for more information.
Name Changes to this property will trigger replacement. string
The name of the cloud config.
template
This property is required.
Changes to this property will trigger replacement.
String
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. String
The name of the cloud config.
template
This property is required.
Changes to this property will trigger replacement.
string
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. string
The name of the cloud config.
template
This property is required.
Changes to this property will trigger replacement.
str
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. str
The name of the cloud config.
template
This property is required.
Changes to this property will trigger replacement.
String
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. String
The name of the cloud config.

Outputs

All input properties are implicitly available as output properties. Additionally, the CloudConfig resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing CloudConfig Resource

Get an existing CloudConfig 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?: CloudConfigState, opts?: CustomResourceOptions): CloudConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        template: Optional[str] = None) -> CloudConfig
func GetCloudConfig(ctx *Context, name string, id IDInput, state *CloudConfigState, opts ...ResourceOption) (*CloudConfig, error)
public static CloudConfig Get(string name, Input<string> id, CloudConfigState? state, CustomResourceOptions? opts = null)
public static CloudConfig get(String name, Output<String> id, CloudConfigState state, CustomResourceOptions options)
resources:  _:    type: xenorchestra:CloudConfig    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Name Changes to this property will trigger replacement. string
The name of the cloud config.
Template Changes to this property will trigger replacement. string
The cloud init config. See the cloud init docs for more information.
Name Changes to this property will trigger replacement. string
The name of the cloud config.
Template Changes to this property will trigger replacement. string
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. String
The name of the cloud config.
template Changes to this property will trigger replacement. String
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. string
The name of the cloud config.
template Changes to this property will trigger replacement. string
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. str
The name of the cloud config.
template Changes to this property will trigger replacement. str
The cloud init config. See the cloud init docs for more information.
name Changes to this property will trigger replacement. String
The name of the cloud config.
template Changes to this property will trigger replacement. String
The cloud init config. See the cloud init docs for more information.

Package Details

Repository
xenorchestra vatesfr/pulumi-xenorchestra
License
Apache-2.0
Notes
This Pulumi package is based on the xenorchestra Terraform Provider.