The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

Template

Provides a Civo Template resource. This can be used to create, modify, and delete Templates.

Create a Template Resource

def Template(resource_name: str, opts: Optional[ResourceOptions] = None, cloud_config: Optional[str] = None, code: Optional[str] = None, default_username: Optional[str] = None, description: Optional[str] = None, image_id: Optional[str] = None, name: Optional[str] = None, short_description: Optional[str] = None, volume_id: Optional[str] = None)
func NewTemplate(ctx *Context, name string, args TemplateArgs, opts ...ResourceOption) (*Template, error)
public Template(string name, TemplateArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TemplateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Template Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Template resource accepts the following input properties:

Code string

This is a unqiue, alphanumerical, short, human readable code for the template.

CloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

DefaultUsername string

The default username to suggest that the user creates

Description string

A multi-line description of the template, in Markdown format

ImageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

Name string

This is a short human readable name for the template

ShortDescription string

A one line description of the template

VolumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

Code string

This is a unqiue, alphanumerical, short, human readable code for the template.

CloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

DefaultUsername string

The default username to suggest that the user creates

Description string

A multi-line description of the template, in Markdown format

ImageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

Name string

This is a short human readable name for the template

ShortDescription string

A one line description of the template

VolumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

code string

This is a unqiue, alphanumerical, short, human readable code for the template.

cloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

defaultUsername string

The default username to suggest that the user creates

description string

A multi-line description of the template, in Markdown format

imageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

name string

This is a short human readable name for the template

shortDescription string

A one line description of the template

volumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

code str

This is a unqiue, alphanumerical, short, human readable code for the template.

cloud_config str

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

default_username str

The default username to suggest that the user creates

description str

A multi-line description of the template, in Markdown format

image_id str

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

name str

This is a short human readable name for the template

short_description str

A one line description of the template

volume_id str

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

Outputs

All input properties are implicitly available as output properties. Additionally, the Template 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Template Resource

Get an existing Template 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?: TemplateState, opts?: CustomResourceOptions): Template
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, cloud_config: Optional[str] = None, code: Optional[str] = None, default_username: Optional[str] = None, description: Optional[str] = None, image_id: Optional[str] = None, name: Optional[str] = None, short_description: Optional[str] = None, volume_id: Optional[str] = None) -> Template
func GetTemplate(ctx *Context, name string, id IDInput, state *TemplateState, opts ...ResourceOption) (*Template, error)
public static Template Get(string name, Input<string> id, TemplateState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

CloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

Code string

This is a unqiue, alphanumerical, short, human readable code for the template.

DefaultUsername string

The default username to suggest that the user creates

Description string

A multi-line description of the template, in Markdown format

ImageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

Name string

This is a short human readable name for the template

ShortDescription string

A one line description of the template

VolumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

CloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

Code string

This is a unqiue, alphanumerical, short, human readable code for the template.

DefaultUsername string

The default username to suggest that the user creates

Description string

A multi-line description of the template, in Markdown format

ImageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

Name string

This is a short human readable name for the template

ShortDescription string

A one line description of the template

VolumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

cloudConfig string

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

code string

This is a unqiue, alphanumerical, short, human readable code for the template.

defaultUsername string

The default username to suggest that the user creates

description string

A multi-line description of the template, in Markdown format

imageId string

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

name string

This is a short human readable name for the template

shortDescription string

A one line description of the template

volumeId string

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

cloud_config str

Commonly referred to as ‘user-data’, this is a customisation script that is run after the instance is first booted. We recommend using cloud-config as it’s a great distribution-agnostic way of configuring cloud servers. If you put $INITIAL_USER in your script, this will automatically be replaced by the initial user chosen when creating the instance, $INITIAL_PASSWORD will be replaced with the random password generated by the system, $HOSTNAME is the fully qualified domain name of the instance and $SSH_KEY will be the content of the SSH public key. (this is technically optional, but you won’t really be able to use instances without it - see our learn guide on templates for more information).

code str

This is a unqiue, alphanumerical, short, human readable code for the template.

default_username str

The default username to suggest that the user creates

description str

A multi-line description of the template, in Markdown format

image_id str

This is the Image ID of any default template or the ID of another template either owned by you or global (optional; but must be specified if no volume_id is specified).

name str

This is a short human readable name for the template

short_description str

A one line description of the template

volume_id str

This is the ID of a bootable volume, either owned by you or global (optional; but must be specified if no image_id is specified)

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.