UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

221 lines (220 loc) 8.87 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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](https://www.linode.com/docs/platform/stackscripts/) and the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-add-stack-script). * * ## Example Usage * * The following example shows how one might use this resource to configure a StackScript attached to a Linode Instance. As shown below, StackScripts must begin with a shebang (`#!`). The `<UDF ...>` element provided in the Bash comment block defines a variable whose value is provided when creating the Instance (or disk) using the `stackscriptData` field. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foo = new linode.StackScript("foo", { * 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/ubuntu22.04", * "linode/ubuntu20.04", * ], * revNote: "initial version", * }); * const fooInstance = new linode.Instance("foo", { * image: "linode/ubuntu22.04", * label: "foo", * region: "us-east", * type: "g6-nanode-1", * authorizedKeys: ["..."], * rootPass: "...", * stackscriptId: foo.id, * stackscriptData: { * "package": "nginx", * }, * }); * ``` * * ## Import * * Linodes StackScripts can be imported using the Linode StackScript `id`, e.g. * * ```sh * $ pulumi import linode:index/stackScript:StackScript mystackscript 1234567 * ``` */ export declare class StackScript extends pulumi.CustomResource { /** * Get an existing StackScript resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: StackScriptState, opts?: pulumi.CustomResourceOptions): StackScript; /** * Returns true if the given object is an instance of StackScript. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is StackScript; /** * The date this StackScript was created. */ readonly created: pulumi.Output<string>; /** * Count of currently active, deployed Linodes created from this StackScript. */ readonly deploymentsActive: pulumi.Output<number>; /** * The total number of times this StackScript has been deployed. */ readonly deploymentsTotal: pulumi.Output<number>; /** * A description for the StackScript. */ readonly description: pulumi.Output<string>; /** * A set of Image IDs representing the Images that this StackScript is compatible for deploying with. `any/all` indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. * * - - - */ readonly images: pulumi.Output<string[]>; /** * This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. *Changing `isPublic` forces the creation of a new StackScript* */ readonly isPublic: pulumi.Output<boolean>; /** * The StackScript's label is for display purposes only. */ readonly label: pulumi.Output<string>; /** * This field allows you to add notes for the set of revisions made to this StackScript. */ readonly revNote: pulumi.Output<string>; /** * The script to execute when provisioning a new Linode with this StackScript. */ readonly script: pulumi.Output<string>; /** * The date this StackScript was updated. */ readonly updated: pulumi.Output<string>; /** * This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment. */ readonly userDefinedFields: pulumi.Output<outputs.StackScriptUserDefinedField[]>; /** * The Gravatar ID for the User who created the StackScript. */ readonly userGravatarId: pulumi.Output<string>; /** * The User who created the StackScript. */ readonly username: pulumi.Output<string>; /** * Create a StackScript resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: StackScriptArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering StackScript resources. */ export interface StackScriptState { /** * The date this StackScript was created. */ created?: pulumi.Input<string>; /** * Count of currently active, deployed Linodes created from this StackScript. */ deploymentsActive?: pulumi.Input<number>; /** * The total number of times this StackScript has been deployed. */ deploymentsTotal?: pulumi.Input<number>; /** * A description for the StackScript. */ description?: pulumi.Input<string>; /** * A set of Image IDs representing the Images that this StackScript is compatible for deploying with. `any/all` indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. * * - - - */ images?: pulumi.Input<pulumi.Input<string>[]>; /** * This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. *Changing `isPublic` forces the creation of a new StackScript* */ isPublic?: pulumi.Input<boolean>; /** * The StackScript's label is for display purposes only. */ label?: pulumi.Input<string>; /** * This field allows you to add notes for the set of revisions made to this StackScript. */ revNote?: pulumi.Input<string>; /** * The script to execute when provisioning a new Linode with this StackScript. */ script?: pulumi.Input<string>; /** * The date this StackScript was updated. */ updated?: pulumi.Input<string>; /** * This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment. */ userDefinedFields?: pulumi.Input<pulumi.Input<inputs.StackScriptUserDefinedField>[]>; /** * The Gravatar ID for the User who created the StackScript. */ userGravatarId?: pulumi.Input<string>; /** * The User who created the StackScript. */ username?: pulumi.Input<string>; } /** * The set of arguments for constructing a StackScript resource. */ export interface StackScriptArgs { /** * A description for the StackScript. */ description: pulumi.Input<string>; /** * A set of Image IDs representing the Images that this StackScript is compatible for deploying with. `any/all` indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. * * - - - */ images: pulumi.Input<pulumi.Input<string>[]>; /** * This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. *Changing `isPublic` forces the creation of a new StackScript* */ isPublic?: pulumi.Input<boolean>; /** * The StackScript's label is for display purposes only. */ label: pulumi.Input<string>; /** * This field allows you to add notes for the set of revisions made to this StackScript. */ revNote?: pulumi.Input<string>; /** * The script to execute when provisioning a new Linode with this StackScript. */ script: pulumi.Input<string>; }