@goldstack/utils-terraform 0.4.53 → 0.4.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsTerraform.d.ts","sourceRoot":"","sources":["../../src/utilsTerraform.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAIpC,eAAO,MAAM,aAAa,QAAO,
|
|
1
|
+
{"version":3,"file":"utilsTerraform.d.ts","sourceRoot":"","sources":["../../src/utilsTerraform.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAIpC,eAAO,MAAM,aAAa,QAAO,GA8GhC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,EAAE,SAAS,gBAAgB,KAAG,IAmDxE,CAAC"}
|
|
@@ -14,14 +14,22 @@ const infraCommands = () => {
|
|
|
14
14
|
demandOption: true,
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
const ignoreMissingDeploymentsOption = (yargs) => {
|
|
18
|
+
return yargs.option('ignore-missing-deployments', {
|
|
19
|
+
description: 'If the deployment does not exist, show a warning instead of failing.',
|
|
20
|
+
default: false,
|
|
21
|
+
demandOption: false,
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
});
|
|
24
|
+
};
|
|
17
25
|
return (yargs) => {
|
|
18
26
|
return yargs
|
|
19
|
-
.command('up <deployment>', 'Stands up infrastructure for the specified deployment', deploymentPositional)
|
|
20
|
-
.command('init <deployment>', 'Initialises Terraform working directory for deployment', deploymentPositional)
|
|
21
|
-
.command('plan <deployment>', 'Creates a Terraform execution plan for deployment', deploymentPositional)
|
|
22
|
-
.command('apply <deployment>', 'Applies the last Terraform execution plan calculated using `infra plan`', deploymentPositional)
|
|
27
|
+
.command('up <deployment>', 'Stands up infrastructure for the specified deployment', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
28
|
+
.command('init <deployment>', 'Initialises Terraform working directory for deployment', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
29
|
+
.command('plan <deployment>', 'Creates a Terraform execution plan for deployment', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
30
|
+
.command('apply <deployment>', 'Applies the last Terraform execution plan calculated using `infra plan`', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
23
31
|
.command('destroy <deployment>', 'DANGER: Destroys all deployed infrastructure for the deployment', (yargs) => {
|
|
24
|
-
return deploymentPositional(yargs).option('yes', {
|
|
32
|
+
return deploymentPositional(ignoreMissingDeploymentsOption(yargs)).option('yes', {
|
|
25
33
|
alias: 'y',
|
|
26
34
|
description: 'DANGER: If provided, confirmation for deleting infrastructure resources will be skipped.',
|
|
27
35
|
default: false,
|
|
@@ -29,9 +37,9 @@ const infraCommands = () => {
|
|
|
29
37
|
type: 'boolean',
|
|
30
38
|
});
|
|
31
39
|
})
|
|
32
|
-
.command('is-up <deployment>', 'Checks whether infrastructure for a deployment is currently provisioned.', deploymentPositional)
|
|
40
|
+
.command('is-up <deployment>', 'Checks whether infrastructure for a deployment is currently provisioned.', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
33
41
|
.command('destroy-state <deployment>', 'DANGER: Destroys the remote state stored for this deployment.', (yargs) => {
|
|
34
|
-
return deploymentPositional(yargs).option('yes', {
|
|
42
|
+
return deploymentPositional(ignoreMissingDeploymentsOption(yargs)).option('yes', {
|
|
35
43
|
alias: 'y',
|
|
36
44
|
description: 'DANGER: If provided, confirmation for deleting remote state will be skipped.',
|
|
37
45
|
default: false,
|
|
@@ -39,16 +47,16 @@ const infraCommands = () => {
|
|
|
39
47
|
type: 'boolean',
|
|
40
48
|
});
|
|
41
49
|
})
|
|
42
|
-
.command('create-state <deployment>', 'Creates a remote state for this deployment if it does not already exist.', deploymentPositional)
|
|
50
|
+
.command('create-state <deployment>', 'Creates a remote state for this deployment if it does not already exist.', (yargs) => deploymentPositional(ignoreMissingDeploymentsOption(yargs)))
|
|
43
51
|
.command('upgrade <deployment> <targetVersion>', 'Upgrades Terraform version to a new target version (experimental)', (yargs) => {
|
|
44
|
-
return deploymentPositional(yargs).positional('targetVersion', {
|
|
52
|
+
return deploymentPositional(ignoreMissingDeploymentsOption(yargs)).positional('targetVersion', {
|
|
45
53
|
type: 'string',
|
|
46
54
|
description: 'Provides the target Terraform version that should be migrated to.',
|
|
47
55
|
demandOption: true,
|
|
48
56
|
});
|
|
49
57
|
})
|
|
50
58
|
.command('terraform <deployment> [command..]', 'Runs an arbitrary Terraform CLI command', (yargs) => {
|
|
51
|
-
return deploymentPositional(yargs)
|
|
59
|
+
return deploymentPositional(ignoreMissingDeploymentsOption(yargs))
|
|
52
60
|
.option('inject-variables', {
|
|
53
61
|
description: 'Injects variables into the Terraform CLI command.',
|
|
54
62
|
default: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsTerraform.js","sourceRoot":"","sources":["../../src/utilsTerraform.ts"],"names":[],"mappings":";;;AAUA,qDAAkD;AAElD,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA;AACnC,+CAAoC;AAA3B,kGAAA,EAAE,OAAA;AAIJ,MAAM,aAAa,GAAG,GAAQ,EAAE;IACrC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAa,EAAE;QAC3D,OAAO,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,0DAA0D;YACpE,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"utilsTerraform.js","sourceRoot":"","sources":["../../src/utilsTerraform.ts"],"names":[],"mappings":";;;AAUA,qDAAkD;AAElD,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA;AACnC,+CAAoC;AAA3B,kGAAA,EAAE,OAAA;AAIJ,MAAM,aAAa,GAAG,GAAQ,EAAE;IACrC,MAAM,oBAAoB,GAAG,CAAC,KAAgB,EAAa,EAAE;QAC3D,OAAO,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE;YACpC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,0DAA0D;YACpE,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,8BAA8B,GAAG,CAAC,KAAgB,EAAa,EAAE;QACrE,OAAO,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE;YAChD,WAAW,EAAE,sEAAsE;YACnF,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,KAAK;YACnB,IAAI,EAAE,SAAS;SAChB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CAAC,KAAgB,EAAa,EAAE;QACrC,OAAO,KAAK;aACT,OAAO,CACN,iBAAiB,EACjB,uDAAuD,EACvD,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,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1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-terraform",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.55",
|
|
4
4
|
"description": "Run Terraform commands easily as npm package scripts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@goldstack/infra": "0.4.28",
|
|
41
|
-
"@goldstack/infra-aws": "0.4.
|
|
41
|
+
"@goldstack/infra-aws": "0.4.43",
|
|
42
42
|
"@goldstack/utils-config": "0.4.28",
|
|
43
43
|
"@goldstack/utils-docker": "0.4.29",
|
|
44
44
|
"@goldstack/utils-log": "0.3.24",
|