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.
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.
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",
});
}
}
Coming soon!
import pulumi
import pulumi_linode as linode
foo_stack_script = linode.StackScript("fooStackScript",
description="Installs a Package",
images=[
"linode/ubuntu18.04",
"linode/ubuntu16.04lts",
],
label="foo",
rev_note="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
""")
foo_instance = linode.Instance("fooInstance",
authorized_keys=["..."],
image="linode/ubuntu18.04",
label="foo",
region="us-east",
root_pass="...",
stackscript_data={
"package": "nginx",
},
stackscript_id=linode_stackscript["install-nginx"]["id"],
type="g6-nanode-1")import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const fooStackScript = new linode.StackScript("foo", {
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
`,
});
const fooInstance = new linode.Instance("foo", {
authorizedKeys: ["..."],
image: "linode/ubuntu18.04",
label: "foo",
region: "us-east",
rootPass: "...",
stackscriptData: {
package: "nginx",
},
stackscriptId: linode_stackscript_install_nginx.id,
type: "g6-nanode-1",
});Create a StackScript Resource
new StackScript(name: string, args: StackScriptArgs, opts?: CustomResourceOptions);def StackScript(resource_name, opts=None, description=None, images=None, is_public=None, label=None, rev_note=None, script=None, user_defined_fields=None, __props__=None);func NewStackScript(ctx *Context, name string, args StackScriptArgs, opts ...ResourceOption) (*StackScript, error)public StackScript(string name, StackScriptArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args StackScriptArgs
- 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 StackScriptArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StackScriptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
StackScript Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The StackScript resource accepts the following input properties:
- Description string
A description for the StackScript.
- Images List<string>
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- Label string
The StackScript’s label is for display purposes only.
- Script string
The script to execute when provisioning a new Linode with this StackScript.
- Is
Public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- Rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- User
Defined List<StackFields Script User Defined Field Args> This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- Description string
A description for the StackScript.
- Images []string
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- Label string
The StackScript’s label is for display purposes only.
- Script string
The script to execute when provisioning a new Linode with this StackScript.
- Is
Public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- Rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- User
Defined []StackFields Script User Defined Field This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- description string
A description for the StackScript.
- images string[]
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- label string
The StackScript’s label is for display purposes only.
- script string
The script to execute when provisioning a new Linode with this StackScript.
- is
Public boolean This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- user
Defined StackFields Script User Defined Field[] This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- description str
A description for the StackScript.
- images List[str]
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- label str
The StackScript’s label is for display purposes only.
- script str
The script to execute when provisioning a new Linode with this StackScript.
- is_
public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- rev_
note str This field allows you to add notes for the set of revisions made to this StackScript.
- user_
defined_ List[Stackfields Script User Defined Field] This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
Outputs
All input properties are implicitly available as output properties. Additionally, the StackScript resource produces the following output properties:
- Created string
The date this StackScript was created.
- Deployments
Active int Count of currently active, deployed Linodes created from this StackScript.
- Deployments
Total int The total number of times this StackScript has been deployed.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated string
The date this StackScript was updated.
- User
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- Username string
The User who created the StackScript.
- Created string
The date this StackScript was created.
- Deployments
Active int Count of currently active, deployed Linodes created from this StackScript.
- Deployments
Total int The total number of times this StackScript has been deployed.
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated string
The date this StackScript was updated.
- User
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- Username string
The User who created the StackScript.
- created string
The date this StackScript was created.
- deployments
Active number Count of currently active, deployed Linodes created from this StackScript.
- deployments
Total number The total number of times this StackScript has been deployed.
- id string
- The provider-assigned unique ID for this managed resource.
- updated string
The date this StackScript was updated.
- user
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- username string
The User who created the StackScript.
- created str
The date this StackScript was created.
- deployments_
active float Count of currently active, deployed Linodes created from this StackScript.
- deployments_
total float The total number of times this StackScript has been deployed.
- id str
- The provider-assigned unique ID for this managed resource.
- updated str
The date this StackScript was updated.
- user_
gravatar_ strid The Gravatar ID for the User who created the StackScript.
- username str
The User who created the StackScript.
Look up an Existing StackScript Resource
Get an existing StackScript 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?: StackScriptState, opts?: CustomResourceOptions): StackScriptstatic get(resource_name, id, opts=None, created=None, deployments_active=None, deployments_total=None, description=None, images=None, is_public=None, label=None, rev_note=None, script=None, updated=None, user_defined_fields=None, user_gravatar_id=None, username=None, __props__=None);func GetStackScript(ctx *Context, name string, id IDInput, state *StackScriptState, opts ...ResourceOption) (*StackScript, error)public static StackScript Get(string name, Input<string> id, StackScriptState? 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:
- Created string
The date this StackScript was created.
- Deployments
Active int Count of currently active, deployed Linodes created from this StackScript.
- Deployments
Total int The total number of times this StackScript has been deployed.
- Description string
A description for the StackScript.
- Images List<string>
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- Is
Public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- Label string
The StackScript’s label is for display purposes only.
- Rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- Script string
The script to execute when provisioning a new Linode with this StackScript.
- Updated string
The date this StackScript was updated.
- User
Defined List<StackFields Script User Defined Field Args> This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- User
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- Username string
The User who created the StackScript.
- Created string
The date this StackScript was created.
- Deployments
Active int Count of currently active, deployed Linodes created from this StackScript.
- Deployments
Total int The total number of times this StackScript has been deployed.
- Description string
A description for the StackScript.
- Images []string
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- Is
Public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- Label string
The StackScript’s label is for display purposes only.
- Rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- Script string
The script to execute when provisioning a new Linode with this StackScript.
- Updated string
The date this StackScript was updated.
- User
Defined []StackFields Script User Defined Field This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- User
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- Username string
The User who created the StackScript.
- created string
The date this StackScript was created.
- deployments
Active number Count of currently active, deployed Linodes created from this StackScript.
- deployments
Total number The total number of times this StackScript has been deployed.
- description string
A description for the StackScript.
- images string[]
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- is
Public boolean This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- label string
The StackScript’s label is for display purposes only.
- rev
Note string This field allows you to add notes for the set of revisions made to this StackScript.
- script string
The script to execute when provisioning a new Linode with this StackScript.
- updated string
The date this StackScript was updated.
- user
Defined StackFields Script User Defined Field[] This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- user
Gravatar stringId The Gravatar ID for the User who created the StackScript.
- username string
The User who created the StackScript.
- created str
The date this StackScript was created.
- deployments_
active float Count of currently active, deployed Linodes created from this StackScript.
- deployments_
total float The total number of times this StackScript has been deployed.
- description str
A description for the StackScript.
- images List[str]
An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
- is_
public bool This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing
is_publicforces the creation of a new StackScript- label str
The StackScript’s label is for display purposes only.
- rev_
note str This field allows you to add notes for the set of revisions made to this StackScript.
- script str
The script to execute when provisioning a new Linode with this StackScript.
- updated str
The date this StackScript was updated.
- user_
defined_ List[Stackfields Script User Defined Field] This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
- user_
gravatar_ strid The Gravatar ID for the User who created the StackScript.
- username str
The User who created the StackScript.
Supporting Types
StackScriptUserDefinedField
Package Details
- Repository
- https://github.com/pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linodeTerraform Provider.