terraspace 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/aws/bin/build.sh +2 -0
- data/.cody/azurerm/bin/build.sh +2 -0
- data/.cody/google/bin/build.sh +2 -0
- data/CHANGELOG.md +10 -0
- data/lib/terraspace.rb +1 -0
- data/lib/terraspace/all/summary.rb +21 -1
- data/lib/terraspace/cli.rb +25 -25
- data/lib/terraspace/cli/all.rb +9 -9
- data/lib/terraspace/cli/cloud.rb +3 -9
- data/lib/terraspace/cli/cloud/runs.rb +0 -2
- data/lib/terraspace/cli/help/all/down.md +32 -0
- data/lib/terraspace/cli/help/all/graph.md +21 -0
- data/lib/terraspace/cli/help/all/output.md +22 -0
- data/lib/terraspace/cli/help/all/plan.md +25 -0
- data/lib/terraspace/cli/help/all/providers.md +21 -0
- data/lib/terraspace/cli/help/all/refresh.md +17 -0
- data/lib/terraspace/cli/help/all/show.md +21 -0
- data/lib/terraspace/cli/help/all/up.md +27 -0
- data/lib/terraspace/cli/help/all/validate.md +21 -0
- data/lib/terraspace/cli/help/build.md +6 -0
- data/lib/terraspace/cli/help/bundle.md +9 -5
- data/lib/terraspace/cli/help/check_setup.md +9 -0
- data/lib/terraspace/cli/help/clean.md +5 -0
- data/lib/terraspace/cli/help/cloud/destroy.md +16 -0
- data/lib/terraspace/cli/help/cloud/list.md +7 -0
- data/lib/terraspace/cli/help/cloud/runs/list.md +3 -3
- data/lib/terraspace/cli/help/cloud/runs/prune.md +1 -1
- data/lib/terraspace/cli/help/cloud/sync.md +26 -2
- data/lib/terraspace/cli/help/console.md +8 -0
- data/lib/terraspace/cli/help/down.md +26 -0
- data/lib/terraspace/cli/help/info.md +43 -0
- data/lib/terraspace/cli/help/init.md +37 -0
- data/lib/terraspace/cli/help/list.md +20 -0
- data/lib/terraspace/cli/help/log.md +2 -0
- data/lib/terraspace/cli/help/logs/remove.md +5 -0
- data/lib/terraspace/cli/help/logs/truncate.md +5 -0
- data/lib/terraspace/cli/help/new/bootstrap_test.md +8 -0
- data/lib/terraspace/cli/help/new/example.md +8 -0
- data/lib/terraspace/cli/help/new/git_hook.md +6 -0
- data/lib/terraspace/cli/help/new/module.md +9 -0
- data/lib/terraspace/cli/help/new/module_test.md +12 -0
- data/lib/terraspace/cli/help/new/plugin.md +49 -0
- data/lib/terraspace/cli/help/new/project.md +40 -0
- data/lib/terraspace/cli/help/new/project_test.md +8 -0
- data/lib/terraspace/cli/help/new/shim.md +21 -0
- data/lib/terraspace/cli/help/new/stack.md +9 -0
- data/lib/terraspace/cli/help/output.md +6 -0
- data/lib/terraspace/cli/help/plan.md +29 -0
- data/lib/terraspace/cli/help/providers.md +18 -0
- data/lib/terraspace/cli/help/refresh.md +11 -0
- data/lib/terraspace/cli/help/seed.md +7 -0
- data/lib/terraspace/cli/help/show.md +36 -0
- data/lib/terraspace/cli/help/summary.md +11 -0
- data/lib/terraspace/cli/help/test.md +35 -0
- data/lib/terraspace/cli/help/up.md +30 -0
- data/lib/terraspace/cli/help/validate.md +9 -0
- data/lib/terraspace/cli/info.rb +4 -16
- data/lib/terraspace/cli/logs.rb +1 -1
- data/lib/terraspace/cli/new.rb +18 -18
- data/lib/terraspace/cli/new/git_hook.rb +4 -1
- data/lib/terraspace/cli/new/project.rb +1 -1
- data/lib/terraspace/cli/summary.rb +2 -2
- data/lib/terraspace/command.rb +1 -1
- data/lib/terraspace/dependency/graph.rb +2 -1
- data/lib/terraspace/plugin/summary/interface.rb +1 -1
- data/lib/terraspace/shell.rb +14 -4
- data/lib/terraspace/terraform/cloud/runs/lister.rb +0 -2
- data/lib/terraspace/terraform/cloud/syncer.rb +2 -2
- data/lib/terraspace/terraform/cloud/workspace.rb +0 -9
- data/lib/terraspace/version.rb +1 -1
- data/spec/terraspace/all/summary_spec.rb +1 -1
- metadata +43 -3
- data/lib/terraspace/cli/help/update.md +0 -5
@@ -0,0 +1,25 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all plan
|
4
|
+
Running:
|
5
|
+
terraspace plan c1 # batch 1
|
6
|
+
terraspace plan b1 # batch 2
|
7
|
+
terraspace plan b2 # batch 2
|
8
|
+
terraspace plan a1 # batch 3
|
9
|
+
Batch Run 1:
|
10
|
+
Running: terraspace plan c1 Logs: log/plan/c1.log
|
11
|
+
terraspace plan c1: Plan: 1 to add, 0 to change, 0 to destroy.
|
12
|
+
terraspace plan c1: Changes to Outputs:
|
13
|
+
Batch Run 2:
|
14
|
+
Running: terraspace plan b1 Logs: log/plan/b1.log
|
15
|
+
Running: terraspace plan b2 Logs: log/plan/b2.log
|
16
|
+
terraspace plan b1: Plan: 2 to add, 0 to change, 0 to destroy.
|
17
|
+
terraspace plan b1: Changes to Outputs:
|
18
|
+
terraspace plan b2: Plan: 1 to add, 0 to change, 0 to destroy.
|
19
|
+
terraspace plan b2: Changes to Outputs:
|
20
|
+
Batch Run 3:
|
21
|
+
Running: terraspace plan a1 Logs: log/plan/a1.log
|
22
|
+
terraspace plan a1: Plan: 2 to add, 0 to change, 0 to destroy.
|
23
|
+
terraspace plan a1: Changes to Outputs:
|
24
|
+
Time took: 11s
|
25
|
+
$
|
@@ -0,0 +1,21 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all providers
|
4
|
+
Running:
|
5
|
+
terraspace providers c1 # batch 1
|
6
|
+
terraspace providers b1 # batch 2
|
7
|
+
terraspace providers b2 # batch 2
|
8
|
+
terraspace providers a1 # batch 3
|
9
|
+
Batch Run 1:
|
10
|
+
Running: terraspace providers c1 Logs: log/providers/c1.log
|
11
|
+
terraspace providers c1: └── provider[registry.terraform.io/hashicorp/random]
|
12
|
+
Batch Run 2:
|
13
|
+
Running: terraspace providers b1 Logs: log/providers/b1.log
|
14
|
+
Running: terraspace providers b2 Logs: log/providers/b2.log
|
15
|
+
terraspace providers b1: └── provider[registry.terraform.io/hashicorp/random]
|
16
|
+
terraspace providers b2: └── provider[registry.terraform.io/hashicorp/random]
|
17
|
+
Batch Run 3:
|
18
|
+
Running: terraspace providers a1 Logs: log/providers/a1.log
|
19
|
+
terraspace providers a1: └── provider[registry.terraform.io/hashicorp/random]
|
20
|
+
Time took: 9s
|
21
|
+
$
|
@@ -0,0 +1,17 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all refresh
|
4
|
+
Running:
|
5
|
+
terraspace refresh c1 # batch 1
|
6
|
+
terraspace refresh b1 # batch 2
|
7
|
+
terraspace refresh b2 # batch 2
|
8
|
+
terraspace refresh a1 # batch 3
|
9
|
+
Batch Run 1:
|
10
|
+
Running: terraspace refresh c1 Logs: log/refresh/c1.log
|
11
|
+
Batch Run 2:
|
12
|
+
Running: terraspace refresh b1 Logs: log/refresh/b1.log
|
13
|
+
Running: terraspace refresh b2 Logs: log/refresh/b2.log
|
14
|
+
Batch Run 3:
|
15
|
+
Running: terraspace refresh a1 Logs: log/refresh/a1.log
|
16
|
+
Time took: 11s
|
17
|
+
$
|
@@ -0,0 +1,21 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all show
|
4
|
+
Running:
|
5
|
+
terraspace show c1 # batch 1
|
6
|
+
terraspace show b1 # batch 2
|
7
|
+
terraspace show b2 # batch 2
|
8
|
+
terraspace show a1 # batch 3
|
9
|
+
Batch Run 1:
|
10
|
+
Running: terraspace show c1 Logs: log/show/c1.log
|
11
|
+
terraspace show c1: Resources: 0 Outputs: 1
|
12
|
+
Batch Run 2:
|
13
|
+
Running: terraspace show b1 Logs: log/show/b1.log
|
14
|
+
Running: terraspace show b2 Logs: log/show/b2.log
|
15
|
+
terraspace show b1: Resources: 0 Outputs: 2
|
16
|
+
terraspace show b2: Resources: 0 Outputs: 1
|
17
|
+
Batch Run 3:
|
18
|
+
Running: terraspace show a1 Logs: log/show/a1.log
|
19
|
+
terraspace show a1: Resources: 0 Outputs: 0
|
20
|
+
Time took: 12s
|
21
|
+
$
|
@@ -0,0 +1,27 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all up
|
4
|
+
Will run:
|
5
|
+
terraspace up c1 # batch 1
|
6
|
+
terraspace up b1 # batch 2
|
7
|
+
terraspace up b2 # batch 2
|
8
|
+
terraspace up a1 # batch 3
|
9
|
+
Are you sure? (y/N)
|
10
|
+
|
11
|
+
Once you confirm, Terraspace deploys the batches in parallel. Essentially, Terraspace handles the orchestration.
|
12
|
+
|
13
|
+
Are you sure? (y/N) y
|
14
|
+
Batch Run 1:
|
15
|
+
Running: terraspace up c1 Logs: log/up/c1.log
|
16
|
+
terraspace up c1: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
|
17
|
+
Batch Run 2:
|
18
|
+
Running: terraspace up b1 Logs: log/up/b1.log
|
19
|
+
Running: terraspace up b2 Logs: log/up/b2.log
|
20
|
+
terraspace up b1: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
|
21
|
+
terraspace up b2: Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
|
22
|
+
Batch Run 3:
|
23
|
+
Running: terraspace up a1 Logs: log/up/a1.log
|
24
|
+
terraspace up a1: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
|
25
|
+
Time took: 25s
|
26
|
+
|
27
|
+
Terraspace provides a reduced-noise summary of the runs. The full logs are also written for further inspection and debugging. The [terraspace log](https://terraspace.cloud/reference/terraspace-log/) command is useful for viewing the logs.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace all validate
|
4
|
+
Running:
|
5
|
+
terraspace validate c1 # batch 1
|
6
|
+
terraspace validate b1 # batch 2
|
7
|
+
terraspace validate b2 # batch 2
|
8
|
+
terraspace validate a1 # batch 3
|
9
|
+
Batch Run 1:
|
10
|
+
Running: terraspace validate c1 Logs: log/validate/c1.log
|
11
|
+
terraspace validate c1: Success! The configuration is valid.
|
12
|
+
Batch Run 2:
|
13
|
+
Running: terraspace validate b1 Logs: log/validate/b1.log
|
14
|
+
Running: terraspace validate b2 Logs: log/validate/b2.log
|
15
|
+
terraspace validate b1: Success! The configuration is valid.
|
16
|
+
terraspace validate b2: Success! The configuration is valid.
|
17
|
+
Batch Run 3:
|
18
|
+
Running: terraspace validate a1 Logs: log/validate/a1.log
|
19
|
+
terraspace validate a1: Success! The configuration is valid.
|
20
|
+
Time took: 13s
|
21
|
+
$
|
@@ -4,11 +4,15 @@
|
|
4
4
|
|
5
5
|
## More commands
|
6
6
|
|
7
|
-
terraspace bundle install
|
8
|
-
terraspace bundle update
|
9
|
-
terraspace bundle
|
7
|
+
terraspace bundle install # same as bundle
|
8
|
+
terraspace bundle update # Updates Terrafile.lock
|
9
|
+
terraspace bundle purge_cache # removes /tmp terraspace bundler folder
|
10
10
|
|
11
11
|
## Update a single module
|
12
12
|
|
13
|
-
terraspace bundle update
|
14
|
-
terraspace bundle update demo
|
13
|
+
terraspace bundle update MODULE
|
14
|
+
terraspace bundle update demo
|
15
|
+
|
16
|
+
## Info on a module
|
17
|
+
|
18
|
+
terraspace bundle info MODULE
|
@@ -0,0 +1,16 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace cloud destroy demo
|
4
|
+
You are about to delete the workspace: demo-dev-us-west-2
|
5
|
+
All variables, settings, run history, and state history will be removed.
|
6
|
+
This cannot be undone.
|
7
|
+
|
8
|
+
This will NOT remove any infrastructure managed by this workspace.
|
9
|
+
If needed, destroy the infrastructure prior to deleting the workspace with:
|
10
|
+
|
11
|
+
terraspace down demo
|
12
|
+
|
13
|
+
This will delete the workspace: demo-dev-us-west-2.
|
14
|
+
Are you sure? (y/N) y
|
15
|
+
Destroying workspace demo-dev-us-west-2
|
16
|
+
$
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Statuses of pending and planned are shown by default.
|
4
4
|
|
5
|
-
$ terraspace cloud runs list
|
5
|
+
$ terraspace cloud runs list demo
|
6
6
|
+----------------------+---------+---------------------------------+---------------------+
|
7
7
|
| Id | Status | Message | Created At |
|
8
8
|
+----------------------+---------+---------------------------------+---------------------+
|
@@ -13,7 +13,7 @@ Statuses of pending and planned are shown by default.
|
|
13
13
|
|
14
14
|
To see all most recent runs, use `--status all`.
|
15
15
|
|
16
|
-
$ terraspace cloud runs list
|
16
|
+
$ terraspace cloud runs list demo --status all
|
17
17
|
+----------------------+-----------+--------------------------------+---------------------+
|
18
18
|
| Id | Status | Message | Created At |
|
19
19
|
+----------------------+-----------+--------------------------------+---------------------+
|
@@ -26,7 +26,7 @@ To see all most recent runs, use `--status all`.
|
|
26
26
|
|
27
27
|
You can provide a list of statuses to the `--status` filter option.
|
28
28
|
|
29
|
-
$ terraspace cloud runs list
|
29
|
+
$ terraspace cloud runs list demo --status canceled discarded
|
30
30
|
+----------------------+-----------+--------------------------------+---------------------+
|
31
31
|
| Id | Status | Message | Created At |
|
32
32
|
+----------------------+-----------+--------------------------------+---------------------+
|
@@ -1,4 +1,6 @@
|
|
1
|
-
##
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
Sync all stacks:
|
2
4
|
|
3
5
|
$ terraspace cloud sync
|
4
6
|
About to sync these project stacks with Terraform Cloud workspaces:
|
@@ -16,4 +18,26 @@
|
|
16
18
|
Are you sure? (y/N) y
|
17
19
|
Syncing to Terraform Cloud: demo => demo-dev-us-west-2
|
18
20
|
Syncing to Terraform Cloud: demo2 => demo2-dev-us-west-2
|
19
|
-
$
|
21
|
+
$
|
22
|
+
|
23
|
+
Sync specific stacks:
|
24
|
+
|
25
|
+
$ terraspace cloud sync demo
|
26
|
+
About to sync these project stacks with Terraform Cloud workspaces:
|
27
|
+
|
28
|
+
Stack => Workspace
|
29
|
+
demo => demo-dev-us-west-2
|
30
|
+
|
31
|
+
A sync does the following for each workspace:
|
32
|
+
|
33
|
+
1. Create or update workspace, including the VCS settings.
|
34
|
+
2. Set the working dir.
|
35
|
+
3. Set env and terraform variables.
|
36
|
+
|
37
|
+
Are you sure? (y/N) y
|
38
|
+
Syncing to Terraform Cloud: demo => demo-dev-us-west-2
|
39
|
+
$
|
40
|
+
|
41
|
+
Can also specify multiple stacks:
|
42
|
+
|
43
|
+
terraspace cloud sync demo demo2
|
@@ -0,0 +1,26 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace down demo
|
4
|
+
Building .terraspace-cache/us-west-2/dev/stacks/demo
|
5
|
+
Built in .terraspace-cache/us-west-2/dev/stacks/demo
|
6
|
+
Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
|
7
|
+
=> terraform destroy
|
8
|
+
# ...
|
9
|
+
Plan: 0 to add, 0 to change, 2 to destroy.
|
10
|
+
|
11
|
+
Changes to Outputs:
|
12
|
+
- bucket_name = "bucket-trusty-marmoset" -> null
|
13
|
+
|
14
|
+
Do you really want to destroy all resources?
|
15
|
+
Terraform will destroy all your managed infrastructure, as shown above.
|
16
|
+
There is no undo. Only 'yes' will be accepted to confirm.
|
17
|
+
Enter a value: yes
|
18
|
+
|
19
|
+
module.bucket.aws_s3_bucket.this: Destroying... [id=bucket-trusty-marmoset]
|
20
|
+
module.bucket.aws_s3_bucket.this: Destruction complete after 0s
|
21
|
+
random_pet.this: Destroying... [id=trusty-marmoset]
|
22
|
+
random_pet.this: Destruction complete after 0s
|
23
|
+
|
24
|
+
Destroy complete! Resources: 2 destroyed.
|
25
|
+
Time took: 21s
|
26
|
+
$
|
@@ -0,0 +1,43 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ terraspace info demo
|
4
|
+
+-----------+---------------------------------------------+
|
5
|
+
| Name | Value |
|
6
|
+
+-----------+---------------------------------------------+
|
7
|
+
| build_dir | stacks/demo |
|
8
|
+
| cache_dir | .terraspace-cache/us-west-2/dev/stacks/demo |
|
9
|
+
| name | demo |
|
10
|
+
| root | app/stacks/demo |
|
11
|
+
| type | stack |
|
12
|
+
| type_dir | stacks |
|
13
|
+
+-----------+---------------------------------------------+
|
14
|
+
|
15
|
+
You can also format the output in json:
|
16
|
+
|
17
|
+
$ terraspace info demo --format json
|
18
|
+
[
|
19
|
+
{
|
20
|
+
"Name": "build_dir",
|
21
|
+
"Value": "stacks/demo"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"Name": "cache_dir",
|
25
|
+
"Value": ".terraspace-cache/us-west-2/dev/stacks/demo"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"Name": "name",
|
29
|
+
"Value": "demo"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"Name": "root",
|
33
|
+
"Value": "app/stacks/demo"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"Name": "type",
|
37
|
+
"Value": "stack"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"Name": "type_dir",
|
41
|
+
"Value": "stacks"
|
42
|
+
}
|
43
|
+
]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Typically, Terrasapce auto init should handle initialization. You can run init if you need to though.
|
2
|
+
|
3
|
+
## Example
|
4
|
+
|
5
|
+
$ terraspace init demo
|
6
|
+
Building .terraspace-cache/us-west-2/dev/stacks/demo
|
7
|
+
Built in .terraspace-cache/us-west-2/dev/stacks/demo
|
8
|
+
Current directory: .terraspace-cache/us-west-2/dev/stacks/demo
|
9
|
+
=> terraform init -get
|
10
|
+
Initializing modules...
|
11
|
+
|
12
|
+
Initializing the backend...
|
13
|
+
|
14
|
+
Initializing provider plugins...
|
15
|
+
- Using previously-installed hashicorp/aws v3.7.0
|
16
|
+
- Using previously-installed hashicorp/random v2.3.0
|
17
|
+
|
18
|
+
The following providers do not have any version constraints in configuration,
|
19
|
+
so the latest version was installed.
|
20
|
+
|
21
|
+
To prevent automatic upgrades to new major versions that may contain breaking
|
22
|
+
changes, we recommend adding version constraints in a required_providers block
|
23
|
+
in your configuration, with the constraint strings suggested below.
|
24
|
+
|
25
|
+
* hashicorp/aws: version = "~> 3.7.0"
|
26
|
+
* hashicorp/random: version = "~> 2.3.0"
|
27
|
+
|
28
|
+
Terraform has been successfully initialized!
|
29
|
+
|
30
|
+
You may now begin working with Terraform. Try running "terraform plan" to see
|
31
|
+
any changes that are required for your infrastructure. All Terraform commands
|
32
|
+
should now work.
|
33
|
+
|
34
|
+
If you ever set or change modules or backend configuration for Terraform,
|
35
|
+
rerun this command to reinitialize your working directory. If you forget, other
|
36
|
+
commands will detect it and remind you to do so if necessary.
|
37
|
+
$
|
@@ -0,0 +1,20 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
List both modules and stacks.
|
4
|
+
|
5
|
+
$ terraspace list
|
6
|
+
app/modules/example
|
7
|
+
app/stacks/demo
|
8
|
+
$
|
9
|
+
|
10
|
+
List only stacks.
|
11
|
+
|
12
|
+
$ terraspace list -t stack
|
13
|
+
app/stacks/demo
|
14
|
+
$
|
15
|
+
|
16
|
+
List only modules.
|
17
|
+
|
18
|
+
$ terraspace list -t module
|
19
|
+
app/modules/example
|
20
|
+
$
|