Giter Club home page Giter Club logo

pulumi-ai's Introduction

Pulumi AI

Create cloud infrastructure with Pulumi Automation API โ˜๏ธ and OpenAI GPT ๐Ÿค–. Try out Pulumi AI online at https://pulumi.com/ai, or locally with npx pulumi-ai.

Note: This is an experimental AI experience for interactively building cloud infrastructure using GPT. It will likely do surprising and interesting things, and will make mistakes! You have the option to provide access to deploy infrastructure directly into your cloud account(s), which puts incredible power in the hands of the AI, be sure to use with approporiate caution.

Demo of Pulumi AI

Running

To use the CLI tool, you must configure the following:

  • Download and install pulumi.
  • Get an OpenAI API Key and make it available as OPENAI_API_KEY.
  • Login to Pulumi via pulumi login, or else by exporting a Pulumi Access Token as PULUMI_ACCESS_TOKEN.
  • Configure your cloud credentials for your target Cloud environment (AWS, Azure, Google Cloud, Kubernetes, etc.).

Note: The pulumi-ai CLI works best with AWS today, but can be used with any cloud.

Then run:

npx pulumi-ai

You can ask for any infrastructure you want, then use these commands to take actions outside of interacting with the AI:

  • !quit: Exit the AI and cleanup the temporary stack.
  • !program: See the Pulumi program that has been developed so far.
  • !stack: See details of the Pulumi stack that has been deployed so far.
  • !verbose: Turn verbose mode on for debugging interactions with GPT and Pulumi.
  • !open <output>: Open a URL from the given stack output name in the system browser.

The following environment variables are also available to configure the GPT AI used:

  • OPENAI_MODEL: Select one of the valid OpenAI Models, suchas as gpt-4 (default, and most accurate but slow) or gpt-3.5-turbo (not as accurate but much faster).
  • OPENAI_TEMPERATURE: Configure the temperature to tune the AI to be more predicatable (lower values) or more creative (higher values).

Examples

Welcome to Pulumi AI.

Your stack: https://app.pulumi.com/luke/pulumi-ai/dev/resources

What cloud infrastructure do you want to build today?

> An AWS VPC
create aws:ec2/vpc:Vpc my-vpc ...
created my-vpc
vpcCidrBlock: 10.0.0.0/16
vpcId: vpc-016f35c7f078ab9e8

> Add three private subnets
create aws:ec2/subnet:Subnet private-subnet-2-2 ...
create aws:ec2/subnet:Subnet private-subnet-1-1 ...
create aws:ec2/subnet:Subnet private-subnet-3-3 ...
created private-subnet-2-2
created private-subnet-3-3
created private-subnet-1-1
privateSubnetIds: subnet-08add1c8ae97e3cfb,subnet-0cb4ea675f7ac64fe,subnet-0f9a22c87e766fa17
vpcId: vpc-016f35c7f078ab9e8

> Remove one of the subnets
delete aws:ec2/subnet:Subnet private-subnet-3-3 ...
deleted private-subnet-3-3
privateSubnetIds: subnet-08add1c8ae97e3cfb,subnet-0cb4ea675f7ac64fe
vpcId: vpc-016f35c7f078ab9e8

>
Welcome to Pulumi AI.

Your stack: https://app.pulumi.com/luke-pulumi-corp/pulumi-ai/dev/resources

What cloud infrastructure do you want to build today?

> an s3 bucket
create aws:s3/bucket:Bucket my-bucket ...
created my-bucket
Stack Outputs:
  bucketName: my-bucket-cc63555

> add an index.html file that says "Hello, world!" in three languages
update aws:s3/bucket:Bucket my-bucket ...
updated my-bucket
create aws:s3/bucketObject:BucketObject index ...
created index
Stack Outputs:
  bucketName: my-bucket-cc63555

> give me a url for that index.html file
update aws:s3/bucket:Bucket my-bucket ...
updated my-bucket
create aws:s3/bucketPolicy:BucketPolicy bucketPolicy ...
created bucketPolicy
Stack Outputs:
  bucketName: my-bucket-cc63555
  indexUrl: http://undefined/index.html

> That gave an undefined url.  Can you fix it?
update aws:s3/bucket:Bucket my-bucket ...
updated my-bucket
Stack Outputs:
  bucketName: my-bucket-cc63555
  indexUrl: http://my-bucket-cc63555.s3-website-us-west-2.amazonaws.com/index.html

> Great - that worked!  Now make it fancier, and add some color :-)
update aws:s3/bucket:Bucket my-bucket ...
updated my-bucket
update aws:s3/bucketObject:BucketObject index ...
updated index
Stack Outputs:
  bucketName: my-bucket-cc63555
  indexUrl: http://my-bucket-cc63555.s3-website-us-west-2.amazonaws.com/index.html

> !program
<snip>

> !quit

pulumi-ai's People

Contributors

lukehoban avatar dependabot[bot] 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.