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",
}],
});
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",
}])
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
})
}
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",
},
},
});
});
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());
}
}
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
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
});
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"),
})
var scriptModuleResource = new ScriptModule("scriptModuleResource", ScriptModuleArgs.builder()
.description("string")
.name("string")
.scripts(ScriptModuleScriptArgs.builder()
.body("string")
.syntax("string")
.build())
.spaceId("string")
.variableSetId("string")
.build());
script_module_resource = octopusdeploy.ScriptModule("scriptModuleResource",
description="string",
name="string",
scripts=[{
"body": "string",
"syntax": "string",
}],
space_id="string",
variable_set_id="string")
const scriptModuleResource = new octopusdeploy.ScriptModule("scriptModuleResource", {
description: "string",
name: "string",
scripts: [{
body: "string",
syntax: "string",
}],
spaceId: "string",
variableSetId: "string",
});
type: octopusdeploy:ScriptModule
properties:
description: string
name: string
scripts:
- body: string
syntax: string
spaceId: string
variableSetId: string
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<Script
Module Script> - The script associated with this script module.
- Space
Id string - The space ID associated with this Script Module.
- Variable
Set stringId - The variable set ID for this script module.
- Description string
- The description of this script module.
- Name string
- The name of this resource.
- Scripts
[]Script
Module Script Args - The script associated with this script module.
- Space
Id string - The space ID associated with this Script Module.
- Variable
Set stringId - 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<Script
Module Script> - The script associated with this script module.
- space
Id String - The space ID associated with this Script Module.
- variable
Set StringId - The variable set ID for this script module.
- description string
- The description of this script module.
- name string
- The name of this resource.
- scripts
Script
Module Script[] - The script associated with this script module.
- space
Id string - The space ID associated with this Script Module.
- variable
Set stringId - 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[Script
Module Script Args] - The script associated with this script module.
- space_
id str - The space ID associated with this Script Module.
- variable_
set_ strid - 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.
- space
Id String - The space ID associated with this Script Module.
- variable
Set StringId - 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
- 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.
- Description string
- The description of this script module.
- Name string
- The name of this resource.
- Scripts
List<Script
Module Script> - The script associated with this script module.
- Space
Id string - The space ID associated with this Script Module.
- Variable
Set stringId - The variable set ID for this script module.
- Description string
- The description of this script module.
- Name string
- The name of this resource.
- Scripts
[]Script
Module Script Args - The script associated with this script module.
- Space
Id string - The space ID associated with this Script Module.
- Variable
Set stringId - 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<Script
Module Script> - The script associated with this script module.
- space
Id String - The space ID associated with this Script Module.
- variable
Set StringId - The variable set ID for this script module.
- description string
- The description of this script module.
- name string
- The name of this resource.
- scripts
Script
Module Script[] - The script associated with this script module.
- space
Id string - The space ID associated with this Script Module.
- variable
Set stringId - 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[Script
Module Script Args] - The script associated with this script module.
- space_
id str - The space ID associated with this Script Module.
- variable_
set_ strid - 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.
- space
Id String - The space ID associated with this Script Module.
- variable
Set StringId - The variable set ID for this script module.
Supporting Types
ScriptModuleScript, ScriptModuleScriptArgs
Import
$ pulumi import octopusdeploy:index/scriptModule:ScriptModule [options] octopusdeploy_script_module.<name> <script-module-id>
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.