UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

294 lines (293 loc) • 9.39 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: AppState, opts?: pulumi.CustomResourceOptions): 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: any): obj is App; /** * The ID the app's currently active deployment. */ readonly activeDeploymentId: pulumi.Output<string>; /** * The uniform resource identifier for the app. */ readonly appUrn: pulumi.Output<string>; /** * The date and time of when the app was created. */ readonly createdAt: pulumi.Output<string>; /** * The dedicated egress IP addresses associated with the app. */ readonly dedicatedIps: pulumi.Output<outputs.AppDedicatedIp[]>; /** * The default URL to access the app. */ readonly defaultIngress: pulumi.Output<string>; /** * (Optional) Controls how many deployments are requested per API page when listing deployments during create/update waits. Defaults to `20`. Reduce this value (for example `5`) if you experience API timeouts when listing deployments. */ readonly deploymentPerPage: pulumi.Output<number | undefined>; /** * The live domain of the app. */ readonly liveDomain: pulumi.Output<string>; /** * The live URL of the app. */ readonly liveUrl: pulumi.Output<string>; /** * The ID of the project that the app is assigned to. * * A spec can contain multiple components. * * A `service` can contain: */ readonly projectId: pulumi.Output<string>; /** * A DigitalOcean App spec describing the app. */ readonly spec: pulumi.Output<outputs.AppSpec | undefined>; /** * The date and time of when the app was last updated. */ readonly updatedAt: pulumi.Output<string>; /** * Create a App resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: AppArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering App resources. */ export interface AppState { /** * The ID the app's currently active deployment. */ activeDeploymentId?: pulumi.Input<string>; /** * The uniform resource identifier for the app. */ appUrn?: pulumi.Input<string>; /** * The date and time of when the app was created. */ createdAt?: pulumi.Input<string>; /** * The dedicated egress IP addresses associated with the app. */ dedicatedIps?: pulumi.Input<pulumi.Input<inputs.AppDedicatedIp>[]>; /** * The default URL to access the app. */ defaultIngress?: pulumi.Input<string>; /** * (Optional) Controls how many deployments are requested per API page when listing deployments during create/update waits. Defaults to `20`. Reduce this value (for example `5`) if you experience API timeouts when listing deployments. */ deploymentPerPage?: pulumi.Input<number>; /** * The live domain of the app. */ liveDomain?: pulumi.Input<string>; /** * The live URL of the app. */ liveUrl?: pulumi.Input<string>; /** * The ID of the project that the app is assigned to. * * A spec can contain multiple components. * * A `service` can contain: */ projectId?: pulumi.Input<string>; /** * A DigitalOcean App spec describing the app. */ spec?: pulumi.Input<inputs.AppSpec>; /** * The date and time of when the app was last updated. */ updatedAt?: pulumi.Input<string>; } /** * The set of arguments for constructing a App resource. */ export interface AppArgs { /** * The dedicated egress IP addresses associated with the app. */ dedicatedIps?: pulumi.Input<pulumi.Input<inputs.AppDedicatedIp>[]>; /** * (Optional) Controls how many deployments are requested per API page when listing deployments during create/update waits. Defaults to `20`. Reduce this value (for example `5`) if you experience API timeouts when listing deployments. */ deploymentPerPage?: pulumi.Input<number>; /** * The ID of the project that the app is assigned to. * * A spec can contain multiple components. * * A `service` can contain: */ projectId?: pulumi.Input<string>; /** * A DigitalOcean App spec describing the app. */ spec?: pulumi.Input<inputs.AppSpec>; }