UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

231 lines • 8.2 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.App = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Provides a DigitalOcean App resource. * * ## Example Usage * * To create an app, provide a [DigitalOcean app spec](https://docs.digitalocean.com/products/app-platform/reference/app-spec/) specifying the app's components. * * ### Basic Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const golang_sample = new digitalocean.App("golang-sample", {spec: { * name: "golang-sample", * region: "ams", * services: [{ * name: "go-service", * instanceCount: 1, * instanceSizeSlug: "apps-s-1vcpu-1gb", * git: { * repoCloneUrl: "https://github.com/digitalocean/sample-golang.git", * branch: "main", * }, * }], * }}); * ``` * * ### Static Site Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const static_site_example = new digitalocean.App("static-site-example", {spec: { * name: "static-site-example", * region: "ams", * staticSites: [{ * name: "sample-jekyll", * buildCommand: "bundle exec jekyll build -d ./public", * outputDir: "/public", * git: { * repoCloneUrl: "https://github.com/digitalocean/sample-jekyll.git", * branch: "main", * }, * }], * }}); * ``` * * ### Multiple Components Example * * ### Log Destination Example with Opensearch * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const golang_sample = new digitalocean.App("golang-sample", {spec: { * name: "golang-sample", * region: "ams", * services: [{ * name: "go-service", * instanceCount: 1, * instanceSizeSlug: "apps-s-1vcpu-1gb", * git: { * repoCloneUrl: "https://github.com/digitalocean/sample-golang.git", * branch: "main", * }, * logDestinations: [{ * name: "MyLogs", * openSearch: { * endpoint: "https://something:1234", * basicAuth: { * user: "user", * password: "hi", * }, * }, * }], * }], * }}); * ``` * * ### Edge Controls Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const golang_sample = new digitalocean.App("golang-sample", {spec: { * name: "golang-sample", * region: "ams", * disableEdgeCache: true, * disableEmailObfuscation: false, * enhancedThreatControlEnabled: true, * services: [{ * name: "go-service", * instanceCount: 1, * instanceSizeSlug: "apps-s-1vcpu-1gb", * git: { * repoCloneUrl: "https://github.com/digitalocean/sample-golang.git", * branch: "main", * }, * }], * }}); * ``` * * ### Maintenance Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const maintenance_example = new digitalocean.App("maintenance-example", {spec: { * name: "maintenance-example", * region: "ams", * maintenance: { * enabled: true, * offlinePageUrl: "https://example.com/maintenance.html", * }, * services: [{ * name: "go-service", * instanceCount: 1, * instanceSizeSlug: "apps-s-1vcpu-1gb", * git: { * repoCloneUrl: "https://github.com/digitalocean/sample-golang.git", * branch: "main", * }, * }], * }}); * ``` * * ## Import * * An app can be imported using its `id`, e.g. * * ```sh * $ pulumi import digitalocean:index/app:App myapp fb06ad00-351f-45c8-b5eb-13523c438661 * ``` */ class App extends pulumi.CustomResource { /** * Get an existing App resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new App(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'digitalocean:index/app:App'; /** * Returns true if the given object is an instance of App. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === App.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activeDeploymentId"] = state?.activeDeploymentId; resourceInputs["appUrn"] = state?.appUrn; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["dedicatedIps"] = state?.dedicatedIps; resourceInputs["defaultIngress"] = state?.defaultIngress; resourceInputs["deploymentPerPage"] = state?.deploymentPerPage; resourceInputs["liveDomain"] = state?.liveDomain; resourceInputs["liveUrl"] = state?.liveUrl; resourceInputs["projectId"] = state?.projectId; resourceInputs["spec"] = state?.spec; resourceInputs["updatedAt"] = state?.updatedAt; } else { const args = argsOrState; resourceInputs["dedicatedIps"] = args?.dedicatedIps; resourceInputs["deploymentPerPage"] = args?.deploymentPerPage; resourceInputs["projectId"] = args?.projectId; resourceInputs["spec"] = args?.spec; resourceInputs["activeDeploymentId"] = undefined /*out*/; resourceInputs["appUrn"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["defaultIngress"] = undefined /*out*/; resourceInputs["liveDomain"] = undefined /*out*/; resourceInputs["liveUrl"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(App.__pulumiType, name, resourceInputs, opts); } } exports.App = App; //# sourceMappingURL=app.js.map