cmd

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Example (Cat_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"cat",
	}

	cmd.Execute()
}
Output:

Downloads the template used to deploy <stack> and prints it to stdout.

Usage:
  rain cat <stack>

Flags:
  -h, --help          help for cat
  -t, --transformed   Get the template with transformations applied by CloudFormation.
  -u, --unformatted   Output the template in its raw form and do not attempt to format it.

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Check_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"check",
	}

	cmd.Execute()
}
Output:

Reads the specified CloudFormation template and validates it against the current CloudFormation specification.

Usage:
  rain check <template file>

Flags:
  -h, --help   help for check

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Deploy_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"deploy",
	}

	cmd.Execute()
}
Output:

Creates or updates a CloudFormation stack named <stack> from the template file <template>.
If you don't specify a stack name, rain will use the template filename minus its extension.

Usage:
  rain deploy <template> [stack]

Flags:
  -d, --detach           Once deployment has started, don't wait around for it to finish.
  -f, --force            Don't ask questions; just deploy.
  -h, --help             help for deploy
      --params strings   Set parameter values. Use the format key1=value1,key2=value2.
      --tags strings     Add tags to the stack. Use the format key1=value1,key2=value2.

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Diff)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"diff",
		"../examples/success.template",
		"../examples/failure.template",
	}

	cmd.Execute()
}
Output:

(>) Description: This template fails
(-) Parameters: {...}
(|) Resources:
(|)   Bucket1:
(-)     Properties: {...}
(+)   Bucket2:
(+)     Properties:
(+)       BucketName: !Ref Bucket1
(+)     Type: "AWS::S3::Bucket"
Example (Fmt_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"fmt",
	}

	cmd.Execute()
}
Output:

Reads the named template and outputs a nicely formatted copy.

Usage:
  rain fmt <filename>

Aliases:
  fmt, format

Flags:
  -c, --compact   Produce more compact output.
  -h, --help      help for fmt
  -j, --json      Output the template as JSON (default format: YAML).
  -v, --verify    Check if the input is already correctly formatted and exit.
                  The exit status will be 0 if so and 1 if not.
  -w, --write     Write the output back to the file rather than to stdout.

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Info_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"info",
	}

	cmd.Execute()
}
Output:

Display the AWS account and region that you're configured to use.

Usage:
  rain info

Flags:
  -c, --creds   Include current AWS credentials
  -h, --help    help for info

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Logs_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"logs",
	}

	cmd.Execute()
}
Output:

Shows a nicely-formatted list of the event log for the named stack, optionally limiting the results to a single resource.

By default, rain will only show log entries that contain a message, for example a failure reason. You can use flags to change this behaviour.

Usage:
  rain logs <stack> (<resource>)

Aliases:
  logs, log

Flags:
  -a, --all    Include uninteresting logs
  -h, --help   help for logs
  -l, --long   Display full details
  -t, --time   Show results in order of time instead of grouped by resource

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Ls_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"ls",
	}

	cmd.Execute()
}
Output:

Displays a list of all running stacks or the contents of <stack> if provided.

Usage:
  rain ls <stack>

Aliases:
  ls, list

Flags:
  -a, --all    List stacks across all regions
  -h, --help   help for ls

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Rainhelp)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
	}

	cmd.Execute()
}
Output:

Rain is what happens when you have a lot of CloudFormation ;)

Usage:
  rain [command]

Stack commands:
  cat         Get the CloudFormation template from a running stack
  deploy      Deploy a CloudFormation stack from a local template
  logs        Show the event log for the named stack
  ls          List running CloudFormation stacks
  rm          Delete a running CloudFormation stack
  watch       Display an updating view of a CloudFormation stack

Template commands:
  build       Create CloudFormation templates
  check       Validate a CloudFormation template against the spec
  diff        Compare CloudFormation templates
  fmt         Format CloudFormation templates
  tree        Find dependencies of Resources and Outputs in a local template

Other Commands:
  help        Help about any command
  info        Show your current configuration

Flags:
      --debug            Output debugging information
  -h, --help             help for rain
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
      --version          version for rain

Use "rain [command] --help" for more information about a command.
Example (Rm_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"rm",
	}

	cmd.Execute()
}
Output:

Deletes the CloudFormation stack named <stack> and waits for the action to complete.

Usage:
  rain rm <stack>

Aliases:
  rm, remove, del, delete

Flags:
  -d, --detach   Once removal has started, don't wait around for it to finish.
  -f, --force    Do not ask; just delete
  -h, --help     help for rm

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use
Example (Tree)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"tree",
		"../examples/success.template",
	}

	cmd.Execute()
}
Output:

Resources:
  Bucket1:
    DependsOn:
      Parameters:
        - BucketName
Example (Watch_help)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/cmd"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"help",
		"watch",
	}

	cmd.Execute()
}
Output:

Repeatedly displays the status of a CloudFormation stack. Useful for watching the progress of a deployment started from outside of Rain.

Usage:
  rain watch <stack>

Flags:
  -h, --help   help for watch

Global Flags:
      --debug            Output debugging information
  -p, --profile string   AWS profile name; read from the AWS CLI configuration file
  -r, --region string    AWS region to use

Index

Examples

Constants

This section is empty.

Variables

View Source
var Root = &cobra.Command{
	Use:     "rain",
	Long:    "Rain is what happens when you have a lot of CloudFormation ;)",
	Version: version.VERSION,
}

Root represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the Root.

Types

type Command added in v0.8.0

type Command struct {
	cobra.Command
}

Jump to

Keyboard shortcuts

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