1. Packages
  2. Linode
  3. API Docs
  4. getStackScripts
Linode v4.23.0 published on Thursday, Jul 18, 2024 by Pulumi

linode.getStackScripts

Explore with Pulumi AI

linode logo
Linode v4.23.0 published on Thursday, Jul 18, 2024 by Pulumi

    Provides information about Linode StackScripts that match a set of filters. For more information, see the Linode APIv4 docs.

    NOTICE: Due to the large number of public StackScripts, this data source may time out if is_public is not filtered on.

    Example Usage

    The following example shows how one might use this data source to access information about a Linode StackScript.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const specific-stackscripts = linode.getStackScripts({
        filters: [
            {
                name: "label",
                values: ["my-cool-stackscript"],
            },
            {
                name: "is_public",
                values: ["false"],
            },
        ],
    });
    export const stackscriptId = specific_stackscripts.then(specific_stackscripts => specific_stackscripts.stackscripts?.[0]?.id);
    
    import pulumi
    import pulumi_linode as linode
    
    specific_stackscripts = linode.get_stack_scripts(filters=[
        linode.GetStackScriptsFilterArgs(
            name="label",
            values=["my-cool-stackscript"],
        ),
        linode.GetStackScriptsFilterArgs(
            name="is_public",
            values=["false"],
        ),
    ])
    pulumi.export("stackscriptId", specific_stackscripts.stackscripts[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		specific_stackscripts, err := linode.GetStackScripts(ctx, &linode.GetStackScriptsArgs{
    			Filters: []linode.GetStackScriptsFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-cool-stackscript",
    					},
    				},
    				{
    					Name: "is_public",
    					Values: []string{
    						"false",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("stackscriptId", specific_stackscripts.Stackscripts[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var specific_stackscripts = Linode.GetStackScripts.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetStackScriptsFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-cool-stackscript",
                    },
                },
                new Linode.Inputs.GetStackScriptsFilterInputArgs
                {
                    Name = "is_public",
                    Values = new[]
                    {
                        "false",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["stackscriptId"] = specific_stackscripts.Apply(specific_stackscripts => specific_stackscripts.Apply(getStackScriptsResult => getStackScriptsResult.Stackscripts[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetStackScriptsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var specific-stackscripts = LinodeFunctions.getStackScripts(GetStackScriptsArgs.builder()
                .filters(            
                    GetStackScriptsFilterArgs.builder()
                        .name("label")
                        .values("my-cool-stackscript")
                        .build(),
                    GetStackScriptsFilterArgs.builder()
                        .name("is_public")
                        .values(false)
                        .build())
                .build());
    
            ctx.export("stackscriptId", specific_stackscripts.stackscripts()[0].id());
        }
    }
    
    variables:
      specific-stackscripts:
        fn::invoke:
          Function: linode:getStackScripts
          Arguments:
            filters:
              - name: label
                values:
                  - my-cool-stackscript
              - name: is_public
                values:
                  - false
    outputs:
      stackscriptId: ${["specific-stackscripts"].stackscripts[0].id}
    

    Filterable Fields

    • deployments_active

    • deployments_total

    • description

    • images

    • is_public

    • label

    • mine

    • rev_note

    • username

    Using getStackScripts

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getStackScripts(args: GetStackScriptsArgs, opts?: InvokeOptions): Promise<GetStackScriptsResult>
    function getStackScriptsOutput(args: GetStackScriptsOutputArgs, opts?: InvokeOptions): Output<GetStackScriptsResult>
    def get_stack_scripts(filters: Optional[Sequence[GetStackScriptsFilter]] = None,
                          latest: Optional[bool] = None,
                          order: Optional[str] = None,
                          order_by: Optional[str] = None,
                          stackscripts: Optional[Sequence[GetStackScriptsStackscript]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetStackScriptsResult
    def get_stack_scripts_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetStackScriptsFilterArgs]]]] = None,
                          latest: Optional[pulumi.Input[bool]] = None,
                          order: Optional[pulumi.Input[str]] = None,
                          order_by: Optional[pulumi.Input[str]] = None,
                          stackscripts: Optional[pulumi.Input[Sequence[pulumi.Input[GetStackScriptsStackscriptArgs]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetStackScriptsResult]
    func GetStackScripts(ctx *Context, args *GetStackScriptsArgs, opts ...InvokeOption) (*GetStackScriptsResult, error)
    func GetStackScriptsOutput(ctx *Context, args *GetStackScriptsOutputArgs, opts ...InvokeOption) GetStackScriptsResultOutput

    > Note: This function is named GetStackScripts in the Go SDK.

    public static class GetStackScripts 
    {
        public static Task<GetStackScriptsResult> InvokeAsync(GetStackScriptsArgs args, InvokeOptions? opts = null)
        public static Output<GetStackScriptsResult> Invoke(GetStackScriptsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStackScriptsResult> getStackScripts(GetStackScriptsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getStackScripts:getStackScripts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetStackScriptsFilter>
    Latest bool
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Stackscripts List<GetStackScriptsStackscript>
    Filters []GetStackScriptsFilter
    Latest bool
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Stackscripts []GetStackScriptsStackscript
    filters List<GetStackScriptsFilter>
    latest Boolean
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    stackscripts List<GetStackScriptsStackscript>
    filters GetStackScriptsFilter[]
    latest boolean
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    order string
    The order in which results should be returned. (asc, desc; default asc)
    orderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    stackscripts GetStackScriptsStackscript[]
    filters Sequence[GetStackScriptsFilter]
    latest bool
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    order str
    The order in which results should be returned. (asc, desc; default asc)
    order_by str
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    stackscripts Sequence[GetStackScriptsStackscript]
    filters List<Property Map>
    latest Boolean
    If true, only the latest StackScript will be returned. StackScripts without a valid created field are not included in the result.

    • filter - (Optional) A set of filters used to select Linode StackScripts that meet certain requirements.
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    stackscripts List<Property Map>

    getStackScripts Result

    The following output properties are available:

    Id string
    The unique ID of the StackScript.
    Filters []GetStackScriptsFilter
    Latest bool
    Order string
    OrderBy string
    Stackscripts []GetStackScriptsStackscript
    id string
    The unique ID of the StackScript.
    filters GetStackScriptsFilter[]
    latest boolean
    order string
    orderBy string
    stackscripts GetStackScriptsStackscript[]
    id String
    The unique ID of the StackScript.
    filters List<Property Map>
    latest Boolean
    order String
    orderBy String
    stackscripts List<Property Map>

    Supporting Types

    GetStackScriptsFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetStackScriptsStackscript

    Created string
    The date this StackScript was created.
    DeploymentsActive int
    Count of currently active, deployed Linodes created from this StackScript.
    DeploymentsTotal int
    The total number of times this StackScript has been deployed.
    Description string
    A description for the StackScript.
    Id string
    The unique ID of the StackScript.
    Images List<string>
    An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
    IsPublic bool
    This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
    Label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    RevNote 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.
    UserDefinedFields List<GetStackScriptsStackscriptUserDefinedField>
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    UserGravatarId string
    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.
    DeploymentsActive int
    Count of currently active, deployed Linodes created from this StackScript.
    DeploymentsTotal int
    The total number of times this StackScript has been deployed.
    Description string
    A description for the StackScript.
    Id string
    The unique ID of the StackScript.
    Images []string
    An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
    IsPublic bool
    This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
    Label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    RevNote 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.
    UserDefinedFields []GetStackScriptsStackscriptUserDefinedField
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    UserGravatarId string
    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.
    deploymentsActive Integer
    Count of currently active, deployed Linodes created from this StackScript.
    deploymentsTotal Integer
    The total number of times this StackScript has been deployed.
    description String
    A description for the StackScript.
    id String
    The unique ID of the StackScript.
    images List<String>
    An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
    isPublic Boolean
    This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
    label String
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    revNote 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.
    userDefinedFields List<GetStackScriptsStackscriptUserDefinedField>
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    userGravatarId String
    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.
    deploymentsActive number
    Count of currently active, deployed Linodes created from this StackScript.
    deploymentsTotal number
    The total number of times this StackScript has been deployed.
    description string
    A description for the StackScript.
    id string
    The unique ID of the StackScript.
    images string[]
    An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
    isPublic boolean
    This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
    label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    revNote 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.
    userDefinedFields GetStackScriptsStackscriptUserDefinedField[]
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    userGravatarId string
    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.
    id str
    The unique ID of 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.
    label str
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    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_fields Sequence[GetStackScriptsStackscriptUserDefinedField]
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    user_gravatar_id str
    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.
    deploymentsActive Number
    Count of currently active, deployed Linodes created from this StackScript.
    deploymentsTotal Number
    The total number of times this StackScript has been deployed.
    description String
    A description for the StackScript.
    id String
    The unique ID of the StackScript.
    images List<String>
    An array of Image IDs representing the Images that this StackScript is compatible for deploying with.
    isPublic Boolean
    This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
    label String
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    revNote 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.
    userDefinedFields List<Property Map>
    This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment.
    userGravatarId String
    The Gravatar ID for the User who created the StackScript.
    username String
    The User who created the StackScript.

    GetStackScriptsStackscriptUserDefinedField

    Default string
    The default value. If not specified, this value will be used.
    Example string
    An example value for the field.
    Label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    ManyOf string
    A list of acceptable values for the field in any quantity, combination or order.
    Name string
    The name of the field.
    OneOf string
    A list of acceptable single values for the field.
    Default string
    The default value. If not specified, this value will be used.
    Example string
    An example value for the field.
    Label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    ManyOf string
    A list of acceptable values for the field in any quantity, combination or order.
    Name string
    The name of the field.
    OneOf string
    A list of acceptable single values for the field.
    default_ String
    The default value. If not specified, this value will be used.
    example String
    An example value for the field.
    label String
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    manyOf String
    A list of acceptable values for the field in any quantity, combination or order.
    name String
    The name of the field.
    oneOf String
    A list of acceptable single values for the field.
    default string
    The default value. If not specified, this value will be used.
    example string
    An example value for the field.
    label string
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    manyOf string
    A list of acceptable values for the field in any quantity, combination or order.
    name string
    The name of the field.
    oneOf string
    A list of acceptable single values for the field.
    default str
    The default value. If not specified, this value will be used.
    example str
    An example value for the field.
    label str
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    many_of str
    A list of acceptable values for the field in any quantity, combination or order.
    name str
    The name of the field.
    one_of str
    A list of acceptable single values for the field.
    default String
    The default value. If not specified, this value will be used.
    example String
    An example value for the field.
    label String
    A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
    manyOf String
    A list of acceptable values for the field in any quantity, combination or order.
    name String
    The name of the field.
    oneOf String
    A list of acceptable single values for the field.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.23.0 published on Thursday, Jul 18, 2024 by Pulumi