
Modern Infrastructure as Code
“Declare cloud infrastructure using real languages.” pulumi.com
- Développé depuis fin 2016
- Dévoilé au public en 2018
- Open source - https://github.com/pulumi
- Pulumi 1.0 - 05/09/2019


Joe Duffy & Eric Rudder
Pourquoi ce talk ?
“Declare cloud infrastructure using real languages.” pulumi.com
Joe Duffy & Eric Rudder
const res = new Resource(name, args, options)
const server = new aws.ec2.Instance("web-server", {
ami: "ami-5189a661",
instanceType: "t2.micro",
...
});
Magic Functions
resource "google_storage_bucket" "test" {
name = "test"
}
// Create a GCS Bucket containing the zip archive which contains the function.
resource "google_storage_bucket" "hello_function" {
name = "hello-function"
}
// The archive object which contains the function.
resource "google_storage_bucket_object" "archive" {
name = "index.zip"
bucket = "${google_storage_bucket.bucket_hello_function.name}"
source = "./app"
}
// The function
resource "google_cloudfunctions_function" "hello_function" {
name = "hello"
runtime = "nodejs10"
source_archive_bucket = "${google_storage_bucket.hello_function.name}"
source_archive_object = "${google_storage_bucket_object.archive.name}"
event_trigger {
event_type = "google.storage.object.finalize"
resource = "${google_storage_bucket.test.name}"
}
}
const hello = require('./app');
const testBucket = new gcp.storage.Bucket("bucket", {
});
// Cloud Function
testBucket.onObjectFinalized("hello", hello);
Et les tests ?
Merci