pulumi README

The project's README from github.com/pulumi/pulumi. As one markdown file: README.md.

Pulumi

Slack GitHub Discussions NPM version Python version NuGet version GoDoc License

Infrastructure as Code for Humans and Agents

Pulumi Infrastructure as Code is the easiest way to build and deploy infrastructure, of any architecture and on any cloud, using programming languages that you already know and love. Code and ship infrastructure faster with your favorite languages and tools, and embed IaC anywhere with Automation API.

Simply write code in your favorite language and Pulumi automatically provisions and manages your resources on AWS, Azure, Google Cloud Platform, Kubernetes, and 300+ providers using an infrastructure-as-code approach. Skip the YAML, and use standard language features like loops, functions, classes, and package management that you already know and love.

For example, create three web servers:

import * as aws from "@pulumi/aws";

const ami = aws.ec2.getAmiOutput({
    mostRecent: true,
    owners: ["amazon"],
    filters: [{ name: "name", values: ["al2023-ami-*-x86_64"] }],
});

const sg = new aws.ec2.SecurityGroup("web-sg", {
    ingress: [{ protocol: "tcp", fromPort: 80, toPort: 80, cidrBlocks: ["0.0.0.0/0"] }],
});

for (const i of [0, 1, 2]) {
    new aws.ec2.Instance(`web-${i}`, {
        ami: ami.id,
        instanceType: "t3.micro",
        vpcSecurityGroupIds: [sg.id],
        userData: `#!/bin/bash
            echo "Hello, World!" > index.html
            nohup python3 -m http.server 80 &`,
    });
}

Or a simple serverless timer that archives Hacker News every day at 8:30AM:

import * as aws from "@pulumi/aws";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, PutCommand } from "@aws-sdk/lib-dynamodb";

const snapshots = new aws.dynamodb.Table("snapshots", {
    attributes: [{ name: "id", type: "S" }],
    hashKey: "id",
    billingMode: "PAY_PER_REQUEST",
});

aws.cloudwatch.onSchedule("daily-yc-snapshot", "cron(30 8 * * ? *)", async () => {
    const res = await fetch("https://news.ycombinator.com");
    const content = await res.text();

    const client = DynamoDBDocumentClient.from(new DynamoDBClient({}));
    await client.send(new PutCommand({
        TableName: snapshots.name.get(),
        Item: { id: `${Date.now()}`, content },
    }));
});

Many examples are available spanning containers, serverless, and infrastructure in pulumi/examples.

Pulumi is open source under the Apache 2.0 license, supports many languages and clouds, and is easy to extend. This repo contains the pulumi CLI, language SDKs, and core Pulumi engine, and individual libraries are in their own repos.

Welcome

Pulumi quickstart terminal

Getting Started

Watch the video

See the Get Started guide to quickly get started with Pulumi on your platform and cloud of choice.

Otherwise, the following steps demonstrate how to deploy your first Pulumi program, using AWS Serverless Lambdas, in minutes:

  1. Install:

    To install the latest Pulumi release, run the following (see full installation instructions for additional installation options):

    curl -fsSL https://get.pulumi.com/ | sh
    
  2. Create a Project:

    After installing, you can get started with the pulumi new command:

    mkdir pulumi-demo && cd pulumi-demo
    pulumi new serverless-aws-typescript
    

    The new command offers templates for all languages and clouds. Run it without an argument and it'll prompt you with available projects. This command creates an AWS Serverless Lambda project written in TypeScript.

  3. Deploy to the Cloud:

    Run pulumi up to get your code to the cloud:

    pulumi up
    

    This makes all cloud resources needed to run your code. Simply make edits to your project, and subsequent pulumi ups will compute the minimal diff to deploy your changes.

  4. Use Your Program:

    Now that your code is deployed, you can interact with it. In the above example, we can curl the endpoint:

    curl $(pulumi stack output url)
    
  5. Access the Logs:

    If you're using containers or functions, Pulumi's unified logging command will show all of your logs:

    pulumi logs -f
    
  6. Destroy your Resources:

    After you're done, you can remove all resources created by your program:

    pulumi destroy -y
    

To learn more, head over to pulumi.com for much more information, including tutorials, examples, and details of the core Pulumi CLI and programming model concepts.

Platform

Languages

Language Status Runtime Versions
JavaScript Stable Node.js Current, Active and Maintenance LTS versions
TypeScript Stable Node.js Current, Active and Maintenance LTS versions
Python Stable Python Supported versions
Go Stable Go Supported versions
.NET (C#/F#/VB.NET) Stable .NET Supported versions
Java Stable JDK 11+
YAML Stable n/a n/a

Clouds

Visit the Registry for the full list of supported cloud and infrastructure providers.

Contributing

Visit CONTRIBUTING.md for information on building Pulumi from source or contributing improvements.

pulumi (pulumi/pulumi)

Searching Database…

25.8K ·GitHub
Что это такое?Pulumi — это open source-инструмент для «инфраструктуры как код»: вы пишете обычный программный код, а Pulumi CLI сам создаёт и управляет вашими ресурсами в облаках.
Что именно в этом репозитории — CLI, библиотека или облачный сервис?В этом репозитории лежат CLI (pulumi), SDK для языков и ядро движка; библиотеки ресурсов для отдельных провайдеров хранятся в собственных репозиториях.
Как развернуть с ним свой первый проект?Установите CLI, выполните 'pulumi new' и выберите шаблон для своего языка и облака, затем 'pulumi up', чтобы создать ресурсы. Команда 'pulumi destroy' потом удаляет всё созданное.
На каких языках программирования я могу описывать инфраструктуру?JavaScript и TypeScript (Node.js LTS), Python, Go, .NET (C#, F#, VB.NET), Java на JDK 11+, а также YAML — всё помечено как стабильное.
Мне обязательно писать YAML-файлы с описанием инфраструктуры?Не обязательно — главная идея как раз обратная: вместо YAML использовать циклы, функции, классы и управление пакетами из вашего языка. Стабильный вариант на YAML тоже есть.
Он работает локально на моём компьютере или это облачный сервис?Он работает локально на любой платформе — CLI написан на Go, а в руководстве Get Started описана настройка под вашу платформу ещё до выбора облака.
Какие облака и провайдеры он поддерживает?AWS, Azure, Google Cloud, Kubernetes и более 300 провайдеров в сумме. В Registry есть полный список, и оттуда можно установить нужные пакеты ресурсов прямо в свой проект.
Если я потом поменяю код, придётся всё снести и развернуть заново?Нет — при повторных запусках 'pulumi up' вычисляется минимальный набор изменений для применения ваших правок, поэтому обновления применяются инкрементально.
Что такое Automation API?Это способ встроить движок IaC от Pulumi в свои приложения и инструменты, чтобы создание инфраструктуры стало обычным вызовом библиотеки в вашей программе, а не ручным шагом через CLI.
Как он обращается с секретами, например паролями от баз данных?Через Pulumi ESC — решение проекта для управления секретами, которое надёжно и централизованно хранит секреты и настройки для вашей облачной инфраструктуры и приложений.
Creator
pulumi
Size
385.9 MB
Stars
25.8K
Age
9y
Commits · 90 Days