pulumi-cloudamqp 3.18.0a1709359306__py3-none-any.whl → 3.21.0a1736832130__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-cloudamqp might be problematic. Click here for more details.
- pulumi_cloudamqp/__init__.py +9 -0
- pulumi_cloudamqp/_inputs.py +157 -6
- pulumi_cloudamqp/_utilities.py +41 -5
- pulumi_cloudamqp/account_action.py +5 -0
- pulumi_cloudamqp/alarm.py +5 -124
- pulumi_cloudamqp/config/__init__.pyi +5 -0
- pulumi_cloudamqp/config/vars.py +5 -0
- pulumi_cloudamqp/custom_domain.py +9 -2
- pulumi_cloudamqp/extra_disk_size.py +46 -15
- pulumi_cloudamqp/get_account.py +12 -71
- pulumi_cloudamqp/get_account_vpcs.py +14 -5
- pulumi_cloudamqp/get_alarm.py +31 -7
- pulumi_cloudamqp/get_credentials.py +19 -7
- pulumi_cloudamqp/get_instance.py +30 -47
- pulumi_cloudamqp/get_nodes.py +22 -7
- pulumi_cloudamqp/get_notification.py +25 -7
- pulumi_cloudamqp/get_plugins.py +51 -10
- pulumi_cloudamqp/get_plugins_community.py +51 -10
- pulumi_cloudamqp/get_upgradable_versions.py +19 -7
- pulumi_cloudamqp/get_vpc_gcp_info.py +28 -9
- pulumi_cloudamqp/get_vpc_info.py +25 -9
- pulumi_cloudamqp/instance.py +70 -115
- pulumi_cloudamqp/integration_aws_eventbridge.py +11 -2
- pulumi_cloudamqp/integration_log.py +432 -43
- pulumi_cloudamqp/integration_metric.py +326 -23
- pulumi_cloudamqp/node_actions.py +59 -46
- pulumi_cloudamqp/notification.py +118 -61
- pulumi_cloudamqp/outputs.py +71 -60
- pulumi_cloudamqp/plugin.py +54 -35
- pulumi_cloudamqp/plugin_community.py +56 -37
- pulumi_cloudamqp/privatelink_aws.py +49 -60
- pulumi_cloudamqp/privatelink_azure.py +49 -60
- pulumi_cloudamqp/provider.py +5 -5
- pulumi_cloudamqp/pulumi-plugin.json +2 -1
- pulumi_cloudamqp/rabbit_configuration.py +5 -0
- pulumi_cloudamqp/security_firewall.py +70 -24
- pulumi_cloudamqp/upgrade_lavinmq.py +276 -0
- pulumi_cloudamqp/upgrade_rabbitmq.py +300 -27
- pulumi_cloudamqp/vpc.py +17 -6
- pulumi_cloudamqp/vpc_connect.py +63 -80
- pulumi_cloudamqp/vpc_gcp_peering.py +310 -103
- pulumi_cloudamqp/vpc_peering.py +19 -2
- pulumi_cloudamqp/webhook.py +91 -84
- {pulumi_cloudamqp-3.18.0a1709359306.dist-info → pulumi_cloudamqp-3.21.0a1736832130.dist-info}/METADATA +7 -6
- pulumi_cloudamqp-3.21.0a1736832130.dist-info/RECORD +49 -0
- {pulumi_cloudamqp-3.18.0a1709359306.dist-info → pulumi_cloudamqp-3.21.0a1736832130.dist-info}/WHEEL +1 -1
- pulumi_cloudamqp-3.18.0a1709359306.dist-info/RECORD +0 -48
- {pulumi_cloudamqp-3.18.0a1709359306.dist-info → pulumi_cloudamqp-3.21.0a1736832130.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__ = ['VpcGcpPeeringArgs', 'VpcGcpPeering']
|
|
@@ -22,7 +27,7 @@ class VpcGcpPeeringArgs:
|
|
|
22
27
|
wait_on_peering_status: Optional[pulumi.Input[bool]] = None):
|
|
23
28
|
"""
|
|
24
29
|
The set of arguments for constructing a VpcGcpPeering resource.
|
|
25
|
-
:param pulumi.Input[str] peer_network_uri: Network
|
|
30
|
+
:param pulumi.Input[str] peer_network_uri: Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
26
31
|
:param pulumi.Input[int] instance_id: The CloudAMQP instance identifier. *Deprecated from v1.16.0*
|
|
27
32
|
:param pulumi.Input[int] sleep: Configurable sleep time (seconds) between retries when requesting or reading
|
|
28
33
|
peering. Default set to 10 seconds. *Available from v1.29.0*
|
|
@@ -48,7 +53,7 @@ class VpcGcpPeeringArgs:
|
|
|
48
53
|
@pulumi.getter(name="peerNetworkUri")
|
|
49
54
|
def peer_network_uri(self) -> pulumi.Input[str]:
|
|
50
55
|
"""
|
|
51
|
-
Network
|
|
56
|
+
Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
52
57
|
"""
|
|
53
58
|
return pulumi.get(self, "peer_network_uri")
|
|
54
59
|
|
|
@@ -136,7 +141,7 @@ class _VpcGcpPeeringState:
|
|
|
136
141
|
Input properties used for looking up and filtering VpcGcpPeering resources.
|
|
137
142
|
:param pulumi.Input[bool] auto_create_routes: VPC peering auto created routes
|
|
138
143
|
:param pulumi.Input[int] instance_id: The CloudAMQP instance identifier. *Deprecated from v1.16.0*
|
|
139
|
-
:param pulumi.Input[str] peer_network_uri: Network
|
|
144
|
+
:param pulumi.Input[str] peer_network_uri: Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
140
145
|
:param pulumi.Input[int] sleep: Configurable sleep time (seconds) between retries when requesting or reading
|
|
141
146
|
peering. Default set to 10 seconds. *Available from v1.29.0*
|
|
142
147
|
:param pulumi.Input[str] state: VPC peering state
|
|
@@ -194,7 +199,7 @@ class _VpcGcpPeeringState:
|
|
|
194
199
|
@pulumi.getter(name="peerNetworkUri")
|
|
195
200
|
def peer_network_uri(self) -> Optional[pulumi.Input[str]]:
|
|
196
201
|
"""
|
|
197
|
-
Network
|
|
202
|
+
Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
198
203
|
"""
|
|
199
204
|
return pulumi.get(self, "peer_network_uri")
|
|
200
205
|
|
|
@@ -291,7 +296,10 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
291
296
|
wait_on_peering_status: Optional[pulumi.Input[bool]] = None,
|
|
292
297
|
__props__=None):
|
|
293
298
|
"""
|
|
294
|
-
This resouce creates a VPC peering configuration for the CloudAMQP instance. The configuration will
|
|
299
|
+
This resouce creates a VPC peering configuration for the CloudAMQP instance. The configuration will
|
|
300
|
+
connect to another VPC network hosted on Google Cloud Platform (GCP). See the
|
|
301
|
+
[GCP documentation](https://cloud.google.com/vpc/docs/using-vpc-peering) for more information on how
|
|
302
|
+
to create the VPC peering configuration.
|
|
295
303
|
|
|
296
304
|
> **Note:** Creating a VPC peering will automatically add firewall rules for the peered subnet.
|
|
297
305
|
|
|
@@ -300,23 +308,110 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
300
308
|
<i>Default VPC peering firewall rule</i>
|
|
301
309
|
</summary>
|
|
302
310
|
|
|
311
|
+
## Example Usage
|
|
312
|
+
|
|
313
|
+
<details>
|
|
314
|
+
<summary>
|
|
315
|
+
<b>
|
|
316
|
+
<i>VPC peering before v1.16.0</i>
|
|
317
|
+
</b>
|
|
318
|
+
</summary>
|
|
319
|
+
|
|
303
320
|
```python
|
|
304
321
|
import pulumi
|
|
322
|
+
import pulumi_cloudamqp as cloudamqp
|
|
323
|
+
|
|
324
|
+
# CloudAMQP instance
|
|
325
|
+
instance = cloudamqp.Instance("instance",
|
|
326
|
+
name="terraform-vpc-peering",
|
|
327
|
+
plan="bunny-1",
|
|
328
|
+
region="google-compute-engine::europe-north1",
|
|
329
|
+
tags=["terraform"],
|
|
330
|
+
vpc_subnet="10.40.72.0/24")
|
|
331
|
+
# VPC information
|
|
332
|
+
vpc_info = instance.id.apply(lambda id: cloudamqp.get_vpc_gcp_info_output(instance_id=id))
|
|
333
|
+
# VPC peering configuration
|
|
334
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
335
|
+
instance_id=instance.id,
|
|
336
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
305
337
|
```
|
|
306
338
|
|
|
307
339
|
</details>
|
|
308
340
|
|
|
309
|
-
|
|
341
|
+
<details>
|
|
342
|
+
<summary>
|
|
343
|
+
<b>
|
|
344
|
+
<i>VPC peering from v1.16.0 (Managed VPC)</i>
|
|
345
|
+
</b>
|
|
346
|
+
</summary>
|
|
347
|
+
|
|
348
|
+
```python
|
|
349
|
+
import pulumi
|
|
350
|
+
import pulumi_cloudamqp as cloudamqp
|
|
310
351
|
|
|
311
|
-
|
|
352
|
+
# Managed VPC resource
|
|
353
|
+
vpc = cloudamqp.Vpc("vpc",
|
|
354
|
+
name="<VPC name>",
|
|
355
|
+
region="google-compute-engine::europe-north1",
|
|
356
|
+
subnet="10.56.72.0/24",
|
|
357
|
+
tags=[])
|
|
358
|
+
# CloudAMQP instance
|
|
359
|
+
instance = cloudamqp.Instance("instance",
|
|
360
|
+
name="terraform-vpc-peering",
|
|
361
|
+
plan="bunny-1",
|
|
362
|
+
region="google-compute-engine::europe-north1",
|
|
363
|
+
tags=["terraform"],
|
|
364
|
+
vpc_id=vpc.id)
|
|
365
|
+
# VPC information
|
|
366
|
+
vpc_info = cloudamqp.get_vpc_gcp_info(vpc_id=vpc.info)
|
|
367
|
+
# VPC peering configuration
|
|
368
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
369
|
+
vpc_id=vpc.id,
|
|
370
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
</details>
|
|
374
|
+
|
|
375
|
+
<details>
|
|
376
|
+
<summary>
|
|
377
|
+
<b>
|
|
378
|
+
<i>VPC peering from v1.28.0, wait_on_peering_status </i>
|
|
379
|
+
</b>
|
|
380
|
+
</summary>
|
|
381
|
+
|
|
382
|
+
Default peering request, no need to set `wait_on_peering_status`. It's default set to false and will
|
|
383
|
+
not wait on peering status. Create resource will be considered completed, regardless of the status of the state.
|
|
384
|
+
|
|
385
|
+
```python
|
|
386
|
+
import pulumi
|
|
387
|
+
import pulumi_cloudamqp as cloudamqp
|
|
388
|
+
|
|
389
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
390
|
+
vpc_id=vpc["id"],
|
|
391
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
Peering request and waiting for peering status of the state to change to ACTIVE before the create resource is consider complete.
|
|
395
|
+
This is done once both side have done the peering.
|
|
396
|
+
|
|
397
|
+
```python
|
|
398
|
+
import pulumi
|
|
399
|
+
import pulumi_cloudamqp as cloudamqp
|
|
400
|
+
|
|
401
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
402
|
+
vpc_id=vpc["id"],
|
|
403
|
+
wait_on_peering_status=True,
|
|
404
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
</details>
|
|
312
408
|
|
|
313
|
-
## Example Usage
|
|
314
409
|
### With Additional Firewall Rules
|
|
315
410
|
|
|
316
411
|
<details>
|
|
317
412
|
<summary>
|
|
318
413
|
<b>
|
|
319
|
-
<i>VPC peering
|
|
414
|
+
<i>VPC peering before v1.16.0</i>
|
|
320
415
|
</b>
|
|
321
416
|
</summary>
|
|
322
417
|
|
|
@@ -325,38 +420,38 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
325
420
|
import pulumi_cloudamqp as cloudamqp
|
|
326
421
|
|
|
327
422
|
# VPC peering configuration
|
|
328
|
-
vpc_peering_request = cloudamqp.VpcGcpPeering("
|
|
329
|
-
instance_id=
|
|
330
|
-
peer_network_uri=
|
|
423
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
424
|
+
instance_id=instance["id"],
|
|
425
|
+
peer_network_uri=peer_network_uri)
|
|
331
426
|
# Firewall rules
|
|
332
|
-
firewall_settings = cloudamqp.SecurityFirewall("
|
|
333
|
-
instance_id=
|
|
427
|
+
firewall_settings = cloudamqp.SecurityFirewall("firewall_settings",
|
|
428
|
+
instance_id=instance["id"],
|
|
334
429
|
rules=[
|
|
335
|
-
|
|
336
|
-
ip
|
|
337
|
-
ports
|
|
338
|
-
services
|
|
430
|
+
{
|
|
431
|
+
"ip": peer_subnet,
|
|
432
|
+
"ports": [15672],
|
|
433
|
+
"services": [
|
|
339
434
|
"AMQP",
|
|
340
435
|
"AMQPS",
|
|
341
436
|
"STREAM",
|
|
342
437
|
"STREAM_SSL",
|
|
343
438
|
],
|
|
344
|
-
description
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
ip
|
|
348
|
-
ports
|
|
439
|
+
"description": "VPC peering for <NETWORK>",
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"ip": "192.168.0.0/24",
|
|
443
|
+
"ports": [
|
|
349
444
|
4567,
|
|
350
445
|
4568,
|
|
351
446
|
],
|
|
352
|
-
services
|
|
447
|
+
"services": [
|
|
353
448
|
"AMQP",
|
|
354
449
|
"AMQPS",
|
|
355
450
|
"HTTPS",
|
|
356
451
|
],
|
|
357
|
-
|
|
452
|
+
},
|
|
358
453
|
],
|
|
359
|
-
opts=pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
454
|
+
opts = pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
360
455
|
```
|
|
361
456
|
|
|
362
457
|
</details>
|
|
@@ -364,7 +459,7 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
364
459
|
<details>
|
|
365
460
|
<summary>
|
|
366
461
|
<b>
|
|
367
|
-
<i>VPC peering
|
|
462
|
+
<i>VPC peering from v1.16.0 (Managed VPC)</i>
|
|
368
463
|
</b>
|
|
369
464
|
</summary>
|
|
370
465
|
|
|
@@ -373,60 +468,71 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
373
468
|
import pulumi_cloudamqp as cloudamqp
|
|
374
469
|
|
|
375
470
|
# VPC peering configuration
|
|
376
|
-
vpc_peering_request = cloudamqp.VpcGcpPeering("
|
|
377
|
-
vpc_id=
|
|
378
|
-
peer_network_uri=
|
|
471
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
472
|
+
vpc_id=vpc["id"],
|
|
473
|
+
peer_network_uri=peer_network_uri)
|
|
379
474
|
# Firewall rules
|
|
380
|
-
firewall_settings = cloudamqp.SecurityFirewall("
|
|
381
|
-
instance_id=
|
|
475
|
+
firewall_settings = cloudamqp.SecurityFirewall("firewall_settings",
|
|
476
|
+
instance_id=instance["id"],
|
|
382
477
|
rules=[
|
|
383
|
-
|
|
384
|
-
ip
|
|
385
|
-
ports
|
|
386
|
-
services
|
|
478
|
+
{
|
|
479
|
+
"ip": peer_subnet,
|
|
480
|
+
"ports": [15672],
|
|
481
|
+
"services": [
|
|
387
482
|
"AMQP",
|
|
388
483
|
"AMQPS",
|
|
389
484
|
"STREAM",
|
|
390
485
|
"STREAM_SSL",
|
|
391
486
|
],
|
|
392
|
-
description
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
ip
|
|
396
|
-
ports
|
|
397
|
-
services
|
|
398
|
-
description
|
|
399
|
-
|
|
487
|
+
"description": "VPC peering for <NETWORK>",
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"ip": "0.0.0.0/0",
|
|
491
|
+
"ports": [],
|
|
492
|
+
"services": ["HTTPS"],
|
|
493
|
+
"description": "MGMT interface",
|
|
494
|
+
},
|
|
400
495
|
],
|
|
401
|
-
opts=pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
496
|
+
opts = pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
402
497
|
```
|
|
403
498
|
|
|
404
499
|
</details>
|
|
500
|
+
|
|
405
501
|
## Depedency
|
|
406
502
|
|
|
407
|
-
*
|
|
503
|
+
*Before v1.16.0*
|
|
408
504
|
This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id`.
|
|
409
505
|
|
|
410
|
-
*
|
|
411
|
-
This resource depends on CloudAMQP managed VPC identifier, `cloudamqp_vpc.vpc.id` or instance
|
|
506
|
+
*From v1.16.0*
|
|
507
|
+
This resource depends on CloudAMQP managed VPC identifier, `cloudamqp_vpc.vpc.id` or instance
|
|
508
|
+
identifier, `cloudamqp_instance.instance.id`.
|
|
412
509
|
|
|
413
510
|
## Create VPC Peering with additional firewall rules
|
|
414
511
|
|
|
415
|
-
To create a VPC peering configuration with additional firewall rules, it's required to chain the
|
|
416
|
-
|
|
512
|
+
To create a VPC peering configuration with additional firewall rules, it's required to chain the
|
|
513
|
+
SecurityFirewall
|
|
514
|
+
resource to avoid parallel conflicting resource calls. This is done by adding dependency from the
|
|
515
|
+
firewall resource to the VPC peering resource.
|
|
417
516
|
|
|
418
|
-
Furthermore, since all firewall rules are overwritten, the otherwise automatically added rules for
|
|
517
|
+
Furthermore, since all firewall rules are overwritten, the otherwise automatically added rules for
|
|
518
|
+
the VPC peering also needs to be added.
|
|
419
519
|
|
|
420
520
|
See example below.
|
|
421
521
|
|
|
422
522
|
## Import
|
|
423
523
|
|
|
424
|
-
|
|
524
|
+
### Peering network URI
|
|
525
|
+
|
|
526
|
+
This is required to be able to import the correct peering. Following the same format as the argument reference.
|
|
527
|
+
|
|
528
|
+
hcl
|
|
529
|
+
|
|
530
|
+
https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>
|
|
425
531
|
|
|
426
532
|
:param str resource_name: The name of the resource.
|
|
427
533
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
428
534
|
:param pulumi.Input[int] instance_id: The CloudAMQP instance identifier. *Deprecated from v1.16.0*
|
|
429
|
-
:param pulumi.Input[str] peer_network_uri: Network
|
|
535
|
+
:param pulumi.Input[str] peer_network_uri: Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
430
536
|
:param pulumi.Input[int] sleep: Configurable sleep time (seconds) between retries when requesting or reading
|
|
431
537
|
peering. Default set to 10 seconds. *Available from v1.29.0*
|
|
432
538
|
:param pulumi.Input[int] timeout: Configurable timeout time (seconds) before retries times out. Default set
|
|
@@ -442,7 +548,10 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
442
548
|
args: VpcGcpPeeringArgs,
|
|
443
549
|
opts: Optional[pulumi.ResourceOptions] = None):
|
|
444
550
|
"""
|
|
445
|
-
This resouce creates a VPC peering configuration for the CloudAMQP instance. The configuration will
|
|
551
|
+
This resouce creates a VPC peering configuration for the CloudAMQP instance. The configuration will
|
|
552
|
+
connect to another VPC network hosted on Google Cloud Platform (GCP). See the
|
|
553
|
+
[GCP documentation](https://cloud.google.com/vpc/docs/using-vpc-peering) for more information on how
|
|
554
|
+
to create the VPC peering configuration.
|
|
446
555
|
|
|
447
556
|
> **Note:** Creating a VPC peering will automatically add firewall rules for the peered subnet.
|
|
448
557
|
|
|
@@ -451,23 +560,110 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
451
560
|
<i>Default VPC peering firewall rule</i>
|
|
452
561
|
</summary>
|
|
453
562
|
|
|
563
|
+
## Example Usage
|
|
564
|
+
|
|
565
|
+
<details>
|
|
566
|
+
<summary>
|
|
567
|
+
<b>
|
|
568
|
+
<i>VPC peering before v1.16.0</i>
|
|
569
|
+
</b>
|
|
570
|
+
</summary>
|
|
571
|
+
|
|
454
572
|
```python
|
|
455
573
|
import pulumi
|
|
574
|
+
import pulumi_cloudamqp as cloudamqp
|
|
575
|
+
|
|
576
|
+
# CloudAMQP instance
|
|
577
|
+
instance = cloudamqp.Instance("instance",
|
|
578
|
+
name="terraform-vpc-peering",
|
|
579
|
+
plan="bunny-1",
|
|
580
|
+
region="google-compute-engine::europe-north1",
|
|
581
|
+
tags=["terraform"],
|
|
582
|
+
vpc_subnet="10.40.72.0/24")
|
|
583
|
+
# VPC information
|
|
584
|
+
vpc_info = instance.id.apply(lambda id: cloudamqp.get_vpc_gcp_info_output(instance_id=id))
|
|
585
|
+
# VPC peering configuration
|
|
586
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
587
|
+
instance_id=instance.id,
|
|
588
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
456
589
|
```
|
|
457
590
|
|
|
458
591
|
</details>
|
|
459
592
|
|
|
460
|
-
|
|
593
|
+
<details>
|
|
594
|
+
<summary>
|
|
595
|
+
<b>
|
|
596
|
+
<i>VPC peering from v1.16.0 (Managed VPC)</i>
|
|
597
|
+
</b>
|
|
598
|
+
</summary>
|
|
599
|
+
|
|
600
|
+
```python
|
|
601
|
+
import pulumi
|
|
602
|
+
import pulumi_cloudamqp as cloudamqp
|
|
461
603
|
|
|
462
|
-
|
|
604
|
+
# Managed VPC resource
|
|
605
|
+
vpc = cloudamqp.Vpc("vpc",
|
|
606
|
+
name="<VPC name>",
|
|
607
|
+
region="google-compute-engine::europe-north1",
|
|
608
|
+
subnet="10.56.72.0/24",
|
|
609
|
+
tags=[])
|
|
610
|
+
# CloudAMQP instance
|
|
611
|
+
instance = cloudamqp.Instance("instance",
|
|
612
|
+
name="terraform-vpc-peering",
|
|
613
|
+
plan="bunny-1",
|
|
614
|
+
region="google-compute-engine::europe-north1",
|
|
615
|
+
tags=["terraform"],
|
|
616
|
+
vpc_id=vpc.id)
|
|
617
|
+
# VPC information
|
|
618
|
+
vpc_info = cloudamqp.get_vpc_gcp_info(vpc_id=vpc.info)
|
|
619
|
+
# VPC peering configuration
|
|
620
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
621
|
+
vpc_id=vpc.id,
|
|
622
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
</details>
|
|
626
|
+
|
|
627
|
+
<details>
|
|
628
|
+
<summary>
|
|
629
|
+
<b>
|
|
630
|
+
<i>VPC peering from v1.28.0, wait_on_peering_status </i>
|
|
631
|
+
</b>
|
|
632
|
+
</summary>
|
|
633
|
+
|
|
634
|
+
Default peering request, no need to set `wait_on_peering_status`. It's default set to false and will
|
|
635
|
+
not wait on peering status. Create resource will be considered completed, regardless of the status of the state.
|
|
636
|
+
|
|
637
|
+
```python
|
|
638
|
+
import pulumi
|
|
639
|
+
import pulumi_cloudamqp as cloudamqp
|
|
640
|
+
|
|
641
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
642
|
+
vpc_id=vpc["id"],
|
|
643
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
Peering request and waiting for peering status of the state to change to ACTIVE before the create resource is consider complete.
|
|
647
|
+
This is done once both side have done the peering.
|
|
648
|
+
|
|
649
|
+
```python
|
|
650
|
+
import pulumi
|
|
651
|
+
import pulumi_cloudamqp as cloudamqp
|
|
652
|
+
|
|
653
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
654
|
+
vpc_id=vpc["id"],
|
|
655
|
+
wait_on_peering_status=True,
|
|
656
|
+
peer_network_uri="https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>")
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
</details>
|
|
463
660
|
|
|
464
|
-
## Example Usage
|
|
465
661
|
### With Additional Firewall Rules
|
|
466
662
|
|
|
467
663
|
<details>
|
|
468
664
|
<summary>
|
|
469
665
|
<b>
|
|
470
|
-
<i>VPC peering
|
|
666
|
+
<i>VPC peering before v1.16.0</i>
|
|
471
667
|
</b>
|
|
472
668
|
</summary>
|
|
473
669
|
|
|
@@ -476,38 +672,38 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
476
672
|
import pulumi_cloudamqp as cloudamqp
|
|
477
673
|
|
|
478
674
|
# VPC peering configuration
|
|
479
|
-
vpc_peering_request = cloudamqp.VpcGcpPeering("
|
|
480
|
-
instance_id=
|
|
481
|
-
peer_network_uri=
|
|
675
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
676
|
+
instance_id=instance["id"],
|
|
677
|
+
peer_network_uri=peer_network_uri)
|
|
482
678
|
# Firewall rules
|
|
483
|
-
firewall_settings = cloudamqp.SecurityFirewall("
|
|
484
|
-
instance_id=
|
|
679
|
+
firewall_settings = cloudamqp.SecurityFirewall("firewall_settings",
|
|
680
|
+
instance_id=instance["id"],
|
|
485
681
|
rules=[
|
|
486
|
-
|
|
487
|
-
ip
|
|
488
|
-
ports
|
|
489
|
-
services
|
|
682
|
+
{
|
|
683
|
+
"ip": peer_subnet,
|
|
684
|
+
"ports": [15672],
|
|
685
|
+
"services": [
|
|
490
686
|
"AMQP",
|
|
491
687
|
"AMQPS",
|
|
492
688
|
"STREAM",
|
|
493
689
|
"STREAM_SSL",
|
|
494
690
|
],
|
|
495
|
-
description
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
ip
|
|
499
|
-
ports
|
|
691
|
+
"description": "VPC peering for <NETWORK>",
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"ip": "192.168.0.0/24",
|
|
695
|
+
"ports": [
|
|
500
696
|
4567,
|
|
501
697
|
4568,
|
|
502
698
|
],
|
|
503
|
-
services
|
|
699
|
+
"services": [
|
|
504
700
|
"AMQP",
|
|
505
701
|
"AMQPS",
|
|
506
702
|
"HTTPS",
|
|
507
703
|
],
|
|
508
|
-
|
|
704
|
+
},
|
|
509
705
|
],
|
|
510
|
-
opts=pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
706
|
+
opts = pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
511
707
|
```
|
|
512
708
|
|
|
513
709
|
</details>
|
|
@@ -515,7 +711,7 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
515
711
|
<details>
|
|
516
712
|
<summary>
|
|
517
713
|
<b>
|
|
518
|
-
<i>VPC peering
|
|
714
|
+
<i>VPC peering from v1.16.0 (Managed VPC)</i>
|
|
519
715
|
</b>
|
|
520
716
|
</summary>
|
|
521
717
|
|
|
@@ -524,55 +720,66 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
524
720
|
import pulumi_cloudamqp as cloudamqp
|
|
525
721
|
|
|
526
722
|
# VPC peering configuration
|
|
527
|
-
vpc_peering_request = cloudamqp.VpcGcpPeering("
|
|
528
|
-
vpc_id=
|
|
529
|
-
peer_network_uri=
|
|
723
|
+
vpc_peering_request = cloudamqp.VpcGcpPeering("vpc_peering_request",
|
|
724
|
+
vpc_id=vpc["id"],
|
|
725
|
+
peer_network_uri=peer_network_uri)
|
|
530
726
|
# Firewall rules
|
|
531
|
-
firewall_settings = cloudamqp.SecurityFirewall("
|
|
532
|
-
instance_id=
|
|
727
|
+
firewall_settings = cloudamqp.SecurityFirewall("firewall_settings",
|
|
728
|
+
instance_id=instance["id"],
|
|
533
729
|
rules=[
|
|
534
|
-
|
|
535
|
-
ip
|
|
536
|
-
ports
|
|
537
|
-
services
|
|
730
|
+
{
|
|
731
|
+
"ip": peer_subnet,
|
|
732
|
+
"ports": [15672],
|
|
733
|
+
"services": [
|
|
538
734
|
"AMQP",
|
|
539
735
|
"AMQPS",
|
|
540
736
|
"STREAM",
|
|
541
737
|
"STREAM_SSL",
|
|
542
738
|
],
|
|
543
|
-
description
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
ip
|
|
547
|
-
ports
|
|
548
|
-
services
|
|
549
|
-
description
|
|
550
|
-
|
|
739
|
+
"description": "VPC peering for <NETWORK>",
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"ip": "0.0.0.0/0",
|
|
743
|
+
"ports": [],
|
|
744
|
+
"services": ["HTTPS"],
|
|
745
|
+
"description": "MGMT interface",
|
|
746
|
+
},
|
|
551
747
|
],
|
|
552
|
-
opts=pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
748
|
+
opts = pulumi.ResourceOptions(depends_on=[vpc_peering_request]))
|
|
553
749
|
```
|
|
554
750
|
|
|
555
751
|
</details>
|
|
752
|
+
|
|
556
753
|
## Depedency
|
|
557
754
|
|
|
558
|
-
*
|
|
755
|
+
*Before v1.16.0*
|
|
559
756
|
This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id`.
|
|
560
757
|
|
|
561
|
-
*
|
|
562
|
-
This resource depends on CloudAMQP managed VPC identifier, `cloudamqp_vpc.vpc.id` or instance
|
|
758
|
+
*From v1.16.0*
|
|
759
|
+
This resource depends on CloudAMQP managed VPC identifier, `cloudamqp_vpc.vpc.id` or instance
|
|
760
|
+
identifier, `cloudamqp_instance.instance.id`.
|
|
563
761
|
|
|
564
762
|
## Create VPC Peering with additional firewall rules
|
|
565
763
|
|
|
566
|
-
To create a VPC peering configuration with additional firewall rules, it's required to chain the
|
|
567
|
-
|
|
764
|
+
To create a VPC peering configuration with additional firewall rules, it's required to chain the
|
|
765
|
+
SecurityFirewall
|
|
766
|
+
resource to avoid parallel conflicting resource calls. This is done by adding dependency from the
|
|
767
|
+
firewall resource to the VPC peering resource.
|
|
568
768
|
|
|
569
|
-
Furthermore, since all firewall rules are overwritten, the otherwise automatically added rules for
|
|
769
|
+
Furthermore, since all firewall rules are overwritten, the otherwise automatically added rules for
|
|
770
|
+
the VPC peering also needs to be added.
|
|
570
771
|
|
|
571
772
|
See example below.
|
|
572
773
|
|
|
573
774
|
## Import
|
|
574
775
|
|
|
575
|
-
|
|
776
|
+
### Peering network URI
|
|
777
|
+
|
|
778
|
+
This is required to be able to import the correct peering. Following the same format as the argument reference.
|
|
779
|
+
|
|
780
|
+
hcl
|
|
781
|
+
|
|
782
|
+
https://www.googleapis.com/compute/v1/projects/<PROJECT-NAME>/global/networks/<VPC-NETWORK-NAME>
|
|
576
783
|
|
|
577
784
|
:param str resource_name: The name of the resource.
|
|
578
785
|
:param VpcGcpPeeringArgs args: The arguments to use to populate this resource's properties.
|
|
@@ -643,7 +850,7 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
643
850
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
644
851
|
:param pulumi.Input[bool] auto_create_routes: VPC peering auto created routes
|
|
645
852
|
:param pulumi.Input[int] instance_id: The CloudAMQP instance identifier. *Deprecated from v1.16.0*
|
|
646
|
-
:param pulumi.Input[str] peer_network_uri: Network
|
|
853
|
+
:param pulumi.Input[str] peer_network_uri: Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
647
854
|
:param pulumi.Input[int] sleep: Configurable sleep time (seconds) between retries when requesting or reading
|
|
648
855
|
peering. Default set to 10 seconds. *Available from v1.29.0*
|
|
649
856
|
:param pulumi.Input[str] state: VPC peering state
|
|
@@ -689,7 +896,7 @@ class VpcGcpPeering(pulumi.CustomResource):
|
|
|
689
896
|
@pulumi.getter(name="peerNetworkUri")
|
|
690
897
|
def peer_network_uri(self) -> pulumi.Output[str]:
|
|
691
898
|
"""
|
|
692
|
-
Network
|
|
899
|
+
Network URI of the VPC network to which you will peer with. See examples above for the format.
|
|
693
900
|
"""
|
|
694
901
|
return pulumi.get(self, "peer_network_uri")
|
|
695
902
|
|