@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
179 lines • 6.5 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.App = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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",
* },
* }],
* }});
* ```
*
* ### 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",
* },
* }],
* }});
* ```
*
* ## 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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.activeDeploymentId : undefined;
resourceInputs["appUrn"] = state ? state.appUrn : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["dedicatedIps"] = state ? state.dedicatedIps : undefined;
resourceInputs["defaultIngress"] = state ? state.defaultIngress : undefined;
resourceInputs["liveDomain"] = state ? state.liveDomain : undefined;
resourceInputs["liveUrl"] = state ? state.liveUrl : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["spec"] = state ? state.spec : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
resourceInputs["dedicatedIps"] = args ? args.dedicatedIps : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["spec"] = args ? args.spec : undefined;
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;
/** @internal */
App.__pulumiType = 'digitalocean:index/app:App';
//# sourceMappingURL=app.js.map