-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check file exists * terraform examples * fix initial file creation
- Loading branch information
Showing
17 changed files
with
197,206 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
parampiper | ||
.terraform | ||
.terraform.lock.hcl | ||
terraform.tfstate | ||
terraform.tfstate.backup | ||
pp.auto.tfvars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
outCmd.Flags().StringVarP(&outputType, "output", "o", "", "Output type: raw, json, yaml, table") | ||
rootCmd.AddCommand(outCmd) | ||
} | ||
|
||
var outCmd = &cobra.Command{ | ||
Use: "out", | ||
Aliases: []string{"out"}, | ||
Short: "Output Parameters", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
var tmpl string | ||
log.Println("[DEBUG] Output Parameters") | ||
|
||
parameters, err := provider.Read() | ||
if err != nil { | ||
log.Println(err) | ||
} | ||
|
||
log.Println("[DEBUG]", parameters) | ||
switch outputType { | ||
case "tfvars": | ||
tmpl = "{{range .}}{{.Name}} = \"{{.Value}}\"\n{{end}}" | ||
default: | ||
tmpl = "NAME\tVALUE\tINFO\n{{range .}}{{.Name}}\t{{.Value}}\t{{.Info}}\n{{end}}" | ||
} | ||
|
||
TabWriter(parameters, tmpl) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
resource "azurerm_resource_group" "example" { | ||
name = var.resource_group_name | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_virtual_network" "example" { | ||
name = "example-vnet" | ||
address_space = ["10.0.0.0/16"] | ||
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
output "vnet_id" { | ||
value = azurerm_virtual_network.example.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resource_group_name = "rg-pp-tf-example" | ||
location = "westeurope" |
Oops, something went wrong.