@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
209 lines • 9.3 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutonomousDatabase = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An AutonomousDatabase resource.
*
* To get more information about AutonomousDatabase, see:
*
* * [API documentation](https://cloud.google.com/oracle/database/docs/reference/rest/v1/projects.locations.autonomousDatabases)
* * How-to Guides
* * [Create Autonomous databases](https://cloud.google.com/oracle/database/docs/create-databases)
*
* ## Example Usage
*
* ### Oracledatabase Autonomous Database Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = gcp.compute.getNetwork({
* name: "new",
* project: "my-project",
* });
* const myADB = new gcp.oracledatabase.AutonomousDatabase("myADB", {
* autonomousDatabaseId: "my-instance",
* location: "us-east4",
* project: "my-project",
* database: "mydatabase",
* adminPassword: "123Abpassword",
* network: _default.then(_default => _default.id),
* cidr: "10.5.0.0/24",
* properties: {
* computeCount: 2,
* dataStorageSizeTb: 1,
* dbVersion: "19c",
* dbWorkload: "OLTP",
* licenseType: "LICENSE_INCLUDED",
* },
* deletionProtection: true,
* });
* ```
* ### Oracledatabase Autonomous Database Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = gcp.compute.getNetwork({
* name: "new",
* project: "my-project",
* });
* const myADB = new gcp.oracledatabase.AutonomousDatabase("myADB", {
* autonomousDatabaseId: "my-instance",
* location: "us-east4",
* project: "my-project",
* displayName: "autonomousDatabase displayname",
* database: "mydatabase",
* adminPassword: "123Abpassword",
* network: _default.then(_default => _default.id),
* cidr: "10.5.0.0/24",
* labels: {
* "label-one": "value-one",
* },
* properties: {
* computeCount: 2,
* dataStorageSizeGb: 48,
* dbVersion: "19c",
* dbEdition: "STANDARD_EDITION",
* dbWorkload: "OLTP",
* isAutoScalingEnabled: true,
* licenseType: "BRING_YOUR_OWN_LICENSE",
* backupRetentionPeriodDays: 60,
* characterSet: "AL32UTF8",
* isStorageAutoScalingEnabled: false,
* maintenanceScheduleType: "REGULAR",
* mtlsConnectionRequired: false,
* nCharacterSet: "AL16UTF16",
* operationsInsightsState: "NOT_ENABLED",
* customerContacts: [{
* email: "xyz@example.com",
* }],
* privateEndpointIp: "10.5.0.11",
* privateEndpointLabel: "myendpoint",
* },
* deletionProtection: true,
* });
* ```
*
* ## Import
*
* AutonomousDatabase can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/autonomousDatabases/{{autonomous_database_id}}`
*
* * `{{project}}/{{location}}/{{autonomous_database_id}}`
*
* * `{{location}}/{{autonomous_database_id}}`
*
* When using the `pulumi import` command, AutonomousDatabase can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:oracledatabase/autonomousDatabase:AutonomousDatabase default projects/{{project}}/locations/{{location}}/autonomousDatabases/{{autonomous_database_id}}
* ```
*
* ```sh
* $ pulumi import gcp:oracledatabase/autonomousDatabase:AutonomousDatabase default {{project}}/{{location}}/{{autonomous_database_id}}
* ```
*
* ```sh
* $ pulumi import gcp:oracledatabase/autonomousDatabase:AutonomousDatabase default {{location}}/{{autonomous_database_id}}
* ```
*/
class AutonomousDatabase extends pulumi.CustomResource {
/**
* Get an existing AutonomousDatabase 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 AutonomousDatabase(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AutonomousDatabase. 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'] === AutonomousDatabase.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminPassword"] = state ? state.adminPassword : undefined;
resourceInputs["autonomousDatabaseId"] = state ? state.autonomousDatabaseId : undefined;
resourceInputs["cidr"] = state ? state.cidr : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["database"] = state ? state.database : undefined;
resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["entitlementId"] = state ? state.entitlementId : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
}
else {
const args = argsOrState;
if ((!args || args.autonomousDatabaseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'autonomousDatabaseId'");
}
if ((!args || args.cidr === undefined) && !opts.urn) {
throw new Error("Missing required property 'cidr'");
}
if ((!args || args.database === undefined) && !opts.urn) {
throw new Error("Missing required property 'database'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.network === undefined) && !opts.urn) {
throw new Error("Missing required property 'network'");
}
if ((!args || args.properties === undefined) && !opts.urn) {
throw new Error("Missing required property 'properties'");
}
resourceInputs["adminPassword"] = args ? args.adminPassword : undefined;
resourceInputs["autonomousDatabaseId"] = args ? args.autonomousDatabaseId : undefined;
resourceInputs["cidr"] = args ? args.cidr : undefined;
resourceInputs["database"] = args ? args.database : undefined;
resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["entitlementId"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(AutonomousDatabase.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutonomousDatabase = AutonomousDatabase;
/** @internal */
AutonomousDatabase.__pulumiType = 'gcp:oracledatabase/autonomousDatabase:AutonomousDatabase';
//# sourceMappingURL=autonomousDatabase.js.map