This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_hugo() { | |
local VERSION="$1" | |
local TARFILE="hugo_${VERSION}_darwin-universal.tar.gz" | |
local TEMP_DIR="${HOME}/Downloads/hugo_temp" | |
local DESTFILE="${TEMP_DIR}/$TARFILE" | |
mkdir -p "$TEMP_DIR" | |
curl -L -o "$DESTFILE" "https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${TARFILE}" && \ | |
tar -xzvf "$DESTFILE" -C "$TEMP_DIR" && \ | |
sudo mv "${TEMP_DIR}/hugo" "/usr/local/bin/" && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from some_module import make_bucket | |
# Call a function to make a bucket. | |
make_bucket() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tokens=( | |
aws:lambda/function:Function | |
aws:s3/bucket:Bucket | |
aws:iam/role:Role | |
aws:ec2/instance:Instance | |
aws:rds/instance:Instance | |
aws:ec2/securityGroup:SecurityGroup | |
aws:ec2/vpc:Vpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pnew() { | |
local project_template="$1" | |
local project_home="${HOME}/Projects/dev/pulumi" | |
local project_name="${1}-$(head -n 4096 /dev/urandom | openssl sha1 | awk "{print \$2}" | cut -c1-7)" | |
local project_dir="${project_home}/${project_name}" | |
mkdir -p "$project_dir" && cd "$project_dir" | |
pulumi new "$project_template" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ${PROJECT} | |
description: ${DESCRIPTION} | |
runtime: | |
name: nodejs | |
options: | |
typescript: false | |
template: | |
description: A minimal AWS JavaScript Pulumi program | |
important: true | |
config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2" | |
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ depth . | |
. | |
├ fmt | |
├ github.com/pulumi/pulumi-azure-native-sdk/resources | |
├ context | |
├ fmt | |
├ os | |
├ reflect | |
├ regexp | |
├ strconv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure project names and descriptions with values obtained from `pulumi new`. | |
name: ${PROJECT} | |
description: ${DESCRIPTION} | |
runtime: yaml | |
# Define the template's configuration settings. | |
template: | |
description: A simple static website on Amazon S3 | |
config: | |
aws:region: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as aws from "@pulumi/aws"; | |
import * as cloudflare from "@pulumi/cloudflare"; | |
const domain = "pulumibook.info"; | |
const subdomain = "my-awesome-website"; | |
// Make a bucket. | |
const bucket = new aws.s3.Bucket("my-bucket", { | |
bucket: `${subdomain}.${domain}`, | |
acl: aws.s3.CannedAcl.PublicRead, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as aws from "@pulumi/aws"; | |
const lambda = new aws.lambda.CallbackFunction("my-function", { | |
callback: () => { | |
console.log("Hello, world!"); | |
}, | |
}); | |
export const { id } = lambda; |
NewerOlder