1. Packages
  2. Octopusdeploy Provider
  3. API Docs
  4. ScriptModule
octopusdeploy 0.43.0 published on Thursday, Apr 17, 2025 by octopusdeploylabs

octopusdeploy.ScriptModule

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as octopusdeploy from "@pulumi/octopusdeploy";

const example = new octopusdeploy.ScriptModule("example", {
    description: "A script module to use.",
    scripts: [{
        body: `function Say-Hello()\x0d
{\x0d
    Write-Output "Hello, Octopus!"\x0d
}\x0d

`,
        syntax: "PowerShell",
    }],
});
Copy
import pulumi
import pulumi_octopusdeploy as octopusdeploy

example = octopusdeploy.ScriptModule("example",
    description="A script module to use.",
    scripts=[{
        "body": """function Say-Hello()\x0d
{\x0d
    Write-Output "Hello, Octopus!"\x0d
}\x0d

""",
        "syntax": "PowerShell",
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/octopusdeploy/octopusdeploy"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := octopusdeploy.NewScriptModule(ctx, "example", &octopusdeploy.ScriptModuleArgs{
			Description: pulumi.String("A script module to use."),
			Scripts: octopusdeploy.ScriptModuleScriptArray{
				&octopusdeploy.ScriptModuleScriptArgs{
					Body: pulumi.String(`function Say-Hello()
{
    Write-Output "Hello, Octopus!"
}

`),
					Syntax: pulumi.String("PowerShell"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Octopusdeploy = Pulumi.Octopusdeploy;

return await Deployment.RunAsync(() => 
{
    var example = new Octopusdeploy.ScriptModule("example", new()
    {
        Description = "A script module to use.",
        Scripts = new[]
        {
            new Octopusdeploy.Inputs.ScriptModuleScriptArgs
            {
                Body = @"function Say-Hello()
{
    Write-Output ""Hello, Octopus!""
}

",
                Syntax = "PowerShell",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.octopusdeploy.ScriptModule;
import com.pulumi.octopusdeploy.ScriptModuleArgs;
import com.pulumi.octopusdeploy.inputs.ScriptModuleScriptArgs;
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) {
        var example = new ScriptModule("example", ScriptModuleArgs.builder()
            .description("A script module to use.")
            .scripts(ScriptModuleScriptArgs.builder()
                .body("""
function Say-Hello()
{
    Write-Output "Hello, Octopus!"
}

                """)
                .syntax("PowerShell")
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: octopusdeploy:ScriptModule
    properties:
      description: A script module to use.
      scripts:
        - body: "function Say-Hello()\r\n{\r\n    Write-Output \"Hello, Octopus!\"\r\n}\r\n\n"
          syntax: PowerShell
Copy

Create ScriptModule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ScriptModule(name: string, args?: ScriptModuleArgs, opts?: CustomResourceOptions);
@overload
def ScriptModule(resource_name: str,
                 args: Optional[ScriptModuleArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def ScriptModule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 description: Optional[str] = None,
                 name: Optional[str] = None,
                 scripts: Optional[Sequence[ScriptModuleScriptArgs]] = None,
                 space_id: Optional[str] = None,
                 variable_set_id: Optional[str] = None)
func NewScriptModule(ctx *Context, name string, args *ScriptModuleArgs, opts ...ResourceOption) (*ScriptModule, error)
public ScriptModule(string name, ScriptModuleArgs? args = null, CustomResourceOptions? opts = null)
public ScriptModule(String name, ScriptModuleArgs args)
public ScriptModule(String name, ScriptModuleArgs args, CustomResourceOptions options)
type: octopusdeploy:ScriptModule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ScriptModuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ScriptModuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ScriptModuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ScriptModuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ScriptModuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var scriptModuleResource = new Octopusdeploy.ScriptModule("scriptModuleResource", new()
{
    Description = "string",
    Name = "string",
    Scripts = new[]
    {
        new Octopusdeploy.Inputs.ScriptModuleScriptArgs
        {
            Body = "string",
            Syntax = "string",
        },
    },
    SpaceId = "string",
    VariableSetId = "string",
});
Copy
example, err := octopusdeploy.NewScriptModule(ctx, "scriptModuleResource", &octopusdeploy.ScriptModuleArgs{
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Scripts: .ScriptModuleScriptArray{
&.ScriptModuleScriptArgs{
Body: pulumi.String("string"),
Syntax: pulumi.String("string"),
},
},
SpaceId: pulumi.String("string"),
VariableSetId: pulumi.String("string"),
})
Copy
var scriptModuleResource = new ScriptModule("scriptModuleResource", ScriptModuleArgs.builder()
    .description("string")
    .name("string")
    .scripts(ScriptModuleScriptArgs.builder()
        .body("string")
        .syntax("string")
        .build())
    .spaceId("string")
    .variableSetId("string")
    .build());
Copy
script_module_resource = octopusdeploy.ScriptModule("scriptModuleResource",
    description="string",
    name="string",
    scripts=[{
        "body": "string",
        "syntax": "string",
    }],
    space_id="string",
    variable_set_id="string")
Copy
const scriptModuleResource = new octopusdeploy.ScriptModule("scriptModuleResource", {
    description: "string",
    name: "string",
    scripts: [{
        body: "string",
        syntax: "string",
    }],
    spaceId: "string",
    variableSetId: "string",
});
Copy
type: octopusdeploy:ScriptModule
properties:
    description: string
    name: string
    scripts:
        - body: string
          syntax: string
    spaceId: string
    variableSetId: string
Copy

ScriptModule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ScriptModule resource accepts the following input properties:

Description string
The description of this script module.
Name string
The name of this resource.
Scripts List<ScriptModuleScript>
The script associated with this script module.
SpaceId string
The space ID associated with this Script Module.
VariableSetId string
The variable set ID for this script module.
Description string
The description of this script module.
Name string
The name of this resource.
Scripts []ScriptModuleScriptArgs
The script associated with this script module.
SpaceId string
The space ID associated with this Script Module.
VariableSetId string
The variable set ID for this script module.
description String
The description of this script module.
name String
The name of this resource.
scripts List<ScriptModuleScript>
The script associated with this script module.
spaceId String
The space ID associated with this Script Module.
variableSetId String
The variable set ID for this script module.
description string
The description of this script module.
name string
The name of this resource.
scripts ScriptModuleScript[]
The script associated with this script module.
spaceId string
The space ID associated with this Script Module.
variableSetId string
The variable set ID for this script module.
description str
The description of this script module.
name str
The name of this resource.
scripts Sequence[ScriptModuleScriptArgs]
The script associated with this script module.
space_id str
The space ID associated with this Script Module.
variable_set_id str
The variable set ID for this script module.
description String
The description of this script module.
name String
The name of this resource.
scripts List<Property Map>
The script associated with this script module.
spaceId String
The space ID associated with this Script Module.
variableSetId String
The variable set ID for this script module.

Outputs

All input properties are implicitly available as output properties. Additionally, the ScriptModule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ScriptModule Resource

Get an existing ScriptModule 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?: ScriptModuleState, opts?: CustomResourceOptions): ScriptModule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        scripts: Optional[Sequence[ScriptModuleScriptArgs]] = None,
        space_id: Optional[str] = None,
        variable_set_id: Optional[str] = None) -> ScriptModule
func GetScriptModule(ctx *Context, name string, id IDInput, state *ScriptModuleState, opts ...ResourceOption) (*ScriptModule, error)
public static ScriptModule Get(string name, Input<string> id, ScriptModuleState? state, CustomResourceOptions? opts = null)
public static ScriptModule get(String name, Output<String> id, ScriptModuleState state, CustomResourceOptions options)
resources:  _:    type: octopusdeploy:ScriptModule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
The description of this script module.
Name string
The name of this resource.
Scripts List<ScriptModuleScript>
The script associated with this script module.
SpaceId string
The space ID associated with this Script Module.
VariableSetId string
The variable set ID for this script module.
Description string
The description of this script module.
Name string
The name of this resource.
Scripts []ScriptModuleScriptArgs
The script associated with this script module.
SpaceId string
The space ID associated with this Script Module.
VariableSetId string
The variable set ID for this script module.
description String
The description of this script module.
name String
The name of this resource.
scripts List<ScriptModuleScript>
The script associated with this script module.
spaceId String
The space ID associated with this Script Module.
variableSetId String
The variable set ID for this script module.
description string
The description of this script module.
name string
The name of this resource.
scripts ScriptModuleScript[]
The script associated with this script module.
spaceId string
The space ID associated with this Script Module.
variableSetId string
The variable set ID for this script module.
description str
The description of this script module.
name str
The name of this resource.
scripts Sequence[ScriptModuleScriptArgs]
The script associated with this script module.
space_id str
The space ID associated with this Script Module.
variable_set_id str
The variable set ID for this script module.
description String
The description of this script module.
name String
The name of this resource.
scripts List<Property Map>
The script associated with this script module.
spaceId String
The space ID associated with this Script Module.
variableSetId String
The variable set ID for this script module.

Supporting Types

ScriptModuleScript
, ScriptModuleScriptArgs

Body This property is required. string
The body of this script module.
Syntax This property is required. string
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.
Body This property is required. string
The body of this script module.
Syntax This property is required. string
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.
body This property is required. String
The body of this script module.
syntax This property is required. String
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.
body This property is required. string
The body of this script module.
syntax This property is required. string
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.
body This property is required. str
The body of this script module.
syntax This property is required. str
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.
body This property is required. String
The body of this script module.
syntax This property is required. String
The syntax of the script. Valid types are Bash, CSharp, FSharp, PowerShell, or Python.

Import

$ pulumi import octopusdeploy:index/scriptModule:ScriptModule [options] octopusdeploy_script_module.<name> <script-module-id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
octopusdeploy octopusdeploylabs/terraform-provider-octopusdeploy
License
Notes
This Pulumi package is based on the octopusdeploy Terraform Provider.