pulumi-digitalocean 4.27.0__py3-none-any.whl → 4.39.0a1736833057__py3-none-any.whl
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.
Potentially problematic release.
This version of pulumi-digitalocean might be problematic. Click here for more details.
- pulumi_digitalocean/__init__.py +75 -0
- pulumi_digitalocean/_enums.py +131 -52
- pulumi_digitalocean/_inputs.py +5767 -399
- pulumi_digitalocean/_utilities.py +41 -5
- pulumi_digitalocean/app.py +199 -67
- pulumi_digitalocean/cdn.py +20 -23
- pulumi_digitalocean/certificate.py +45 -42
- pulumi_digitalocean/config/__init__.pyi +5 -0
- pulumi_digitalocean/config/vars.py +5 -0
- pulumi_digitalocean/container_registry.py +11 -6
- pulumi_digitalocean/container_registry_docker_credentials.py +53 -12
- pulumi_digitalocean/custom_image.py +13 -8
- pulumi_digitalocean/database_cluster.py +298 -120
- pulumi_digitalocean/database_connection_pool.py +15 -10
- pulumi_digitalocean/database_db.py +19 -12
- pulumi_digitalocean/database_firewall.py +78 -75
- pulumi_digitalocean/database_kafka_config.py +1040 -0
- pulumi_digitalocean/database_kafka_topic.py +66 -61
- pulumi_digitalocean/database_mongodb_config.py +452 -0
- pulumi_digitalocean/database_mysql_config.py +15 -12
- pulumi_digitalocean/database_opensearch_config.py +2069 -0
- pulumi_digitalocean/database_postgresql_config.py +2614 -0
- pulumi_digitalocean/database_redis_config.py +29 -12
- pulumi_digitalocean/database_replica.py +29 -24
- pulumi_digitalocean/database_user.py +90 -75
- pulumi_digitalocean/dns_record.py +13 -8
- pulumi_digitalocean/domain.py +7 -6
- pulumi_digitalocean/droplet.py +89 -31
- pulumi_digitalocean/droplet_autoscale.py +474 -0
- pulumi_digitalocean/droplet_snapshot.py +23 -14
- pulumi_digitalocean/firewall.py +118 -106
- pulumi_digitalocean/floating_ip.py +19 -16
- pulumi_digitalocean/floating_ip_assignment.py +19 -16
- pulumi_digitalocean/get_account.py +18 -9
- pulumi_digitalocean/get_app.py +57 -10
- pulumi_digitalocean/get_certificate.py +19 -9
- pulumi_digitalocean/get_container_registry.py +19 -9
- pulumi_digitalocean/get_database_ca.py +14 -9
- pulumi_digitalocean/get_database_cluster.py +119 -11
- pulumi_digitalocean/get_database_connection_pool.py +25 -9
- pulumi_digitalocean/get_database_replica.py +29 -9
- pulumi_digitalocean/get_database_user.py +21 -9
- pulumi_digitalocean/get_domain.py +16 -9
- pulumi_digitalocean/get_domains.py +34 -27
- pulumi_digitalocean/get_droplet.py +66 -23
- pulumi_digitalocean/get_droplet_autoscale.py +197 -0
- pulumi_digitalocean/get_droplet_snapshot.py +36 -23
- pulumi_digitalocean/get_droplets.py +80 -54
- pulumi_digitalocean/get_firewall.py +29 -13
- pulumi_digitalocean/get_floating_ip.py +16 -9
- pulumi_digitalocean/get_image.py +42 -27
- pulumi_digitalocean/get_images.py +56 -53
- pulumi_digitalocean/get_kubernetes_cluster.py +53 -6
- pulumi_digitalocean/get_kubernetes_versions.py +43 -41
- pulumi_digitalocean/get_load_balancer.py +81 -17
- pulumi_digitalocean/get_project.py +23 -9
- pulumi_digitalocean/get_projects.py +56 -53
- pulumi_digitalocean/get_record.py +23 -9
- pulumi_digitalocean/get_records.py +62 -13
- pulumi_digitalocean/get_region.py +17 -9
- pulumi_digitalocean/get_regions.py +56 -53
- pulumi_digitalocean/get_reserved_ip.py +16 -9
- pulumi_digitalocean/get_reserved_ipv6.py +118 -0
- pulumi_digitalocean/get_sizes.py +24 -13
- pulumi_digitalocean/get_spaces_bucket.py +18 -9
- pulumi_digitalocean/get_spaces_bucket_object.py +41 -14
- pulumi_digitalocean/get_spaces_bucket_objects.py +26 -5
- pulumi_digitalocean/get_spaces_buckets.py +48 -45
- pulumi_digitalocean/get_ssh_key.py +27 -19
- pulumi_digitalocean/get_ssh_keys.py +40 -37
- pulumi_digitalocean/get_tag.py +31 -19
- pulumi_digitalocean/get_tags.py +32 -25
- pulumi_digitalocean/get_volume.py +35 -23
- pulumi_digitalocean/get_volume_snapshot.py +35 -21
- pulumi_digitalocean/get_vpc.py +33 -23
- pulumi_digitalocean/get_vpc_peering.py +244 -0
- pulumi_digitalocean/kubernetes_cluster.py +86 -35
- pulumi_digitalocean/kubernetes_node_pool.py +46 -43
- pulumi_digitalocean/load_balancer.py +320 -157
- pulumi_digitalocean/monitor_alert.py +17 -12
- pulumi_digitalocean/outputs.py +3419 -344
- pulumi_digitalocean/project.py +19 -16
- pulumi_digitalocean/project_resources.py +11 -8
- pulumi_digitalocean/provider.py +5 -0
- pulumi_digitalocean/pulumi-plugin.json +2 -1
- pulumi_digitalocean/reserved_ip.py +19 -16
- pulumi_digitalocean/reserved_ip_assignment.py +19 -16
- pulumi_digitalocean/reserved_ipv6.py +232 -0
- pulumi_digitalocean/reserved_ipv6_assignment.py +171 -0
- pulumi_digitalocean/spaces_bucket.py +70 -79
- pulumi_digitalocean/spaces_bucket_cors_configuration.py +30 -25
- pulumi_digitalocean/spaces_bucket_object.py +11 -12
- pulumi_digitalocean/spaces_bucket_policy.py +21 -16
- pulumi_digitalocean/ssh_key.py +19 -10
- pulumi_digitalocean/tag.py +13 -10
- pulumi_digitalocean/uptime_alert.py +10 -5
- pulumi_digitalocean/uptime_check.py +5 -0
- pulumi_digitalocean/volume.py +47 -50
- pulumi_digitalocean/volume_attachment.py +25 -20
- pulumi_digitalocean/volume_snapshot.py +17 -10
- pulumi_digitalocean/vpc.py +27 -22
- pulumi_digitalocean/vpc_peering.py +378 -0
- {pulumi_digitalocean-4.27.0.dist-info → pulumi_digitalocean-4.39.0a1736833057.dist-info}/METADATA +7 -6
- pulumi_digitalocean-4.39.0a1736833057.dist-info/RECORD +108 -0
- {pulumi_digitalocean-4.27.0.dist-info → pulumi_digitalocean-4.39.0a1736833057.dist-info}/WHEEL +1 -1
- pulumi_digitalocean-4.27.0.dist-info/RECORD +0 -97
- {pulumi_digitalocean-4.27.0.dist-info → pulumi_digitalocean-4.39.0a1736833057.dist-info}/top_level.txt +0 -0
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = ['DatabaseConnectionPoolArgs', 'DatabaseConnectionPool']
|
|
@@ -329,25 +334,25 @@ class DatabaseConnectionPool(pulumi.CustomResource):
|
|
|
329
334
|
## Example Usage
|
|
330
335
|
|
|
331
336
|
### Create a new PostgreSQL database connection pool
|
|
332
|
-
<!--Start PulumiCodeChooser -->
|
|
333
337
|
```python
|
|
334
338
|
import pulumi
|
|
335
339
|
import pulumi_digitalocean as digitalocean
|
|
336
340
|
|
|
337
341
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
342
|
+
name="example-postgres-cluster",
|
|
338
343
|
engine="pg",
|
|
339
|
-
version="
|
|
340
|
-
size=
|
|
341
|
-
region=
|
|
344
|
+
version="15",
|
|
345
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
346
|
+
region=digitalocean.Region.NYC1,
|
|
342
347
|
node_count=1)
|
|
343
348
|
pool_01 = digitalocean.DatabaseConnectionPool("pool-01",
|
|
344
349
|
cluster_id=postgres_example.id,
|
|
350
|
+
name="pool-01",
|
|
345
351
|
mode="transaction",
|
|
346
352
|
size=20,
|
|
347
353
|
db_name="defaultdb",
|
|
348
354
|
user="doadmin")
|
|
349
355
|
```
|
|
350
|
-
<!--End PulumiCodeChooser -->
|
|
351
356
|
|
|
352
357
|
## Import
|
|
353
358
|
|
|
@@ -380,25 +385,25 @@ class DatabaseConnectionPool(pulumi.CustomResource):
|
|
|
380
385
|
## Example Usage
|
|
381
386
|
|
|
382
387
|
### Create a new PostgreSQL database connection pool
|
|
383
|
-
<!--Start PulumiCodeChooser -->
|
|
384
388
|
```python
|
|
385
389
|
import pulumi
|
|
386
390
|
import pulumi_digitalocean as digitalocean
|
|
387
391
|
|
|
388
392
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
393
|
+
name="example-postgres-cluster",
|
|
389
394
|
engine="pg",
|
|
390
|
-
version="
|
|
391
|
-
size=
|
|
392
|
-
region=
|
|
395
|
+
version="15",
|
|
396
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
397
|
+
region=digitalocean.Region.NYC1,
|
|
393
398
|
node_count=1)
|
|
394
399
|
pool_01 = digitalocean.DatabaseConnectionPool("pool-01",
|
|
395
400
|
cluster_id=postgres_example.id,
|
|
401
|
+
name="pool-01",
|
|
396
402
|
mode="transaction",
|
|
397
403
|
size=20,
|
|
398
404
|
db_name="defaultdb",
|
|
399
405
|
user="doadmin")
|
|
400
406
|
```
|
|
401
|
-
<!--End PulumiCodeChooser -->
|
|
402
407
|
|
|
403
408
|
## Import
|
|
404
409
|
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
|
|
12
17
|
__all__ = ['DatabaseDbArgs', 'DatabaseDb']
|
|
@@ -104,20 +109,21 @@ class DatabaseDb(pulumi.CustomResource):
|
|
|
104
109
|
## Example Usage
|
|
105
110
|
|
|
106
111
|
### Create a new PostgreSQL database
|
|
107
|
-
<!--Start PulumiCodeChooser -->
|
|
108
112
|
```python
|
|
109
113
|
import pulumi
|
|
110
114
|
import pulumi_digitalocean as digitalocean
|
|
111
115
|
|
|
112
116
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
117
|
+
name="example-postgres-cluster",
|
|
113
118
|
engine="pg",
|
|
114
|
-
version="
|
|
115
|
-
size=
|
|
116
|
-
region=
|
|
119
|
+
version="15",
|
|
120
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
121
|
+
region=digitalocean.Region.NYC1,
|
|
117
122
|
node_count=1)
|
|
118
|
-
database_example = digitalocean.DatabaseDb("database-example",
|
|
123
|
+
database_example = digitalocean.DatabaseDb("database-example",
|
|
124
|
+
cluster_id=postgres_example.id,
|
|
125
|
+
name="foobar")
|
|
119
126
|
```
|
|
120
|
-
<!--End PulumiCodeChooser -->
|
|
121
127
|
|
|
122
128
|
## Import
|
|
123
129
|
|
|
@@ -146,20 +152,21 @@ class DatabaseDb(pulumi.CustomResource):
|
|
|
146
152
|
## Example Usage
|
|
147
153
|
|
|
148
154
|
### Create a new PostgreSQL database
|
|
149
|
-
<!--Start PulumiCodeChooser -->
|
|
150
155
|
```python
|
|
151
156
|
import pulumi
|
|
152
157
|
import pulumi_digitalocean as digitalocean
|
|
153
158
|
|
|
154
159
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
160
|
+
name="example-postgres-cluster",
|
|
155
161
|
engine="pg",
|
|
156
|
-
version="
|
|
157
|
-
size=
|
|
158
|
-
region=
|
|
162
|
+
version="15",
|
|
163
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
164
|
+
region=digitalocean.Region.NYC1,
|
|
159
165
|
node_count=1)
|
|
160
|
-
database_example = digitalocean.DatabaseDb("database-example",
|
|
166
|
+
database_example = digitalocean.DatabaseDb("database-example",
|
|
167
|
+
cluster_id=postgres_example.id,
|
|
168
|
+
name="foobar")
|
|
161
169
|
```
|
|
162
|
-
<!--End PulumiCodeChooser -->
|
|
163
170
|
|
|
164
171
|
## Import
|
|
165
172
|
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import copy
|
|
6
6
|
import warnings
|
|
7
|
+
import sys
|
|
7
8
|
import pulumi
|
|
8
9
|
import pulumi.runtime
|
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
11
|
+
if sys.version_info >= (3, 11):
|
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
|
13
|
+
else:
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
|
10
15
|
from . import _utilities
|
|
11
16
|
from . import outputs
|
|
12
17
|
from ._inputs import *
|
|
@@ -97,7 +102,7 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
97
102
|
resource_name: str,
|
|
98
103
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
99
104
|
cluster_id: Optional[pulumi.Input[str]] = None,
|
|
100
|
-
rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
105
|
+
rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseFirewallRuleArgs', 'DatabaseFirewallRuleArgsDict']]]]] = None,
|
|
101
106
|
__props__=None):
|
|
102
107
|
"""
|
|
103
108
|
Provides a DigitalOcean database firewall resource allowing you to restrict
|
|
@@ -108,84 +113,83 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
108
113
|
|
|
109
114
|
### Create a new database firewall allowing multiple IP addresses
|
|
110
115
|
|
|
111
|
-
<!--Start PulumiCodeChooser -->
|
|
112
116
|
```python
|
|
113
117
|
import pulumi
|
|
114
118
|
import pulumi_digitalocean as digitalocean
|
|
115
119
|
|
|
116
120
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
121
|
+
name="example-postgres-cluster",
|
|
117
122
|
engine="pg",
|
|
118
|
-
version="
|
|
119
|
-
size=
|
|
120
|
-
region=
|
|
123
|
+
version="15",
|
|
124
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
125
|
+
region=digitalocean.Region.NYC1,
|
|
121
126
|
node_count=1)
|
|
122
127
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
123
128
|
cluster_id=postgres_example.id,
|
|
124
129
|
rules=[
|
|
125
|
-
|
|
126
|
-
type
|
|
127
|
-
value
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
type
|
|
131
|
-
value
|
|
132
|
-
|
|
130
|
+
{
|
|
131
|
+
"type": "ip_addr",
|
|
132
|
+
"value": "192.168.1.1",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"type": "ip_addr",
|
|
136
|
+
"value": "192.0.2.0",
|
|
137
|
+
},
|
|
133
138
|
])
|
|
134
139
|
```
|
|
135
|
-
<!--End PulumiCodeChooser -->
|
|
136
140
|
|
|
137
141
|
### Create a new database firewall allowing a Droplet
|
|
138
142
|
|
|
139
|
-
<!--Start PulumiCodeChooser -->
|
|
140
143
|
```python
|
|
141
144
|
import pulumi
|
|
142
145
|
import pulumi_digitalocean as digitalocean
|
|
143
146
|
|
|
144
147
|
web = digitalocean.Droplet("web",
|
|
145
|
-
|
|
148
|
+
name="web-01",
|
|
149
|
+
size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
|
|
146
150
|
image="ubuntu-22-04-x64",
|
|
147
|
-
region=
|
|
151
|
+
region=digitalocean.Region.NYC3)
|
|
148
152
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
153
|
+
name="example-postgres-cluster",
|
|
149
154
|
engine="pg",
|
|
150
|
-
version="
|
|
151
|
-
size=
|
|
152
|
-
region=
|
|
155
|
+
version="15",
|
|
156
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
157
|
+
region=digitalocean.Region.NYC1,
|
|
153
158
|
node_count=1)
|
|
154
159
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
155
160
|
cluster_id=postgres_example.id,
|
|
156
|
-
rules=[
|
|
157
|
-
type
|
|
158
|
-
value
|
|
159
|
-
|
|
161
|
+
rules=[{
|
|
162
|
+
"type": "droplet",
|
|
163
|
+
"value": web.id,
|
|
164
|
+
}])
|
|
160
165
|
```
|
|
161
|
-
<!--End PulumiCodeChooser -->
|
|
162
166
|
|
|
163
167
|
### Create a new database firewall for a database replica
|
|
164
168
|
|
|
165
|
-
<!--Start PulumiCodeChooser -->
|
|
166
169
|
```python
|
|
167
170
|
import pulumi
|
|
168
171
|
import pulumi_digitalocean as digitalocean
|
|
169
172
|
|
|
170
173
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
174
|
+
name="example-postgres-cluster",
|
|
171
175
|
engine="pg",
|
|
172
|
-
version="
|
|
173
|
-
size=
|
|
174
|
-
region=
|
|
176
|
+
version="15",
|
|
177
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
178
|
+
region=digitalocean.Region.NYC1,
|
|
175
179
|
node_count=1)
|
|
176
180
|
replica_example = digitalocean.DatabaseReplica("replica-example",
|
|
177
181
|
cluster_id=postgres_example.id,
|
|
178
|
-
|
|
179
|
-
|
|
182
|
+
name="replica-example",
|
|
183
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
184
|
+
region=digitalocean.Region.NYC1)
|
|
180
185
|
# Create firewall rule for database replica
|
|
181
186
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
182
187
|
cluster_id=replica_example.uuid,
|
|
183
|
-
rules=[
|
|
184
|
-
type
|
|
185
|
-
value
|
|
186
|
-
|
|
188
|
+
rules=[{
|
|
189
|
+
"type": "ip_addr",
|
|
190
|
+
"value": "192.168.1.1",
|
|
191
|
+
}])
|
|
187
192
|
```
|
|
188
|
-
<!--End PulumiCodeChooser -->
|
|
189
193
|
|
|
190
194
|
## Import
|
|
191
195
|
|
|
@@ -200,7 +204,7 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
200
204
|
:param str resource_name: The name of the resource.
|
|
201
205
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
202
206
|
:param pulumi.Input[str] cluster_id: The ID of the target database cluster.
|
|
203
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
207
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseFirewallRuleArgs', 'DatabaseFirewallRuleArgsDict']]]] rules: A rule specifying a resource allowed to access the database cluster. The following arguments must be specified:
|
|
204
208
|
"""
|
|
205
209
|
...
|
|
206
210
|
@overload
|
|
@@ -217,84 +221,83 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
217
221
|
|
|
218
222
|
### Create a new database firewall allowing multiple IP addresses
|
|
219
223
|
|
|
220
|
-
<!--Start PulumiCodeChooser -->
|
|
221
224
|
```python
|
|
222
225
|
import pulumi
|
|
223
226
|
import pulumi_digitalocean as digitalocean
|
|
224
227
|
|
|
225
228
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
229
|
+
name="example-postgres-cluster",
|
|
226
230
|
engine="pg",
|
|
227
|
-
version="
|
|
228
|
-
size=
|
|
229
|
-
region=
|
|
231
|
+
version="15",
|
|
232
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
233
|
+
region=digitalocean.Region.NYC1,
|
|
230
234
|
node_count=1)
|
|
231
235
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
232
236
|
cluster_id=postgres_example.id,
|
|
233
237
|
rules=[
|
|
234
|
-
|
|
235
|
-
type
|
|
236
|
-
value
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
type
|
|
240
|
-
value
|
|
241
|
-
|
|
238
|
+
{
|
|
239
|
+
"type": "ip_addr",
|
|
240
|
+
"value": "192.168.1.1",
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"type": "ip_addr",
|
|
244
|
+
"value": "192.0.2.0",
|
|
245
|
+
},
|
|
242
246
|
])
|
|
243
247
|
```
|
|
244
|
-
<!--End PulumiCodeChooser -->
|
|
245
248
|
|
|
246
249
|
### Create a new database firewall allowing a Droplet
|
|
247
250
|
|
|
248
|
-
<!--Start PulumiCodeChooser -->
|
|
249
251
|
```python
|
|
250
252
|
import pulumi
|
|
251
253
|
import pulumi_digitalocean as digitalocean
|
|
252
254
|
|
|
253
255
|
web = digitalocean.Droplet("web",
|
|
254
|
-
|
|
256
|
+
name="web-01",
|
|
257
|
+
size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
|
|
255
258
|
image="ubuntu-22-04-x64",
|
|
256
|
-
region=
|
|
259
|
+
region=digitalocean.Region.NYC3)
|
|
257
260
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
261
|
+
name="example-postgres-cluster",
|
|
258
262
|
engine="pg",
|
|
259
|
-
version="
|
|
260
|
-
size=
|
|
261
|
-
region=
|
|
263
|
+
version="15",
|
|
264
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
265
|
+
region=digitalocean.Region.NYC1,
|
|
262
266
|
node_count=1)
|
|
263
267
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
264
268
|
cluster_id=postgres_example.id,
|
|
265
|
-
rules=[
|
|
266
|
-
type
|
|
267
|
-
value
|
|
268
|
-
|
|
269
|
+
rules=[{
|
|
270
|
+
"type": "droplet",
|
|
271
|
+
"value": web.id,
|
|
272
|
+
}])
|
|
269
273
|
```
|
|
270
|
-
<!--End PulumiCodeChooser -->
|
|
271
274
|
|
|
272
275
|
### Create a new database firewall for a database replica
|
|
273
276
|
|
|
274
|
-
<!--Start PulumiCodeChooser -->
|
|
275
277
|
```python
|
|
276
278
|
import pulumi
|
|
277
279
|
import pulumi_digitalocean as digitalocean
|
|
278
280
|
|
|
279
281
|
postgres_example = digitalocean.DatabaseCluster("postgres-example",
|
|
282
|
+
name="example-postgres-cluster",
|
|
280
283
|
engine="pg",
|
|
281
|
-
version="
|
|
282
|
-
size=
|
|
283
|
-
region=
|
|
284
|
+
version="15",
|
|
285
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
286
|
+
region=digitalocean.Region.NYC1,
|
|
284
287
|
node_count=1)
|
|
285
288
|
replica_example = digitalocean.DatabaseReplica("replica-example",
|
|
286
289
|
cluster_id=postgres_example.id,
|
|
287
|
-
|
|
288
|
-
|
|
290
|
+
name="replica-example",
|
|
291
|
+
size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
|
|
292
|
+
region=digitalocean.Region.NYC1)
|
|
289
293
|
# Create firewall rule for database replica
|
|
290
294
|
example_fw = digitalocean.DatabaseFirewall("example-fw",
|
|
291
295
|
cluster_id=replica_example.uuid,
|
|
292
|
-
rules=[
|
|
293
|
-
type
|
|
294
|
-
value
|
|
295
|
-
|
|
296
|
+
rules=[{
|
|
297
|
+
"type": "ip_addr",
|
|
298
|
+
"value": "192.168.1.1",
|
|
299
|
+
}])
|
|
296
300
|
```
|
|
297
|
-
<!--End PulumiCodeChooser -->
|
|
298
301
|
|
|
299
302
|
## Import
|
|
300
303
|
|
|
@@ -322,7 +325,7 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
322
325
|
resource_name: str,
|
|
323
326
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
324
327
|
cluster_id: Optional[pulumi.Input[str]] = None,
|
|
325
|
-
rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
328
|
+
rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseFirewallRuleArgs', 'DatabaseFirewallRuleArgsDict']]]]] = None,
|
|
326
329
|
__props__=None):
|
|
327
330
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
328
331
|
if not isinstance(opts, pulumi.ResourceOptions):
|
|
@@ -349,7 +352,7 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
349
352
|
id: pulumi.Input[str],
|
|
350
353
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
351
354
|
cluster_id: Optional[pulumi.Input[str]] = None,
|
|
352
|
-
rules: Optional[pulumi.Input[Sequence[pulumi.Input[
|
|
355
|
+
rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseFirewallRuleArgs', 'DatabaseFirewallRuleArgsDict']]]]] = None) -> 'DatabaseFirewall':
|
|
353
356
|
"""
|
|
354
357
|
Get an existing DatabaseFirewall resource's state with the given name, id, and optional extra
|
|
355
358
|
properties used to qualify the lookup.
|
|
@@ -358,7 +361,7 @@ class DatabaseFirewall(pulumi.CustomResource):
|
|
|
358
361
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
|
359
362
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
360
363
|
:param pulumi.Input[str] cluster_id: The ID of the target database cluster.
|
|
361
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
|
364
|
+
:param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseFirewallRuleArgs', 'DatabaseFirewallRuleArgsDict']]]] rules: A rule specifying a resource allowed to access the database cluster. The following arguments must be specified:
|
|
362
365
|
"""
|
|
363
366
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
364
367
|
|