Show / Hide Table of Contents

Class StackScript

Provides a Linode StackScript resource. This can be used to create, modify, and delete Linode StackScripts. StackScripts are private or public managed scripts which run within an instance during startup. StackScripts can include variables whose values are specified when the Instance is created.

For more information, see Automate Deployment with StackScripts and the Linode APIv4 docs.

Example Usage

using Pulumi;
using Linode = Pulumi.Linode;

class MyStack : Stack
{
public MyStack()
{
    var fooStackScript = new Linode.StackScript("fooStackScript", new Linode.StackScriptArgs
    {
        Description = "Installs a Package",
        Images = 
        {
            "linode/ubuntu18.04",
            "linode/ubuntu16.04lts",
        },
        Label = "foo",
        RevNote = "initial version",
        Script = @"#!/bin/bash
# <UDF name=""package"" label=""System Package to Install"" example=""nginx"" default="""">
apt-get -q update && apt-get -q -y install $$PACKAGE

",
    });
    var fooInstance = new Linode.Instance("fooInstance", new Linode.InstanceArgs
    {
        AuthorizedKeys = 
        {
            "...",
        },
        Image = "linode/ubuntu18.04",
        Label = "foo",
        Region = "us-east",
        RootPass = "...",
        StackscriptData = 
        {
            { "package", "nginx" },
        },
        StackscriptId = linode_stackscript.Install_nginx.Id,
        Type = "g6-nanode-1",
    });
}

}

Attributes

This resource exports the following attributes:

  • deployments_active - Count of currently active, deployed Linodes created from this StackScript.

  • user_gravatar_id - The Gravatar ID for the User who created the StackScript.

  • deployments_total - The total number of times this StackScript has been deployed.

  • username - The User who created the StackScript.

  • created - The date this StackScript was created.

  • updated - The date this StackScript was updated.

  • user_defined_fields - This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.

  • label - A human-readable label for the field that will serve as the input prompt for entering the value during deployment.

  • name - The name of the field.

  • example - An example value for the field.

  • one_of - A list of acceptable single values for the field.

  • many_of - A list of acceptable values for the field in any quantity, combination or order.

  • default - The default value. If not specified, this value will be used.

Inheritance
System.Object
Resource
CustomResource
StackScript
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Linode
Assembly: Pulumi.Linode.dll
Syntax
public class StackScript : CustomResource

Constructors

View Source

StackScript(String, StackScriptArgs, CustomResourceOptions)

Create a StackScript resource with the given unique name, arguments, and options.

Declaration
public StackScript(string name, StackScriptArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

StackScriptArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Created

The date this StackScript was created.

Declaration
public Output<string> Created { get; }
Property Value
Type Description
Output<System.String>
View Source

DeploymentsActive

Count of currently active, deployed Linodes created from this StackScript.

Declaration
public Output<int> DeploymentsActive { get; }
Property Value
Type Description
Output<System.Int32>
View Source

DeploymentsTotal

The total number of times this StackScript has been deployed.

Declaration
public Output<int> DeploymentsTotal { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Description

A description for the StackScript.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Images

An array of Image IDs representing the Images that this StackScript is compatible for deploying with.

Declaration
public Output<ImmutableArray<string>> Images { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

IsPublic

This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing is_public forces the creation of a new StackScript

Declaration
public Output<bool?> IsPublic { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Label

The StackScript's label is for display purposes only.

Declaration
public Output<string> Label { get; }
Property Value
Type Description
Output<System.String>
View Source

RevNote

This field allows you to add notes for the set of revisions made to this StackScript.

Declaration
public Output<string> RevNote { get; }
Property Value
Type Description
Output<System.String>
View Source

Script

The script to execute when provisioning a new Linode with this StackScript.

Declaration
public Output<string> Script { get; }
Property Value
Type Description
Output<System.String>
View Source

Updated

The date this StackScript was updated.

Declaration
public Output<string> Updated { get; }
Property Value
Type Description
Output<System.String>
View Source

UserDefinedFields

This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.

Declaration
public Output<ImmutableArray<StackScriptUserDefinedField>> UserDefinedFields { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<StackScriptUserDefinedField>>
View Source

UserGravatarId

The Gravatar ID for the User who created the StackScript.

Declaration
public Output<string> UserGravatarId { get; }
Property Value
Type Description
Output<System.String>
View Source

Username

The User who created the StackScript.

Declaration
public Output<string> Username { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, StackScriptState, CustomResourceOptions)

Get an existing StackScript resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static StackScript Get(string name, Input<string> id, StackScriptState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

StackScriptState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
StackScript
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.