terraform-generator

command module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

terraform-generator

CLI tool to generate terraform components

Usage

terraform-generator generate [component] [flags]

Components

The following components are currently managed :

  • module
  • variable
  • output
  • resource
  • data
  • configuration
Module
terraform-generator generate module --dir=modules --name=instance-configuration

This command will generate a modules/instance-configuration directory including the following files README.md, main.tf, outputs.tf, variables.tf and terraform.tf

Configuration
terraform-generator generate configuration --name=network --module=modules/instance-configuration

This command will generate a network.tf configuration file in the modules/instance-configuration directory.`,

Variable
terraform-generator generate variable --name=instance_name --type=string --module=modules/instance-configuration

This command will append a variable block with name instance_name and type string at the end of the modules/instance-configuration/variables.tf

Output
terraform-generator generate output --module=modules/instance-configuration --name=instance_ip_address --value=module.instance_configuration.ip

This command will append an output block with name instance_ip_address and value module.instance_configuration.ip at the end of the modules/instance-configuration/outputs.tf

Resource
terraform-generator generate resource --type=aws_s3_bucket --name=static_website_bucket --module=modules/instance-configuration --configuration=resources

This command will append a resource block of type "aws_s3_bucket" and name "static_website_bucket" at the end of the modules/instance-configuration/resources.tf

Data
terraform-generator generate resource --type=aws_s3_bucket --name=static_website_bucket --module=modules/instance-configuration --configuration=data

This command will append a data block of type "aws_s3_bucket" and name "static_website_bucket" at the end of the modules/instance-configuration/data.tf

Documentation

Overview

Copyright © 2021 Seb P sebpsdev@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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