mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(examples/pulumi): add example for multi-part cloud-init
This commit is contained in:
14
examples/cloud-init/aws.ssm.yaml
Normal file
14
examples/cloud-init/aws.ssm.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
#cloud-config
|
||||
|
||||
# Install and enable the SSM agent on supported instances.
|
||||
|
||||
# Tested on:
|
||||
# - Amazon Linux 2023.4.20240416
|
||||
|
||||
package_upgrade: false
|
||||
packages:
|
||||
- amazon-ssm-agent
|
||||
|
||||
runcmd:
|
||||
- systemctl daemon-reload
|
||||
- systemctl enable --now 'amazon-ssm-agent.service'
|
||||
1
examples/pulumi/multi-part cloud-init/.env
Normal file
1
examples/pulumi/multi-part cloud-init/.env
Normal file
@@ -0,0 +1 @@
|
||||
PULUMI_CONFIG_PASSPHRASE=test123
|
||||
3
examples/pulumi/multi-part cloud-init/.gitignore
vendored
Normal file
3
examples/pulumi/multi-part cloud-init/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/bin/
|
||||
/node_modules/
|
||||
/package-lock.json
|
||||
7
examples/pulumi/multi-part cloud-init/Pulumi.all.yaml
Normal file
7
examples/pulumi/multi-part cloud-init/Pulumi.all.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
encryptionsalt: v1:Tl2L4ymfbTk=:v1:PNPJ5bUKKgCFe8G/:hrgipeFmFMPSAYcf5lgS6dUCe33WtA==
|
||||
config:
|
||||
aws:defaultTags:
|
||||
tags:
|
||||
ManagedBy: pulumi
|
||||
PulumiProject: cloud-init.multi-part
|
||||
aws:region: eu-west-1
|
||||
9
examples/pulumi/multi-part cloud-init/Pulumi.yaml
Normal file
9
examples/pulumi/multi-part cloud-init/Pulumi.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
name: cloud-init.multi-part
|
||||
runtime: nodejs
|
||||
description: Simple example of multi-part cloud-init usage
|
||||
config:
|
||||
pulumi:tags:
|
||||
value:
|
||||
pulumi:template: typescript
|
||||
backend:
|
||||
url: file://.
|
||||
23
examples/pulumi/multi-part cloud-init/index.ts
Normal file
23
examples/pulumi/multi-part cloud-init/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as cloudinit from "@pulumi/cloudinit";
|
||||
import * as fs from 'fs';
|
||||
|
||||
export const userData = new cloudinit.Config(
|
||||
"userData",
|
||||
{
|
||||
gzip: false,
|
||||
base64Encode: false,
|
||||
parts: [
|
||||
{
|
||||
contentType: "text/cloud-config",
|
||||
content: fs.readFileSync("../../cloud-init/aws.ssm.yaml", "utf8"),
|
||||
filename: "cloud-config.ssm.yml",
|
||||
},
|
||||
{
|
||||
contentType: "text/cloud-config",
|
||||
content: fs.readFileSync("../../cloud-init/docker.yum.yaml", "utf8"),
|
||||
filename: "cloud-config.docker.yml",
|
||||
mergeType: "dict(recurse_array,no_replace)+list(append)",
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
11
examples/pulumi/multi-part cloud-init/package.json
Normal file
11
examples/pulumi/multi-part cloud-init/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "cloud-init.multi-part",
|
||||
"main": "index.ts",
|
||||
"devDependencies": {
|
||||
"@types/node": "^18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pulumi/cloudinit": "^1.4.1",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
18
examples/pulumi/multi-part cloud-init/tsconfig.json
Normal file
18
examples/pulumi/multi-part cloud-init/tsconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"outDir": "bin",
|
||||
"target": "es2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"experimentalDecorators": true,
|
||||
"pretty": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitReturns": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user