Skip to content

Instantly share code, notes, and snippets.

const bucket = new aws.s3.Bucket("testbucket");
bucket.onObjectCreated("onFileUpload", async event => {
console.log("I am running inside AWS Lambda!");
for (const record of event.records) {
console.log(record.s3.object.key);
}
});
me@XYZ:~# pulumi up
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket("my-bucket");
// Export the name of the bucket
export const bucketName = bucket.id;
pulumi new aws-typescript
pulumi login --local
export AWS_ACCESS_KEY_ID="...."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..."
$curl -fsSL https://get.pulumi.com | sh
@BenjaminKlatt
BenjaminKlatt / integrationtest-only-pom.xml
Created February 14, 2021 10:06
Maven configuration to run integration tests only for integration test maven module
<!-- Integration Test Phase with failsafe -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<excludes>
<exclude>*</exclude>
</excludes>
</configuration>
@BenjaminKlatt
BenjaminKlatt / maven-failsafe.pom.xml
Created February 14, 2021 10:05
Maven Failsafe configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
@BenjaminKlatt
BenjaminKlatt / openapi-generator-pom.xml
Created February 14, 2021 10:03
OpenAPI Generator java client generation maven configuration
<!-- REST Client generation -->
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<goals><goal>generate</goal></goals>
<configuration>
<generatorName>java</generatorName> // (1)