GithubHelp home page GithubHelp logo

ptzagk / aiac Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gofireflyio/aiac

0.0 0.0 0.0 462 KB

Artificial Intelligence Infrastructure-as-Code Generator.

License: Apache License 2.0

Go 99.15% Dockerfile 0.85%

aiac's Introduction

AIAC AIAC

Artificial Intelligence Infrastructure-as-Code Generator.

demo

Description

aiac is a command line tool to generate IaC (Infrastructure as Code) templates, configurations, utilities, queries and more via OpenAI's API. The CLI allows you to ask the model to generate templates for different scenarios (e.g. "get terraform for AWS EC2"). It will make the request, and store the resulting code to a file, or simply print it to standard output.

Use Cases and Example Prompts

Generate IaC

  • aiac get terraform for a highly available eks
  • aiac get pulumi golang for an s3 with sns notification
  • aiac get cloudformation for a neptundb

Generate Configuration Files

  • aiac get dockerfile for a secured nginx
  • aiac get k8s manifest for a mongodb deployment

Generate CICD Pipelines

  • aiac get jenkins pipeline for building nodejs
  • aiac get github action that plans and applies terraform and sends a slack notification

Generate Policy as Code

  • aiac get opa policy that enforces readiness probe at k8s deployments

Generate Utilities

  • aiac get python code that scans all open ports in my network
  • aiac get bash script that kills all active terminal sessions

Command Line Builder

  • aiac get kubectl that gets ExternalIPs of all nodes
  • aiac get awscli that lists instances with public IP address and Name

Query Builder

  • aiac get mongo query that aggregates all documents by created date
  • aiac get elastic query that applies a condition on a value greater than some value in aggregation
  • aiac get sql query that counts the appearances of each row in one table in another table based on an id column

Quick Start

First, install aiac:

brew install gofireflyio/aiac/aiac

Or using docker:

docker pull ghcr.io/gofireflyio/aiac

Alternatively, clone the repository and build from source:

git clone https://github.com/gofireflyio/aiac.git
go build

Instructions

  1. Create your OpenAI API key here.
  2. Click “Create new secret key” and copy it.
  3. Provide the API key via the OPENAI_API_KEY environment variable or via the --api-key command line flag.

By default, aiac prints the extracted code to standard output and asks if it should save or re-generate the code

aiac get terraform for AWS EC2

To store the resulting code to a file:

aiac -o aws_ec2.tf get terraform for AWS EC2

To run using docker

docker run \
-it \
-e OPENAI_API_KEY=[PUT YOUR KEY HERE] \
ghcr.io/gofireflyio/aiac get terraform for ec2

Example Output

Command line prompt:

aiac get dockerfile for nodejs with comments

Output:

FROM node:latest

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "index.js" ]

Support Channels

We have two main channels for supporting AIaC:

  1. Slack community: general user support and engagement.
  2. GitHub Issues: bug reports and enhancement requests.

License

This code is published under the terms of the Apache License 2.0.

aiac's People

Contributors

eran-infralight avatar ido50 avatar liavyona avatar martigit 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.