@pulumi/digitalocean 4.7.0-alpha.1633346817

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +68 -0
  3. package/app.d.ts +203 -0
  4. package/app.js +174 -0
  5. package/app.js.map +1 -0
  6. package/cdn.d.ts +169 -0
  7. package/cdn.js +116 -0
  8. package/cdn.js.map +1 -0
  9. package/certificate.d.ts +225 -0
  10. package/certificate.js +137 -0
  11. package/certificate.js.map +1 -0
  12. package/config/index.d.ts +1 -0
  13. package/config/index.js +10 -0
  14. package/config/index.js.map +1 -0
  15. package/config/vars.d.ts +20 -0
  16. package/config/vars.js +28 -0
  17. package/config/vars.js.map +1 -0
  18. package/containerRegistry.d.ts +88 -0
  19. package/containerRegistry.js +83 -0
  20. package/containerRegistry.js.map +1 -0
  21. package/containerRegistryDockerCredentials.d.ts +108 -0
  22. package/containerRegistryDockerCredentials.js +93 -0
  23. package/containerRegistryDockerCredentials.js.map +1 -0
  24. package/customImage.d.ts +155 -0
  25. package/customImage.js +113 -0
  26. package/customImage.js.map +1 -0
  27. package/databaseCluster.d.ts +306 -0
  28. package/databaseCluster.js +165 -0
  29. package/databaseCluster.js.map +1 -0
  30. package/databaseConnectionPool.d.ts +189 -0
  31. package/databaseConnectionPool.js +120 -0
  32. package/databaseConnectionPool.js.map +1 -0
  33. package/databaseDb.d.ts +87 -0
  34. package/databaseDb.js +82 -0
  35. package/databaseDb.js.map +1 -0
  36. package/databaseFirewall.d.ts +129 -0
  37. package/databaseFirewall.js +126 -0
  38. package/databaseFirewall.js.map +1 -0
  39. package/databaseReplica.d.ts +204 -0
  40. package/databaseReplica.js +110 -0
  41. package/databaseReplica.js.map +1 -0
  42. package/databaseUser.d.ts +117 -0
  43. package/databaseUser.js +90 -0
  44. package/databaseUser.js.map +1 -0
  45. package/dnsRecord.d.ts +200 -0
  46. package/dnsRecord.js +114 -0
  47. package/dnsRecord.js.map +1 -0
  48. package/domain.d.ts +103 -0
  49. package/domain.js +83 -0
  50. package/domain.js.map +1 -0
  51. package/droplet.d.ts +386 -0
  52. package/droplet.js +137 -0
  53. package/droplet.js.map +1 -0
  54. package/dropletSnapshot.d.ts +117 -0
  55. package/dropletSnapshot.js +88 -0
  56. package/dropletSnapshot.js.map +1 -0
  57. package/firewall.d.ts +226 -0
  58. package/firewall.js +150 -0
  59. package/firewall.js.map +1 -0
  60. package/floatingIp.d.ts +112 -0
  61. package/floatingIp.js +91 -0
  62. package/floatingIp.js.map +1 -0
  63. package/floatingIpAssignment.d.ts +85 -0
  64. package/floatingIpAssignment.js +83 -0
  65. package/floatingIpAssignment.js.map +1 -0
  66. package/getAccount.d.ts +32 -0
  67. package/getAccount.js +31 -0
  68. package/getAccount.js.map +1 -0
  69. package/getApp.d.ts +63 -0
  70. package/getApp.js +36 -0
  71. package/getApp.js.map +1 -0
  72. package/getCertificate.d.ts +48 -0
  73. package/getCertificate.js +40 -0
  74. package/getCertificate.js.map +1 -0
  75. package/getContainerRegistry.d.ts +54 -0
  76. package/getContainerRegistry.js +41 -0
  77. package/getContainerRegistry.js.map +1 -0
  78. package/getDatabaseCluster.d.ts +103 -0
  79. package/getDatabaseCluster.js +35 -0
  80. package/getDatabaseCluster.js.map +1 -0
  81. package/getDatabaseReplica.d.ts +87 -0
  82. package/getDatabaseReplica.js +40 -0
  83. package/getDatabaseReplica.js.map +1 -0
  84. package/getDomain.d.ts +37 -0
  85. package/getDomain.js +28 -0
  86. package/getDomain.js.map +1 -0
  87. package/getDomains.d.ts +61 -0
  88. package/getDomains.js +49 -0
  89. package/getDomains.js.map +1 -0
  90. package/getDroplet.d.ts +161 -0
  91. package/getDroplet.js +67 -0
  92. package/getDroplet.js.map +1 -0
  93. package/getDropletSnapshot.d.ts +76 -0
  94. package/getDropletSnapshot.js +43 -0
  95. package/getDropletSnapshot.js.map +1 -0
  96. package/getDroplets.d.ts +85 -0
  97. package/getDroplets.js +73 -0
  98. package/getDroplets.js.map +1 -0
  99. package/getFirewall.d.ts +83 -0
  100. package/getFirewall.js +40 -0
  101. package/getFirewall.js.map +1 -0
  102. package/getFloatingIp.d.ts +48 -0
  103. package/getFloatingIp.js +43 -0
  104. package/getFloatingIp.js.map +1 -0
  105. package/getImage.d.ts +110 -0
  106. package/getImage.js +71 -0
  107. package/getImage.js.map +1 -0
  108. package/getImages.d.ts +90 -0
  109. package/getImages.js +74 -0
  110. package/getImages.js.map +1 -0
  111. package/getKubernetesCluster.d.ts +95 -0
  112. package/getKubernetesCluster.js +23 -0
  113. package/getKubernetesCluster.js.map +1 -0
  114. package/getKubernetesVersions.d.ts +79 -0
  115. package/getKubernetesVersions.js +70 -0
  116. package/getKubernetesVersions.js.map +1 -0
  117. package/getLoadBalancer.d.ts +59 -0
  118. package/getLoadBalancer.js +41 -0
  119. package/getLoadBalancer.js.map +1 -0
  120. package/getProject.d.ts +72 -0
  121. package/getProject.js +37 -0
  122. package/getProject.js.map +1 -0
  123. package/getProjects.d.ts +85 -0
  124. package/getProjects.js +72 -0
  125. package/getProjects.js.map +1 -0
  126. package/getRecord.d.ts +42 -0
  127. package/getRecord.js +28 -0
  128. package/getRecord.js.map +1 -0
  129. package/getRecords.d.ts +39 -0
  130. package/getRecords.js +25 -0
  131. package/getRecords.js.map +1 -0
  132. package/getRegion.d.ts +56 -0
  133. package/getRegion.js +35 -0
  134. package/getRegion.js.map +1 -0
  135. package/getRegions.d.ts +82 -0
  136. package/getRegions.js +70 -0
  137. package/getRegions.js.map +1 -0
  138. package/getSizes.d.ts +35 -0
  139. package/getSizes.js +26 -0
  140. package/getSizes.js.map +1 -0
  141. package/getSpacesBucket.d.ts +59 -0
  142. package/getSpacesBucket.js +39 -0
  143. package/getSpacesBucket.js.map +1 -0
  144. package/getSpacesBucketObject.d.ts +125 -0
  145. package/getSpacesBucketObject.js +53 -0
  146. package/getSpacesBucketObject.js.map +1 -0
  147. package/getSpacesBucketObjects.d.ts +83 -0
  148. package/getSpacesBucketObjects.js +49 -0
  149. package/getSpacesBucketObjects.js.map +1 -0
  150. package/getSpacesBuckets.d.ts +75 -0
  151. package/getSpacesBuckets.js +63 -0
  152. package/getSpacesBuckets.js.map +1 -0
  153. package/getSshKey.d.ts +47 -0
  154. package/getSshKey.js +46 -0
  155. package/getSshKey.js.map +1 -0
  156. package/getSshKeys.d.ts +58 -0
  157. package/getSshKeys.js +46 -0
  158. package/getSshKeys.js.map +1 -0
  159. package/getTag.d.ts +71 -0
  160. package/getTag.js +45 -0
  161. package/getTag.js.map +1 -0
  162. package/getTags.d.ts +50 -0
  163. package/getTags.js +41 -0
  164. package/getTags.js.map +1 -0
  165. package/getVolume.d.ts +98 -0
  166. package/getVolume.js +64 -0
  167. package/getVolume.js.map +1 -0
  168. package/getVolumeSnapshot.d.ts +98 -0
  169. package/getVolumeSnapshot.js +61 -0
  170. package/getVolumeSnapshot.js.map +1 -0
  171. package/getVpc.d.ts +95 -0
  172. package/getVpc.js +61 -0
  173. package/getVpc.js.map +1 -0
  174. package/index.d.ts +74 -0
  175. package/index.js +240 -0
  176. package/index.js.map +1 -0
  177. package/kubernetesCluster.d.ts +220 -0
  178. package/kubernetesCluster.js +102 -0
  179. package/kubernetesCluster.js.map +1 -0
  180. package/kubernetesNodePool.d.ts +242 -0
  181. package/kubernetesNodePool.js +141 -0
  182. package/kubernetesNodePool.js.map +1 -0
  183. package/loadBalancer.d.ts +307 -0
  184. package/loadBalancer.js +161 -0
  185. package/loadBalancer.js.map +1 -0
  186. package/monitorAlert.d.ts +193 -0
  187. package/monitorAlert.js +99 -0
  188. package/monitorAlert.js.map +1 -0
  189. package/package.json +28 -0
  190. package/package.json.bak +27 -0
  191. package/package.json.dev +27 -0
  192. package/project.d.ts +191 -0
  193. package/project.js +129 -0
  194. package/project.js.map +1 -0
  195. package/projectResources.d.ts +100 -0
  196. package/projectResources.js +98 -0
  197. package/projectResources.js.map +1 -0
  198. package/provider.d.ts +67 -0
  199. package/provider.js +51 -0
  200. package/provider.js.map +1 -0
  201. package/scripts/install-pulumi-plugin.js +21 -0
  202. package/spacesBucket.d.ts +210 -0
  203. package/spacesBucket.js +139 -0
  204. package/spacesBucket.js.map +1 -0
  205. package/spacesBucketObject.d.ts +293 -0
  206. package/spacesBucketObject.js +139 -0
  207. package/spacesBucketObject.js.map +1 -0
  208. package/sshKey.d.ts +103 -0
  209. package/sshKey.js +89 -0
  210. package/sshKey.js.map +1 -0
  211. package/tag.d.ts +127 -0
  212. package/tag.js +93 -0
  213. package/tag.js.map +1 -0
  214. package/types/enums/index.d.ts +151 -0
  215. package/types/enums/index.js +148 -0
  216. package/types/enums/index.js.map +1 -0
  217. package/types/index.d.ts +4 -0
  218. package/types/index.js +12 -0
  219. package/types/index.js.map +1 -0
  220. package/types/input.d.ts +1584 -0
  221. package/types/input.js +5 -0
  222. package/types/input.js.map +1 -0
  223. package/types/output.d.ts +2730 -0
  224. package/types/output.js +5 -0
  225. package/types/output.js.map +1 -0
  226. package/utilities.d.ts +4 -0
  227. package/utilities.js +51 -0
  228. package/utilities.js.map +1 -0
  229. package/volume.d.ts +225 -0
  230. package/volume.js +128 -0
  231. package/volume.js.map +1 -0
  232. package/volumeAttachment.d.ts +88 -0
  233. package/volumeAttachment.js +86 -0
  234. package/volumeAttachment.js.map +1 -0
  235. package/volumeSnapshot.d.ts +129 -0
  236. package/volumeSnapshot.js +90 -0
  237. package/volumeSnapshot.js.map +1 -0
  238. package/vpc.d.ts +152 -0
  239. package/vpc.js +109 -0
  240. package/vpc.js.map +1 -0
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const pulumi = require("@pulumi/pulumi");
6
+ const utilities = require("./utilities");
7
+ /**
8
+ * Provides a DigitalOcean database firewall resource allowing you to restrict
9
+ * connections to your database to trusted sources. You may limit connections to
10
+ * specific Droplets, Kubernetes clusters, or IP addresses.
11
+ *
12
+ * ## Example Usage
13
+ * ### Create a new database firewall allowing multiple IP addresses
14
+ *
15
+ * ```typescript
16
+ * import * as pulumi from "@pulumi/pulumi";
17
+ * import * as digitalocean from "@pulumi/digitalocean";
18
+ *
19
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
20
+ * engine: "pg",
21
+ * version: "11",
22
+ * size: "db-s-1vcpu-1gb",
23
+ * region: "nyc1",
24
+ * nodeCount: 1,
25
+ * });
26
+ * const example_fw = new digitalocean.DatabaseFirewall("example-fw", {
27
+ * clusterId: postgres_example.id,
28
+ * rules: [
29
+ * {
30
+ * type: "ip_addr",
31
+ * value: "192.168.1.1",
32
+ * },
33
+ * {
34
+ * type: "ip_addr",
35
+ * value: "192.0.2.0",
36
+ * },
37
+ * ],
38
+ * });
39
+ * ```
40
+ * ### Create a new database firewall allowing a Droplet
41
+ *
42
+ * ```typescript
43
+ * import * as pulumi from "@pulumi/pulumi";
44
+ * import * as digitalocean from "@pulumi/digitalocean";
45
+ *
46
+ * const web = new digitalocean.Droplet("web", {
47
+ * size: "s-1vcpu-1gb",
48
+ * image: "centos-7-x64",
49
+ * region: "nyc3",
50
+ * });
51
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
52
+ * engine: "pg",
53
+ * version: "11",
54
+ * size: "db-s-1vcpu-1gb",
55
+ * region: "nyc1",
56
+ * nodeCount: 1,
57
+ * });
58
+ * const example_fw = new digitalocean.DatabaseFirewall("example-fw", {
59
+ * clusterId: postgres_example.id,
60
+ * rules: [{
61
+ * type: "droplet",
62
+ * value: web.id,
63
+ * }],
64
+ * });
65
+ * ```
66
+ *
67
+ * ## Import
68
+ *
69
+ * Database firewalls can be imported using the `id` of the target database cluster For example
70
+ *
71
+ * ```sh
72
+ * $ pulumi import digitalocean:index/databaseFirewall:DatabaseFirewall example-fw 5f55c6cd-863b-4907-99b8-7e09b0275d54
73
+ * ```
74
+ */
75
+ class DatabaseFirewall extends pulumi.CustomResource {
76
+ constructor(name, argsOrState, opts) {
77
+ let inputs = {};
78
+ opts = opts || {};
79
+ if (opts.id) {
80
+ const state = argsOrState;
81
+ inputs["clusterId"] = state ? state.clusterId : undefined;
82
+ inputs["rules"] = state ? state.rules : undefined;
83
+ }
84
+ else {
85
+ const args = argsOrState;
86
+ if ((!args || args.clusterId === undefined) && !opts.urn) {
87
+ throw new Error("Missing required property 'clusterId'");
88
+ }
89
+ if ((!args || args.rules === undefined) && !opts.urn) {
90
+ throw new Error("Missing required property 'rules'");
91
+ }
92
+ inputs["clusterId"] = args ? args.clusterId : undefined;
93
+ inputs["rules"] = args ? args.rules : undefined;
94
+ }
95
+ if (!opts.version) {
96
+ opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
97
+ }
98
+ super(DatabaseFirewall.__pulumiType, name, inputs, opts);
99
+ }
100
+ /**
101
+ * Get an existing DatabaseFirewall resource's state with the given name, ID, and optional extra
102
+ * properties used to qualify the lookup.
103
+ *
104
+ * @param name The _unique_ name of the resulting resource.
105
+ * @param id The _unique_ provider ID of the resource to lookup.
106
+ * @param state Any extra arguments used during the lookup.
107
+ * @param opts Optional settings to control the behavior of the CustomResource.
108
+ */
109
+ static get(name, id, state, opts) {
110
+ return new DatabaseFirewall(name, state, Object.assign(Object.assign({}, opts), { id: id }));
111
+ }
112
+ /**
113
+ * Returns true if the given object is an instance of DatabaseFirewall. This is designed to work even
114
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
115
+ */
116
+ static isInstance(obj) {
117
+ if (obj === undefined || obj === null) {
118
+ return false;
119
+ }
120
+ return obj['__pulumiType'] === DatabaseFirewall.__pulumiType;
121
+ }
122
+ }
123
+ exports.DatabaseFirewall = DatabaseFirewall;
124
+ /** @internal */
125
+ DatabaseFirewall.__pulumiType = 'digitalocean:index/databaseFirewall:DatabaseFirewall';
126
+ //# sourceMappingURL=databaseFirewall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datab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C,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;SACnD;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,EAAC,CAAC,CAAC;SACxE;QACD,KAAK,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAlED;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAA6B,EAAE,IAAmC;QAC3H,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IACvE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,gBAAgB,CAAC,YAAY,CAAC;IACjE,CAAC;;AA1BL,4CAoEC;AAtDG,gBAAgB;AACO,6BAAY,GAAG,sDAAsD,CAAC"}
@@ -0,0 +1,204 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import { enums } from "./types";
3
+ /**
4
+ * Provides a DigitalOcean database replica resource.
5
+ *
6
+ * ## Example Usage
7
+ * ### Create a new PostgreSQL database replica
8
+ * ```typescript
9
+ * import * as pulumi from "@pulumi/pulumi";
10
+ * import * as digitalocean from "@pulumi/digitalocean";
11
+ *
12
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
13
+ * engine: "pg",
14
+ * version: "11",
15
+ * size: "db-s-1vcpu-1gb",
16
+ * region: "nyc1",
17
+ * nodeCount: 1,
18
+ * });
19
+ * const read_replica = new digitalocean.DatabaseReplica("read-replica", {
20
+ * clusterId: postgres_example.id,
21
+ * size: "db-s-1vcpu-1gb",
22
+ * region: "nyc1",
23
+ * });
24
+ * ```
25
+ *
26
+ * ## Import
27
+ *
28
+ * Database replicas can be imported using the `id` of the source database cluster and the `name` of the replica joined with a comma. For example
29
+ *
30
+ * ```sh
31
+ * $ pulumi import digitalocean:index/databaseReplica:DatabaseReplica read-replica 245bcfd0-7f31-4ce6-a2bc-475a116cca97,read-replica
32
+ * ```
33
+ */
34
+ export declare class DatabaseReplica extends pulumi.CustomResource {
35
+ /**
36
+ * Get an existing DatabaseReplica resource's state with the given name, ID, and optional extra
37
+ * properties used to qualify the lookup.
38
+ *
39
+ * @param name The _unique_ name of the resulting resource.
40
+ * @param id The _unique_ provider ID of the resource to lookup.
41
+ * @param state Any extra arguments used during the lookup.
42
+ * @param opts Optional settings to control the behavior of the CustomResource.
43
+ */
44
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseReplicaState, opts?: pulumi.CustomResourceOptions): DatabaseReplica;
45
+ /**
46
+ * Returns true if the given object is an instance of DatabaseReplica. This is designed to work even
47
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
48
+ */
49
+ static isInstance(obj: any): obj is DatabaseReplica;
50
+ /**
51
+ * The ID of the original source database cluster.
52
+ */
53
+ readonly clusterId: pulumi.Output<string>;
54
+ /**
55
+ * Name of the replica's default database.
56
+ */
57
+ readonly database: pulumi.Output<string>;
58
+ /**
59
+ * Database replica's hostname.
60
+ */
61
+ readonly host: pulumi.Output<string>;
62
+ /**
63
+ * The name for the database replica.
64
+ */
65
+ readonly name: pulumi.Output<string>;
66
+ /**
67
+ * Password for the replica's default user.
68
+ */
69
+ readonly password: pulumi.Output<string>;
70
+ /**
71
+ * Network port that the database replica is listening on.
72
+ */
73
+ readonly port: pulumi.Output<number>;
74
+ /**
75
+ * Same as `host`, but only accessible from resources within the account and in the same region.
76
+ */
77
+ readonly privateHost: pulumi.Output<string>;
78
+ /**
79
+ * The ID of the VPC where the database replica will be located.
80
+ */
81
+ readonly privateNetworkUuid: pulumi.Output<string>;
82
+ /**
83
+ * Same as `uri`, but only accessible from resources within the account and in the same region.
84
+ */
85
+ readonly privateUri: pulumi.Output<string>;
86
+ /**
87
+ * DigitalOcean region where the replica will reside.
88
+ */
89
+ readonly region: pulumi.Output<string | undefined>;
90
+ /**
91
+ * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`).
92
+ */
93
+ readonly size: pulumi.Output<string | undefined>;
94
+ /**
95
+ * A list of tag names to be applied to the database replica.
96
+ */
97
+ readonly tags: pulumi.Output<string[] | undefined>;
98
+ /**
99
+ * The full URI for connecting to the database replica.
100
+ */
101
+ readonly uri: pulumi.Output<string>;
102
+ /**
103
+ * Username for the replica's default user.
104
+ */
105
+ readonly user: pulumi.Output<string>;
106
+ /**
107
+ * Create a DatabaseReplica resource with the given unique name, arguments, and options.
108
+ *
109
+ * @param name The _unique_ name of the resource.
110
+ * @param args The arguments to use to populate this resource's properties.
111
+ * @param opts A bag of options that control this resource's behavior.
112
+ */
113
+ constructor(name: string, args: DatabaseReplicaArgs, opts?: pulumi.CustomResourceOptions);
114
+ }
115
+ /**
116
+ * Input properties used for looking up and filtering DatabaseReplica resources.
117
+ */
118
+ export interface DatabaseReplicaState {
119
+ /**
120
+ * The ID of the original source database cluster.
121
+ */
122
+ clusterId?: pulumi.Input<string>;
123
+ /**
124
+ * Name of the replica's default database.
125
+ */
126
+ database?: pulumi.Input<string>;
127
+ /**
128
+ * Database replica's hostname.
129
+ */
130
+ host?: pulumi.Input<string>;
131
+ /**
132
+ * The name for the database replica.
133
+ */
134
+ name?: pulumi.Input<string>;
135
+ /**
136
+ * Password for the replica's default user.
137
+ */
138
+ password?: pulumi.Input<string>;
139
+ /**
140
+ * Network port that the database replica is listening on.
141
+ */
142
+ port?: pulumi.Input<number>;
143
+ /**
144
+ * Same as `host`, but only accessible from resources within the account and in the same region.
145
+ */
146
+ privateHost?: pulumi.Input<string>;
147
+ /**
148
+ * The ID of the VPC where the database replica will be located.
149
+ */
150
+ privateNetworkUuid?: pulumi.Input<string>;
151
+ /**
152
+ * Same as `uri`, but only accessible from resources within the account and in the same region.
153
+ */
154
+ privateUri?: pulumi.Input<string>;
155
+ /**
156
+ * DigitalOcean region where the replica will reside.
157
+ */
158
+ region?: pulumi.Input<string | enums.Region>;
159
+ /**
160
+ * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`).
161
+ */
162
+ size?: pulumi.Input<string | enums.DatabaseSlug>;
163
+ /**
164
+ * A list of tag names to be applied to the database replica.
165
+ */
166
+ tags?: pulumi.Input<pulumi.Input<string>[]>;
167
+ /**
168
+ * The full URI for connecting to the database replica.
169
+ */
170
+ uri?: pulumi.Input<string>;
171
+ /**
172
+ * Username for the replica's default user.
173
+ */
174
+ user?: pulumi.Input<string>;
175
+ }
176
+ /**
177
+ * The set of arguments for constructing a DatabaseReplica resource.
178
+ */
179
+ export interface DatabaseReplicaArgs {
180
+ /**
181
+ * The ID of the original source database cluster.
182
+ */
183
+ clusterId: pulumi.Input<string>;
184
+ /**
185
+ * The name for the database replica.
186
+ */
187
+ name?: pulumi.Input<string>;
188
+ /**
189
+ * The ID of the VPC where the database replica will be located.
190
+ */
191
+ privateNetworkUuid?: pulumi.Input<string>;
192
+ /**
193
+ * DigitalOcean region where the replica will reside.
194
+ */
195
+ region?: pulumi.Input<string | enums.Region>;
196
+ /**
197
+ * Database Droplet size associated with the replica (ex. `db-s-1vcpu-1gb`).
198
+ */
199
+ size?: pulumi.Input<string | enums.DatabaseSlug>;
200
+ /**
201
+ * A list of tag names to be applied to the database replica.
202
+ */
203
+ tags?: pulumi.Input<pulumi.Input<string>[]>;
204
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const pulumi = require("@pulumi/pulumi");
6
+ const utilities = require("./utilities");
7
+ /**
8
+ * Provides a DigitalOcean database replica resource.
9
+ *
10
+ * ## Example Usage
11
+ * ### Create a new PostgreSQL database replica
12
+ * ```typescript
13
+ * import * as pulumi from "@pulumi/pulumi";
14
+ * import * as digitalocean from "@pulumi/digitalocean";
15
+ *
16
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
17
+ * engine: "pg",
18
+ * version: "11",
19
+ * size: "db-s-1vcpu-1gb",
20
+ * region: "nyc1",
21
+ * nodeCount: 1,
22
+ * });
23
+ * const read_replica = new digitalocean.DatabaseReplica("read-replica", {
24
+ * clusterId: postgres_example.id,
25
+ * size: "db-s-1vcpu-1gb",
26
+ * region: "nyc1",
27
+ * });
28
+ * ```
29
+ *
30
+ * ## Import
31
+ *
32
+ * Database replicas can be imported using the `id` of the source database cluster and the `name` of the replica joined with a comma. For example
33
+ *
34
+ * ```sh
35
+ * $ pulumi import digitalocean:index/databaseReplica:DatabaseReplica read-replica 245bcfd0-7f31-4ce6-a2bc-475a116cca97,read-replica
36
+ * ```
37
+ */
38
+ class DatabaseReplica extends pulumi.CustomResource {
39
+ constructor(name, argsOrState, opts) {
40
+ let inputs = {};
41
+ opts = opts || {};
42
+ if (opts.id) {
43
+ const state = argsOrState;
44
+ inputs["clusterId"] = state ? state.clusterId : undefined;
45
+ inputs["database"] = state ? state.database : undefined;
46
+ inputs["host"] = state ? state.host : undefined;
47
+ inputs["name"] = state ? state.name : undefined;
48
+ inputs["password"] = state ? state.password : undefined;
49
+ inputs["port"] = state ? state.port : undefined;
50
+ inputs["privateHost"] = state ? state.privateHost : undefined;
51
+ inputs["privateNetworkUuid"] = state ? state.privateNetworkUuid : undefined;
52
+ inputs["privateUri"] = state ? state.privateUri : undefined;
53
+ inputs["region"] = state ? state.region : undefined;
54
+ inputs["size"] = state ? state.size : undefined;
55
+ inputs["tags"] = state ? state.tags : undefined;
56
+ inputs["uri"] = state ? state.uri : undefined;
57
+ inputs["user"] = state ? state.user : undefined;
58
+ }
59
+ else {
60
+ const args = argsOrState;
61
+ if ((!args || args.clusterId === undefined) && !opts.urn) {
62
+ throw new Error("Missing required property 'clusterId'");
63
+ }
64
+ inputs["clusterId"] = args ? args.clusterId : undefined;
65
+ inputs["name"] = args ? args.name : undefined;
66
+ inputs["privateNetworkUuid"] = args ? args.privateNetworkUuid : undefined;
67
+ inputs["region"] = args ? args.region : undefined;
68
+ inputs["size"] = args ? args.size : undefined;
69
+ inputs["tags"] = args ? args.tags : undefined;
70
+ inputs["database"] = undefined /*out*/;
71
+ inputs["host"] = undefined /*out*/;
72
+ inputs["password"] = undefined /*out*/;
73
+ inputs["port"] = undefined /*out*/;
74
+ inputs["privateHost"] = undefined /*out*/;
75
+ inputs["privateUri"] = undefined /*out*/;
76
+ inputs["uri"] = undefined /*out*/;
77
+ inputs["user"] = undefined /*out*/;
78
+ }
79
+ if (!opts.version) {
80
+ opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
81
+ }
82
+ super(DatabaseReplica.__pulumiType, name, inputs, opts);
83
+ }
84
+ /**
85
+ * Get an existing DatabaseReplica resource's state with the given name, ID, and optional extra
86
+ * properties used to qualify the lookup.
87
+ *
88
+ * @param name The _unique_ name of the resulting resource.
89
+ * @param id The _unique_ provider ID of the resource to lookup.
90
+ * @param state Any extra arguments used during the lookup.
91
+ * @param opts Optional settings to control the behavior of the CustomResource.
92
+ */
93
+ static get(name, id, state, opts) {
94
+ return new DatabaseReplica(name, state, Object.assign(Object.assign({}, opts), { id: id }));
95
+ }
96
+ /**
97
+ * Returns true if the given object is an instance of DatabaseReplica. This is designed to work even
98
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
99
+ */
100
+ static isInstance(obj) {
101
+ if (obj === undefined || obj === null) {
102
+ return false;
103
+ }
104
+ return obj['__pulumiType'] === DatabaseReplica.__pulumiType;
105
+ }
106
+ }
107
+ exports.DatabaseReplica = DatabaseReplica;
108
+ /** @internal */
109
+ DatabaseReplica.__pulumiType = 'digitalocean:index/databaseReplica:DatabaseReplica';
110
+ //# sourceMappingURL=databaseReplica.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"databaseReplica.js","sourceRoot":"","sources":["../databaseReplica.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;AAEjF,yCAAyC;AAEzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,eAAgB,SAAQ,MAAM,CAAC,cAAc;IA6FtD,YAAY,IAAY,EAAE,WAAwD,EAAE,IAAmC;QACnH,IAAI,MAAM,GAAkB,EAAE,CAAC;QAC/B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAA+C,CAAC;YAC9D,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YACxD,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YACxD,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAA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,EAAE,EAA2B,EAAE,KAA4B,EAAE,IAAmC;QAC1H,OAAO,IAAI,eAAe,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IACtE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,eAAe,CAAC,YAAY,CAAC;IAChE,CAAC;;AA1BL,0CAyIC;AA3HG,gBAAgB;AACO,4BAAY,GAAG,oDAAoD,CAAC"}
@@ -0,0 +1,117 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * Provides a DigitalOcean database user resource. When creating a new database cluster, a default admin user with name `doadmin` will be created. Then, this resource can be used to provide additional normal users inside the cluster.
4
+ *
5
+ * > **NOTE:** Any new users created will always have `normal` role, only the default user that comes with database cluster creation has `primary` role. Additional permissions must be managed manually.
6
+ *
7
+ * ## Example Usage
8
+ * ### Create a new PostgreSQL database user
9
+ * ```typescript
10
+ * import * as pulumi from "@pulumi/pulumi";
11
+ * import * as digitalocean from "@pulumi/digitalocean";
12
+ *
13
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
14
+ * engine: "pg",
15
+ * version: "11",
16
+ * size: "db-s-1vcpu-1gb",
17
+ * region: "nyc1",
18
+ * nodeCount: 1,
19
+ * });
20
+ * const user_example = new digitalocean.DatabaseUser("user-example", {clusterId: postgres_example.id});
21
+ * ```
22
+ *
23
+ * ## Import
24
+ *
25
+ * Database user can be imported using the `id` of the source database cluster and the `name` of the user joined with a comma. For example
26
+ *
27
+ * ```sh
28
+ * $ pulumi import digitalocean:index/databaseUser:DatabaseUser user-example 245bcfd0-7f31-4ce6-a2bc-475a116cca97,foobar
29
+ * ```
30
+ */
31
+ export declare class DatabaseUser extends pulumi.CustomResource {
32
+ /**
33
+ * Get an existing DatabaseUser resource's state with the given name, ID, and optional extra
34
+ * properties used to qualify the lookup.
35
+ *
36
+ * @param name The _unique_ name of the resulting resource.
37
+ * @param id The _unique_ provider ID of the resource to lookup.
38
+ * @param state Any extra arguments used during the lookup.
39
+ * @param opts Optional settings to control the behavior of the CustomResource.
40
+ */
41
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseUserState, opts?: pulumi.CustomResourceOptions): DatabaseUser;
42
+ /**
43
+ * Returns true if the given object is an instance of DatabaseUser. This is designed to work even
44
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
45
+ */
46
+ static isInstance(obj: any): obj is DatabaseUser;
47
+ /**
48
+ * The ID of the original source database cluster.
49
+ */
50
+ readonly clusterId: pulumi.Output<string>;
51
+ /**
52
+ * The authentication method to use for connections to the MySQL user account. The valid values are `mysqlNativePassword` or `cachingSha2Password` (this is the default).
53
+ */
54
+ readonly mysqlAuthPlugin: pulumi.Output<string | undefined>;
55
+ /**
56
+ * The name for the database user.
57
+ */
58
+ readonly name: pulumi.Output<string>;
59
+ /**
60
+ * Password for the database user.
61
+ */
62
+ readonly password: pulumi.Output<string>;
63
+ /**
64
+ * Role for the database user. The value will be either "primary" or "normal".
65
+ */
66
+ readonly role: pulumi.Output<string>;
67
+ /**
68
+ * Create a DatabaseUser resource with the given unique name, arguments, and options.
69
+ *
70
+ * @param name The _unique_ name of the resource.
71
+ * @param args The arguments to use to populate this resource's properties.
72
+ * @param opts A bag of options that control this resource's behavior.
73
+ */
74
+ constructor(name: string, args: DatabaseUserArgs, opts?: pulumi.CustomResourceOptions);
75
+ }
76
+ /**
77
+ * Input properties used for looking up and filtering DatabaseUser resources.
78
+ */
79
+ export interface DatabaseUserState {
80
+ /**
81
+ * The ID of the original source database cluster.
82
+ */
83
+ clusterId?: pulumi.Input<string>;
84
+ /**
85
+ * The authentication method to use for connections to the MySQL user account. The valid values are `mysqlNativePassword` or `cachingSha2Password` (this is the default).
86
+ */
87
+ mysqlAuthPlugin?: pulumi.Input<string>;
88
+ /**
89
+ * The name for the database user.
90
+ */
91
+ name?: pulumi.Input<string>;
92
+ /**
93
+ * Password for the database user.
94
+ */
95
+ password?: pulumi.Input<string>;
96
+ /**
97
+ * Role for the database user. The value will be either "primary" or "normal".
98
+ */
99
+ role?: pulumi.Input<string>;
100
+ }
101
+ /**
102
+ * The set of arguments for constructing a DatabaseUser resource.
103
+ */
104
+ export interface DatabaseUserArgs {
105
+ /**
106
+ * The ID of the original source database cluster.
107
+ */
108
+ clusterId: pulumi.Input<string>;
109
+ /**
110
+ * The authentication method to use for connections to the MySQL user account. The valid values are `mysqlNativePassword` or `cachingSha2Password` (this is the default).
111
+ */
112
+ mysqlAuthPlugin?: pulumi.Input<string>;
113
+ /**
114
+ * The name for the database user.
115
+ */
116
+ name?: pulumi.Input<string>;
117
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const pulumi = require("@pulumi/pulumi");
6
+ const utilities = require("./utilities");
7
+ /**
8
+ * Provides a DigitalOcean database user resource. When creating a new database cluster, a default admin user with name `doadmin` will be created. Then, this resource can be used to provide additional normal users inside the cluster.
9
+ *
10
+ * > **NOTE:** Any new users created will always have `normal` role, only the default user that comes with database cluster creation has `primary` role. Additional permissions must be managed manually.
11
+ *
12
+ * ## Example Usage
13
+ * ### Create a new PostgreSQL database user
14
+ * ```typescript
15
+ * import * as pulumi from "@pulumi/pulumi";
16
+ * import * as digitalocean from "@pulumi/digitalocean";
17
+ *
18
+ * const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
19
+ * engine: "pg",
20
+ * version: "11",
21
+ * size: "db-s-1vcpu-1gb",
22
+ * region: "nyc1",
23
+ * nodeCount: 1,
24
+ * });
25
+ * const user_example = new digitalocean.DatabaseUser("user-example", {clusterId: postgres_example.id});
26
+ * ```
27
+ *
28
+ * ## Import
29
+ *
30
+ * Database user can be imported using the `id` of the source database cluster and the `name` of the user joined with a comma. For example
31
+ *
32
+ * ```sh
33
+ * $ pulumi import digitalocean:index/databaseUser:DatabaseUser user-example 245bcfd0-7f31-4ce6-a2bc-475a116cca97,foobar
34
+ * ```
35
+ */
36
+ class DatabaseUser extends pulumi.CustomResource {
37
+ constructor(name, argsOrState, opts) {
38
+ let inputs = {};
39
+ opts = opts || {};
40
+ if (opts.id) {
41
+ const state = argsOrState;
42
+ inputs["clusterId"] = state ? state.clusterId : undefined;
43
+ inputs["mysqlAuthPlugin"] = state ? state.mysqlAuthPlugin : undefined;
44
+ inputs["name"] = state ? state.name : undefined;
45
+ inputs["password"] = state ? state.password : undefined;
46
+ inputs["role"] = state ? state.role : undefined;
47
+ }
48
+ else {
49
+ const args = argsOrState;
50
+ if ((!args || args.clusterId === undefined) && !opts.urn) {
51
+ throw new Error("Missing required property 'clusterId'");
52
+ }
53
+ inputs["clusterId"] = args ? args.clusterId : undefined;
54
+ inputs["mysqlAuthPlugin"] = args ? args.mysqlAuthPlugin : undefined;
55
+ inputs["name"] = args ? args.name : undefined;
56
+ inputs["password"] = undefined /*out*/;
57
+ inputs["role"] = undefined /*out*/;
58
+ }
59
+ if (!opts.version) {
60
+ opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });
61
+ }
62
+ super(DatabaseUser.__pulumiType, name, inputs, opts);
63
+ }
64
+ /**
65
+ * Get an existing DatabaseUser resource's state with the given name, ID, and optional extra
66
+ * properties used to qualify the lookup.
67
+ *
68
+ * @param name The _unique_ name of the resulting resource.
69
+ * @param id The _unique_ provider ID of the resource to lookup.
70
+ * @param state Any extra arguments used during the lookup.
71
+ * @param opts Optional settings to control the behavior of the CustomResource.
72
+ */
73
+ static get(name, id, state, opts) {
74
+ return new DatabaseUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
75
+ }
76
+ /**
77
+ * Returns true if the given object is an instance of DatabaseUser. This is designed to work even
78
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
79
+ */
80
+ static isInstance(obj) {
81
+ if (obj === undefined || obj === null) {
82
+ return false;
83
+ }
84
+ return obj['__pulumiType'] === DatabaseUser.__pulumiType;
85
+ }
86
+ }
87
+ exports.DatabaseUser = DatabaseUser;
88
+ /** @internal */
89
+ DatabaseUser.__pulumiType = 'digitalocean:index/databaseUser:DatabaseUser';
90
+ //# sourceMappingURL=databaseUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"databaseUser.js","sourceRoot":"","sources":["../databaseUser.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,YAAa,SAAQ,MAAM,CAAC,cAAc;IAyDnD,YAAY,IAAY,EAAE,WAAkD,EAAE,IAAmC;QAC7G,IAAI,MAAM,GAAkB,EAAE,CAAC;QAC/B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAA4C,CAAC;YAC3D,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,MAAM,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YACxD,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAA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