command

package
v0.0.0-...-8bce369 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

A Pulumi resource provider for running commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package.

Types

type Cmd

type Cmd struct {
	// Specifiy the command to run as an array of arguments
	Command     []string          `pulumi:"command"`
	Environment map[string]string `pulumi:"environment"`
	// Pass the stdin to a command
	Stdin *string `pulumi:"stdin"`
}

Command specification

type CmdArgs

type CmdArgs struct {
	// Specifiy the command to run as an array of arguments
	Command     pulumi.StringArrayInput `pulumi:"command"`
	Environment pulumi.StringMapInput   `pulumi:"environment"`
	// Pass the stdin to a command
	Stdin pulumi.StringPtrInput `pulumi:"stdin"`
}

Command specification

func (CmdArgs) ElementType

func (CmdArgs) ElementType() reflect.Type

func (CmdArgs) ToCmdOutput

func (i CmdArgs) ToCmdOutput() CmdOutput

func (CmdArgs) ToCmdOutputWithContext

func (i CmdArgs) ToCmdOutputWithContext(ctx context.Context) CmdOutput

func (CmdArgs) ToCmdPtrOutput

func (i CmdArgs) ToCmdPtrOutput() CmdPtrOutput

func (CmdArgs) ToCmdPtrOutputWithContext

func (i CmdArgs) ToCmdPtrOutputWithContext(ctx context.Context) CmdPtrOutput

type CmdInput

type CmdInput interface {
	pulumi.Input

	ToCmdOutput() CmdOutput
	ToCmdOutputWithContext(context.Context) CmdOutput
}

CmdInput is an input type that accepts CmdArgs and CmdOutput values. You can construct a concrete instance of `CmdInput` via:

CmdArgs{...}

type CmdOutput

type CmdOutput struct{ *pulumi.OutputState }

Command specification

func (CmdOutput) Command

func (o CmdOutput) Command() pulumi.StringArrayOutput

Specifiy the command to run as an array of arguments

func (CmdOutput) ElementType

func (CmdOutput) ElementType() reflect.Type

func (CmdOutput) Environment

func (o CmdOutput) Environment() pulumi.StringMapOutput

func (CmdOutput) Stdin

func (o CmdOutput) Stdin() pulumi.StringPtrOutput

Pass the stdin to a command

func (CmdOutput) ToCmdOutput

func (o CmdOutput) ToCmdOutput() CmdOutput

func (CmdOutput) ToCmdOutputWithContext

func (o CmdOutput) ToCmdOutputWithContext(ctx context.Context) CmdOutput

func (CmdOutput) ToCmdPtrOutput

func (o CmdOutput) ToCmdPtrOutput() CmdPtrOutput

func (CmdOutput) ToCmdPtrOutputWithContext

func (o CmdOutput) ToCmdPtrOutputWithContext(ctx context.Context) CmdPtrOutput

type CmdPtrInput

type CmdPtrInput interface {
	pulumi.Input

	ToCmdPtrOutput() CmdPtrOutput
	ToCmdPtrOutputWithContext(context.Context) CmdPtrOutput
}

CmdPtrInput is an input type that accepts CmdArgs, CmdPtr and CmdPtrOutput values. You can construct a concrete instance of `CmdPtrInput` via:

        CmdArgs{...}

or:

        nil

func CmdPtr

func CmdPtr(v *CmdArgs) CmdPtrInput

type CmdPtrOutput

type CmdPtrOutput struct{ *pulumi.OutputState }

func (CmdPtrOutput) Command

Specifiy the command to run as an array of arguments

func (CmdPtrOutput) Elem

func (o CmdPtrOutput) Elem() CmdOutput

func (CmdPtrOutput) ElementType

func (CmdPtrOutput) ElementType() reflect.Type

func (CmdPtrOutput) Environment

func (o CmdPtrOutput) Environment() pulumi.StringMapOutput

func (CmdPtrOutput) Stdin

Pass the stdin to a command

func (CmdPtrOutput) ToCmdPtrOutput

func (o CmdPtrOutput) ToCmdPtrOutput() CmdPtrOutput

func (CmdPtrOutput) ToCmdPtrOutputWithContext

func (o CmdPtrOutput) ToCmdPtrOutputWithContext(ctx context.Context) CmdPtrOutput

type Command

type Command struct {
	pulumi.CustomResourceState

	Compare pulumi.StringPtrOutput `pulumi:"compare"`
	// Define a command to create a resource.
	Create CmdPtrOutput `pulumi:"create"`
	Delete CmdPtrOutput `pulumi:"delete"`
	// Specify a command to run to diff the resource.
	//
	// Exit 0 to run update.
	// Exit with a non-zero value or omit to disable update.
	// Hint: an easy method to always run update is to set diff to `['true']`
	Diff CmdPtrOutput `pulumi:"diff"`
	// Define a command to create read the resource.
	Read CmdPtrOutput `pulumi:"read"`
	// stderr of the command
	Stderr pulumi.StringPtrOutput `pulumi:"stderr"`
	// stdout of the command
	Stdout pulumi.StringPtrOutput `pulumi:"stdout"`
	// If unspecified, create definition will be used. Define to provide an alternate update command.
	Update CmdPtrOutput `pulumi:"update"`
}

Execute a Command and save it as a resource.

Each command can be specified as an object or a convenience array. If only `create` is specified, `update` will use the create definition. The `compare` property will be JSON serialized with a hash saved in the state. This is useful to ensure update is run if dependendent resources change.

An update will occur in these cases: 1. The `compare` hash or the `update` arguments change. 2. The specified `diff` command exits with an error.

func GetCommand

func GetCommand(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *CommandState, opts ...pulumi.ResourceOption) (*Command, error)

GetCommand gets an existing Command resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewCommand

func NewCommand(ctx *pulumi.Context,
	name string, args *CommandArgs, opts ...pulumi.ResourceOption) (*Command, error)

NewCommand registers a new resource with the given unique name, arguments, and options.

func (*Command) ElementType

func (*Command) ElementType() reflect.Type

func (*Command) ToCommandOutput

func (i *Command) ToCommandOutput() CommandOutput

func (*Command) ToCommandOutputWithContext

func (i *Command) ToCommandOutputWithContext(ctx context.Context) CommandOutput

type CommandArgs

type CommandArgs struct {
	// Define a command to create a resource.
	Create CmdInput
	Delete CmdPtrInput
	// Specify a command to run to diff the resource.
	//
	// Exit 0 to run update.
	// Exit with a non-zero value or omit to disable update.
	// Hint: an easy method to always run update is to set diff to `['true']`
	Diff CmdPtrInput
	// Define a command to create read the resource.
	Read CmdPtrInput
	// If unspecified, create definition will be used. Define to provide an alternate update command.
	Update CmdPtrInput
}

The set of arguments for constructing a Command resource.

func (CommandArgs) ElementType

func (CommandArgs) ElementType() reflect.Type

type CommandInput

type CommandInput interface {
	pulumi.Input

	ToCommandOutput() CommandOutput
	ToCommandOutputWithContext(ctx context.Context) CommandOutput
}

type CommandOutput

type CommandOutput struct{ *pulumi.OutputState }

func (CommandOutput) ElementType

func (CommandOutput) ElementType() reflect.Type

func (CommandOutput) ToCommandOutput

func (o CommandOutput) ToCommandOutput() CommandOutput

func (CommandOutput) ToCommandOutputWithContext

func (o CommandOutput) ToCommandOutputWithContext(ctx context.Context) CommandOutput

type CommandState

type CommandState struct {
}

func (CommandState) ElementType

func (CommandState) ElementType() reflect.Type

type Provider

type Provider struct {
	pulumi.ProviderResourceState
}

func NewProvider

func NewProvider(ctx *pulumi.Context,
	name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error)

NewProvider registers a new resource with the given unique name, arguments, and options.

func (*Provider) ElementType

func (*Provider) ElementType() reflect.Type

func (*Provider) ToProviderOutput

func (i *Provider) ToProviderOutput() ProviderOutput

func (*Provider) ToProviderOutputWithContext

func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type ProviderArgs

type ProviderArgs struct {
}

The set of arguments for constructing a Provider resource.

func (ProviderArgs) ElementType

func (ProviderArgs) ElementType() reflect.Type

type ProviderInput

type ProviderInput interface {
	pulumi.Input

	ToProviderOutput() ProviderOutput
	ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}

type ProviderOutput

type ProviderOutput struct{ *pulumi.OutputState }

func (ProviderOutput) ElementType

func (ProviderOutput) ElementType() reflect.Type

func (ProviderOutput) ToProviderOutput

func (o ProviderOutput) ToProviderOutput() ProviderOutput

func (ProviderOutput) ToProviderOutputWithContext

func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL