pulumi-cloudamqp 3.18.0a1710156088__py3-none-any.whl → 3.21.0a1736849154__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.

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