Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(do/droplet): add support for packages #39

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions generators/do-droplet/templates/do-droplet/Pulumi.stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ config:
# <%= projectName %>:blockVolumeStack: <%= prefix %>-do-resources
<%= projectName %>:image: ubuntu-24-10-x64
<%= projectName %>:name: <%= prefix %>-<%= environment %>
# <%= projectName %>:packages:
# - PACKAGE1
# - PACKAGE2
<%= projectName %>:pathToSshKeysFolder: "../../ssh-keys"
# <%= projectName %>:projectId: DO PROJECT ID
# <%= projectName %>:projectStack: <%= prefix %>-do-resources
Expand Down
2 changes: 2 additions & 0 deletions generators/do-droplet/templates/do-droplet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ If none are defined, then root access will be password-based.
| blockVolumeStack | string | | Name of the Pulumi project in which the block volume was provisioned |
| image | string | `ubuntu-24-10-x64` | DO dropletimage |
| name | string | `{stack}` | DO droplet name |
| packages | string[] | | Packages to install on the droplet |
| pathToSshKeysFolder | string | `../../ssh-keys` | Path to folder containing public key files |
| projectId | string | | Id of the DigitalOcean project to which the droplet is associated |
| projectStack | string | | Name of the Pulumi project where the DigitalOcean project was provisioned |
Expand All @@ -170,6 +171,7 @@ If none are defined, then root access will be password-based.
| sshKeyNames | string[] | | Names of DigitalOcean SSH keys associated with the root user |
| swapFile | string | | Path to the swap file |
| swapSize | number | | Size of the swap file |
| userDataTemplate | string | `./cloud-config.njx` | Path to user data template |
| userGroups | comma-separated strings | | Groups to which the user belongs |
| username | string | | Name of the user to create in the droplet |
| vpcId | string | | Id of the DigitalOcean VPC to which the droplet is associated |
Expand Down
3 changes: 3 additions & 0 deletions generators/do-droplet/templates/do-droplet/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const getConfig = async () => {
const stack = getStack();
const stackConfig = new Config();

const packages = stackConfig.getObject<string[]>("packages") || [];

const pathToSshKeysFolder = stackConfig.get("pathToSshKeysFolder") || "../../ssh-keys";

const publicKeyNames = stackConfig.requireObject("publicKeyNames") as string[];
Expand Down Expand Up @@ -74,6 +76,7 @@ export const getConfig = async () => {
return {
image: stackConfig.require("image"),
name: stackConfig.get("name") || stack,
packages,
pathToSshKeysFolder,
projectId,
protect: stackConfig.getBoolean("protect"),
Expand Down
1 change: 1 addition & 0 deletions generators/do-droplet/templates/do-droplet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export = async () => {
config.name,
{
image: config.image,
packages: config.packages,
projectId: config.projectId,
region: config.region,
reservedIpId: config.reservedIpId,
Expand Down