Categorygithub.com/sebps/terraform-generator
modulepackage
0.0.2
Repository: https://github.com/sebps/terraform-generator.git
Documentation: pkg.go.dev

# 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

# Packages

Copyright © 2021 Seb P [email protected] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author