1. Packages
  2. Vultr
  3. API Docs
  4. getStartupScript
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.getStartupScript

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

    Get information about a Vultr startup script. This data source provides the name, script, type, creation date, and the last modification date for your Vultr startup script.

    Example Usage

    Get the information for a startup script by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myStartupScript = vultr.getStartupScript({
        filters: [{
            name: "name",
            values: ["my-startup-script-name"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_startup_script = vultr.get_startup_script(filters=[vultr.GetStartupScriptFilterArgs(
        name="name",
        values=["my-startup-script-name"],
    )])
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.LookupStartupScript(ctx, &vultr.LookupStartupScriptArgs{
    			Filters: []vultr.GetStartupScriptFilter{
    				{
    					Name: "name",
    					Values: []string{
    						"my-startup-script-name",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myStartupScript = Vultr.GetStartupScript.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetStartupScriptFilterInputArgs
                {
                    Name = "name",
                    Values = new[]
                    {
                        "my-startup-script-name",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.VultrFunctions;
    import com.pulumi.vultr.inputs.GetStartupScriptArgs;
    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 myStartupScript = VultrFunctions.getStartupScript(GetStartupScriptArgs.builder()
                .filters(GetStartupScriptFilterArgs.builder()
                    .name("name")
                    .values("my-startup-script-name")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myStartupScript:
        fn::invoke:
          Function: vultr:getStartupScript
          Arguments:
            filters:
              - name: name
                values:
                  - my-startup-script-name
    

    Using getStartupScript

    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 getStartupScript(args: GetStartupScriptArgs, opts?: InvokeOptions): Promise<GetStartupScriptResult>
    function getStartupScriptOutput(args: GetStartupScriptOutputArgs, opts?: InvokeOptions): Output<GetStartupScriptResult>
    def get_startup_script(filters: Optional[Sequence[GetStartupScriptFilter]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetStartupScriptResult
    def get_startup_script_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetStartupScriptFilterArgs]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetStartupScriptResult]
    func LookupStartupScript(ctx *Context, args *LookupStartupScriptArgs, opts ...InvokeOption) (*LookupStartupScriptResult, error)
    func LookupStartupScriptOutput(ctx *Context, args *LookupStartupScriptOutputArgs, opts ...InvokeOption) LookupStartupScriptResultOutput

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

    public static class GetStartupScript 
    {
        public static Task<GetStartupScriptResult> InvokeAsync(GetStartupScriptArgs args, InvokeOptions? opts = null)
        public static Output<GetStartupScriptResult> Invoke(GetStartupScriptInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStartupScriptResult> getStartupScript(GetStartupScriptArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vultr:index/getStartupScript:getStartupScript
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetStartupScriptFilter>
    Query parameters for finding startup scripts.
    Filters []GetStartupScriptFilter
    Query parameters for finding startup scripts.
    filters List<GetStartupScriptFilter>
    Query parameters for finding startup scripts.
    filters GetStartupScriptFilter[]
    Query parameters for finding startup scripts.
    filters Sequence[GetStartupScriptFilter]
    Query parameters for finding startup scripts.
    filters List<Property Map>
    Query parameters for finding startup scripts.

    getStartupScript Result

    The following output properties are available:

    DateCreated string
    The date the startup script was added to your Vultr account.
    DateModified string
    The date the startup script was last modified.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the startup script.
    Script string
    The contents of the startup script base64 encoded.
    Type string
    The type of the startup script.
    Filters List<ediri.Vultr.Outputs.GetStartupScriptFilter>
    DateCreated string
    The date the startup script was added to your Vultr account.
    DateModified string
    The date the startup script was last modified.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the startup script.
    Script string
    The contents of the startup script base64 encoded.
    Type string
    The type of the startup script.
    Filters []GetStartupScriptFilter
    dateCreated String
    The date the startup script was added to your Vultr account.
    dateModified String
    The date the startup script was last modified.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the startup script.
    script String
    The contents of the startup script base64 encoded.
    type String
    The type of the startup script.
    filters List<GetStartupScriptFilter>
    dateCreated string
    The date the startup script was added to your Vultr account.
    dateModified string
    The date the startup script was last modified.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the startup script.
    script string
    The contents of the startup script base64 encoded.
    type string
    The type of the startup script.
    filters GetStartupScriptFilter[]
    date_created str
    The date the startup script was added to your Vultr account.
    date_modified str
    The date the startup script was last modified.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the startup script.
    script str
    The contents of the startup script base64 encoded.
    type str
    The type of the startup script.
    filters Sequence[GetStartupScriptFilter]
    dateCreated String
    The date the startup script was added to your Vultr account.
    dateModified String
    The date the startup script was last modified.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the startup script.
    script String
    The contents of the startup script base64 encoded.
    type String
    The type of the startup script.
    filters List<Property Map>

    Supporting Types

    GetStartupScriptFilter

    Name string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien