Linode
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
{
Label = "foo",
Description = "Installs a Package",
Script = @"#!/bin/bash
# <UDF name=""package"" label=""System Package to Install"" example=""nginx"" default="""">
apt-get -q update && apt-get -q -y install $PACKAGE
",
Images =
{
"linode/ubuntu18.04",
"linode/ubuntu16.04lts",
},
RevNote = "initial version",
});
var fooInstance = new Linode.Instance("fooInstance", new Linode.InstanceArgs
{
Image = "linode/ubuntu18.04",
Label = "foo",
Region = "us-east",
Type = "g6-nanode-1",
AuthorizedKeys =
{
"...",
},
RootPass = "...",
StackscriptId = fooStackScript.Id,
StackscriptData =
{
{ "package", "nginx" },
},
});
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-linode/sdk/v3/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooStackScript, err := linode.NewStackScript(ctx, "fooStackScript", &linode.StackScriptArgs{
Label: pulumi.String("foo"),
Description: pulumi.String("Installs a Package"),
Script: pulumi.String(fmt.Sprintf("%v%v%v%v%v", "#!/bin/bash\n", "# <UDF name=\"package\" label=\"System Package to Install\" example=\"nginx\" default=\"\">\n", "apt-get -q update && apt-get -q -y install ", "$", "PACKAGE\n")),
Images: pulumi.StringArray{
pulumi.String("linode/ubuntu18.04"),
pulumi.String("linode/ubuntu16.04lts"),
},
RevNote: pulumi.String("initial version"),
})
if err != nil {
return err
}
_, err = linode.NewInstance(ctx, "fooInstance", &linode.InstanceArgs{
Image: pulumi.String("linode/ubuntu18.04"),
Label: pulumi.String("foo"),
Region: pulumi.String("us-east"),
Type: pulumi.String("g6-nanode-1"),
AuthorizedKeys: pulumi.StringArray{
pulumi.String("..."),
},
RootPass: pulumi.String("..."),
StackscriptId: fooStackScript.ID(),
StackscriptData: pulumi.AnyMap{
"package": pulumi.Any("nginx"),
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_linode as linode
foo_stack_script = linode.StackScript("fooStackScript",
label="foo",
description="Installs a Package",
script="""#!/bin/bash
# <UDF name="package" label="System Package to Install" example="nginx" default="">
apt-get -q update && apt-get -q -y install $PACKAGE
""",
images=[
"linode/ubuntu18.04",
"linode/ubuntu16.04lts",
],
rev_note="initial version")
foo_instance = linode.Instance("fooInstance",
image="linode/ubuntu18.04",
label="foo",
region="us-east",
type="g6-nanode-1",
authorized_keys=["..."],
root_pass="...",
stackscript_id=foo_stack_script.id,
stackscript_data={
"package": "nginx",
})
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const fooStackScript = new linode.StackScript("fooStackScript", {
label: "foo",
description: "Installs a Package",
script: `#!/bin/bash
# <UDF name="package" label="System Package to Install" example="nginx" default="">
apt-get -q update && apt-get -q -y install $PACKAGE
`,
images: [
"linode/ubuntu18.04",
"linode/ubuntu16.04lts",
],
revNote: "initial version",
});
const fooInstance = new linode.Instance("fooInstance", {
image: "linode/ubuntu18.04",
label: "foo",
region: "us-east",
type: "g6-nanode-1",
authorizedKeys: ["..."],
rootPass: "...",
stackscriptId: fooStackScript.id,
stackscriptData: {
"package": "nginx",
},
});
Coming soon!
Create a StackScript Resource
new StackScript(name: string, args: StackScriptArgs, opts?: CustomResourceOptions);
@overload
def StackScript(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
images: Optional[Sequence[str]] = None,
is_public: Optional[bool] = None,
label: Optional[str] = None,
rev_note: Optional[str] = None,
script: Optional[str] = None,
user_defined_fields: Optional[Sequence[StackScriptUserDefinedFieldArgs]] = None)
@overload
def StackScript(resource_name: str,
args: StackScriptArgs,
opts: Optional[ResourceOptions] = None)
func NewStackScript(ctx *Context, name string, args StackScriptArgs, opts ...ResourceOption) (*StackScript, error)
public StackScript(string name, StackScriptArgs args, CustomResourceOptions? opts = null)
public StackScript(String name, StackScriptArgs args)
public StackScript(String name, StackScriptArgs args, CustomResourceOptions options)
type: linode:StackScript
properties: # The arguments to resource properties.
options: # 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.
- resource_name str
- The unique name of the resource.
- args StackScriptArgs
- 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 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.
- name String
- The unique name of the resource.
- args StackScriptArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts 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_public
forces 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_public
forces 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 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
List
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_public
forces 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 ListFields 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 boolean 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- 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 Args[] 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 Sequence[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_public
forces 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_ Sequence[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
List
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_public
forces 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 ListFields 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 Integer Count of currently active, deployed Linodes created from this StackScript.
- deployments
Total Integer 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 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 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.
- 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.
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): StackScript
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created: Optional[str] = None,
deployments_active: Optional[int] = None,
deployments_total: Optional[int] = None,
description: Optional[str] = None,
images: Optional[Sequence[str]] = None,
is_public: Optional[bool] = None,
label: Optional[str] = None,
rev_note: Optional[str] = None,
script: Optional[str] = None,
updated: Optional[str] = None,
user_defined_fields: Optional[Sequence[StackScriptUserDefinedFieldArgs]] = None,
user_gravatar_id: Optional[str] = None,
username: Optional[str] = None) -> StackScript
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)
public static StackScript get(String name, Output<String> id, StackScriptState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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_public
forces 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_public
forces 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 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 Integer Count of currently active, deployed Linodes created from this StackScript.
- deployments
Total Integer The total number of times this StackScript has been deployed.
- description String
A description for the StackScript.
- images
List
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_public
forces 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 ListFields 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 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_public
forces 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 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 str
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 str
A description for the StackScript.
- images Sequence[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_public
forces 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_ Sequence[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_ strid The Gravatar ID for the User who created the StackScript.
- username str
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
List
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_public
forces 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 ListFields 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.
Supporting Types
StackScriptUserDefinedField
Import
Linodes StackScripts can be imported using the Linode StackScript id
, e.g.
$ pulumi import linode:index/stackScript:StackScript mystackscript 1234567
Package Details
- Repository
- https://github.com/pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
linode
Terraform Provider.