Giter Club home page Giter Club logo

cookiecutter-terraform's Introduction

cookiecutter-terraform

GitHub Super-Linter

  1. Overview
  2. Usage
  3. Options

Overview

A cookiecutter Terraform template for Azure modules or projects. This is a templated content to instantiate new Azure Terraform content that saves having to go through constructing boilerplate content for new projects.

The output from this cookiecutter template has the following features (some optional) basically confgured:

This is opinionated and in fairly early stages of development

Usage

Install cookiecutter to do all the work.

First, get Cookiecutter and install other required libraries. Here is an example using a Python virtual environment in Linux:

mkdir ~/venvs
python3 -m venv ~/venvs/cookiecutter
source ~/venvs/cookiecutter/bin/activate
pip install pip setuptools --upgrade
pip install cookiecutter

Then run it against this repository:

cookiecutter https://github.com/tonyskidmore/cookiecutter-terraform

You'll be prompted for some values. Provide them, then a Terraform project will be created for you. See Options below for further details on what these values are.

Answer the prompts with your own options. For example, creating a Terraform Azure module for Machine Learning:

repo_name [repo_name]: terraform-azurerm-machine-learning
full_name [Your Name]: Tony Skidmore
github_username [Your GitHub username]: tonyskidmore
project_short_description [A short description of the project.]: Terraform module for Azure Machine Learning
Select license:
1 - BSD 2-Clause License
2 - BSD 3-Clause License
3 - MIT license
4 - ISC license
5 - Apache Software License 2.0
6 - GNU Lesser General Public License v3 or later (LGPLv3+)
7 - GNU Lesser General Public License v3 (LGPLv3)
8 - GNU Lesser General Public License v2.1 or later (LGPLv2+)
9 - GNU Lesser General Public License v2.1 (LGPLv2)
10 - no
Choose from 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [1]: 3
version [0.0.1]:
use_checkov [y]:
use_terrascan [y]: n
use_github [y]: y
year_from [2023]:
year_to [2023]:
devcontainer_certs []: 

Enter the project and take a look around:

cd terraform-azurerm-machine-learning/
ls

Create a git repository in GitHub and then push to it:

# git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:tonyskidmore/terraform-azurerm-machine-learning.git
git push -u origin main

Options

The table below provides further details on how the prompted values are used. These are configured in the cookiecutter.json file.

option description
repo_name The repository name will be used to create the output directory
full_name Your fullname e.g. Tony Skidmore
github_username Used in documentation e.g. tonyskidmore
project_short_description Used in the header of the generated README.md
license The type of license file to be created. no = no LICENSE file
version The starting version of the project, use in CHANGELOG
use_checkov Enable Bridgecrew Checkov functionality
use_terrascan Enable Tenable Terrascan functionality
use_github Whether the .github directory is created
year_from and year_to Used in the creation of the LICENSE file
devcontainer_certs Any certificates that should be copied to the devcontainer

Enterprise proxies, such as Zscaler, terminate and insert their own certificate chains into TLS traffic. This can cause certificate errors in applications, such as those used within a devcontainer. Specifying a path to a certificate file will cause the file to be copied to .devcontainer/certs in the created repo path and will subsequently get included in the generated docker container image.

For example enter ~/certs/zscaler.crt for that certificate to be included in the devcontainer image.

Note: ensure that the PEM encoded certificate file has a .crt extension for it be recognized correctly.

Development

To test against a development branch use:

cookiecutter https://github.com/tonyskidmore/cookiecutter-terraform --checkout feature_branch

cookiecutter-terraform's People

Contributors

tonyskidmore avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.