pulumi-gcp 7.24.0a1716588893__py3-none-any.whl → 7.25.0__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.
- pulumi_gcp/__init__.py +88 -0
- pulumi_gcp/accesscontextmanager/service_perimeter_egress_policy.py +0 -64
- pulumi_gcp/accesscontextmanager/service_perimeter_ingress_policy.py +0 -70
- pulumi_gcp/alloydb/backup.py +50 -42
- pulumi_gcp/alloydb/cluster.py +56 -48
- pulumi_gcp/alloydb/instance.py +50 -42
- pulumi_gcp/alloydb/user.py +32 -24
- pulumi_gcp/apigateway/api_config.py +0 -114
- pulumi_gcp/apigateway/gateway.py +0 -44
- pulumi_gcp/apigee/addons_config.py +14 -4
- pulumi_gcp/apigee/endpoint_attachment.py +4 -2
- pulumi_gcp/apigee/env_group.py +4 -2
- pulumi_gcp/apigee/environment.py +4 -2
- pulumi_gcp/apigee/instance.py +22 -8
- pulumi_gcp/apigee/keystores_aliases_self_signed_cert.py +26 -10
- pulumi_gcp/apigee/nat_address.py +10 -2
- pulumi_gcp/apigee/organization.py +18 -6
- pulumi_gcp/apigee/sync_authorization.py +8 -4
- pulumi_gcp/apigee/target_server.py +26 -10
- pulumi_gcp/appengine/_inputs.py +18 -0
- pulumi_gcp/appengine/domain_mapping.py +1 -1
- pulumi_gcp/appengine/outputs.py +16 -0
- pulumi_gcp/apphub/service.py +40 -20
- pulumi_gcp/apphub/service_project_attachment.py +16 -8
- pulumi_gcp/apphub/workload.py +0 -418
- pulumi_gcp/applicationintegration/auth_config.py +4 -2
- pulumi_gcp/artifactregistry/repository.py +14 -12
- pulumi_gcp/backupdisasterrecovery/management_server.py +4 -2
- pulumi_gcp/bigquery/_inputs.py +286 -2
- pulumi_gcp/bigquery/data_transfer_config.py +8 -4
- pulumi_gcp/bigquery/job.py +22 -16
- pulumi_gcp/bigquery/outputs.py +289 -2
- pulumi_gcp/bigquery/table.py +77 -35
- pulumi_gcp/certificateauthority/authority.py +10 -2
- pulumi_gcp/certificateauthority/certificate.py +8 -4
- pulumi_gcp/certificatemanager/certificate.py +84 -80
- pulumi_gcp/certificatemanager/certificate_issuance_config.py +32 -30
- pulumi_gcp/cloudbuild/bitbucket_server_config.py +12 -6
- pulumi_gcp/cloudbuild/trigger.py +22 -14
- pulumi_gcp/cloudbuild/worker_pool.py +12 -6
- pulumi_gcp/cloudbuildv2/connection.py +10 -2
- pulumi_gcp/cloudbuildv2/repository.py +10 -2
- pulumi_gcp/cloudfunctionsv2/function.py +110 -66
- pulumi_gcp/cloudids/endpoint.py +4 -2
- pulumi_gcp/cloudrun/_inputs.py +80 -4
- pulumi_gcp/cloudrun/outputs.py +137 -4
- pulumi_gcp/cloudrunv2/job.py +32 -20
- pulumi_gcp/cloudrunv2/service.py +28 -20
- pulumi_gcp/composer/user_workloads_secret.py +4 -4
- pulumi_gcp/compute/__init__.py +1 -0
- pulumi_gcp/compute/_inputs.py +398 -176
- pulumi_gcp/compute/forwarding_rule.py +225 -817
- pulumi_gcp/compute/get_subnetworks.py +157 -0
- pulumi_gcp/compute/global_forwarding_rule.py +0 -766
- pulumi_gcp/compute/instance_group.py +0 -100
- pulumi_gcp/compute/instance_group_membership.py +2 -2
- pulumi_gcp/compute/interconnect_attachment.py +82 -0
- pulumi_gcp/compute/network_endpoint.py +2 -2
- pulumi_gcp/compute/network_endpoint_list.py +2 -2
- pulumi_gcp/compute/outputs.py +609 -161
- pulumi_gcp/compute/packet_mirroring.py +4 -2
- pulumi_gcp/compute/region_security_policy_rule.py +4 -2
- pulumi_gcp/compute/region_ssl_certificate.py +0 -188
- pulumi_gcp/compute/region_ssl_policy.py +39 -40
- pulumi_gcp/compute/route.py +10 -2
- pulumi_gcp/compute/security_policy_rule.py +55 -1
- pulumi_gcp/compute/ssl_certificate.py +0 -166
- pulumi_gcp/compute/target_instance.py +4 -2
- pulumi_gcp/compute/vpn_gateway.py +12 -2
- pulumi_gcp/compute/vpn_tunnel.py +26 -16
- pulumi_gcp/container/_inputs.py +560 -0
- pulumi_gcp/container/outputs.py +1106 -51
- pulumi_gcp/databasemigrationservice/connection_profile.py +32 -16
- pulumi_gcp/datacatalog/policy_tag.py +4 -2
- pulumi_gcp/datafusion/instance.py +14 -12
- pulumi_gcp/dataplex/__init__.py +10 -0
- pulumi_gcp/dataplex/_inputs.py +160 -0
- pulumi_gcp/dataplex/aspect_type.py +1077 -0
- pulumi_gcp/dataplex/aspect_type_iam_binding.py +765 -0
- pulumi_gcp/dataplex/aspect_type_iam_member.py +765 -0
- pulumi_gcp/dataplex/aspect_type_iam_policy.py +604 -0
- pulumi_gcp/dataplex/asset.py +4 -2
- pulumi_gcp/dataplex/datascan.py +16 -14
- pulumi_gcp/dataplex/entry_group.py +722 -0
- pulumi_gcp/dataplex/entry_group_iam_binding.py +765 -0
- pulumi_gcp/dataplex/entry_group_iam_member.py +765 -0
- pulumi_gcp/dataplex/entry_group_iam_policy.py +604 -0
- pulumi_gcp/dataplex/get_aspect_type_iam_policy.py +164 -0
- pulumi_gcp/dataplex/get_entry_group_iam_policy.py +164 -0
- pulumi_gcp/dataplex/outputs.py +112 -0
- pulumi_gcp/datastore/data_store_index.py +4 -2
- pulumi_gcp/datastream/connection_profile.py +47 -0
- pulumi_gcp/datastream/private_connection.py +47 -0
- pulumi_gcp/datastream/stream.py +63 -10
- pulumi_gcp/diagflow/cx_test_case.py +4 -4
- pulumi_gcp/diagflow/entity_type.py +4 -2
- pulumi_gcp/diagflow/fulfillment.py +4 -2
- pulumi_gcp/diagflow/intent.py +8 -4
- pulumi_gcp/dns/get_managed_zone.py +3 -3
- pulumi_gcp/dns/managed_zone.py +7 -7
- pulumi_gcp/dns/outputs.py +2 -2
- pulumi_gcp/edgecontainer/node_pool.py +4 -2
- pulumi_gcp/edgecontainer/vpn_connection.py +4 -2
- pulumi_gcp/eventarc/channel.py +4 -2
- pulumi_gcp/eventarc/google_channel_config.py +4 -2
- pulumi_gcp/firebase/app_check_app_attest_config.py +16 -8
- pulumi_gcp/firebase/app_check_debug_token.py +8 -4
- pulumi_gcp/firebase/app_check_device_check_config.py +8 -4
- pulumi_gcp/firebase/app_check_play_integrity_config.py +16 -8
- pulumi_gcp/firebase/app_check_recaptcha_enterprise_config.py +8 -4
- pulumi_gcp/firebase/app_check_recaptcha_v3_config.py +8 -4
- pulumi_gcp/firebase/app_check_service_config.py +12 -6
- pulumi_gcp/firebase/database_instance.py +4 -2
- pulumi_gcp/firebaserules/release.py +0 -98
- pulumi_gcp/firestore/database.py +24 -20
- pulumi_gcp/firestore/document.py +24 -12
- pulumi_gcp/folder/access_approval_settings.py +4 -2
- pulumi_gcp/gkehub/membership_binding.py +14 -4
- pulumi_gcp/gkehub/membership_rbac_role_binding.py +8 -4
- pulumi_gcp/gkehub/namespace.py +4 -2
- pulumi_gcp/gkehub/scope_rbac_role_binding.py +4 -2
- pulumi_gcp/integrationconnectors/connection.py +4 -2
- pulumi_gcp/integrationconnectors/managed_zone.py +18 -6
- pulumi_gcp/kms/__init__.py +2 -0
- pulumi_gcp/kms/autokey_config.py +366 -0
- pulumi_gcp/kms/key_handle.py +548 -0
- pulumi_gcp/logging/folder_settings.py +12 -10
- pulumi_gcp/logging/linked_dataset.py +4 -2
- pulumi_gcp/logging/organization_settings.py +12 -10
- pulumi_gcp/logging/project_bucket_config.py +4 -2
- pulumi_gcp/looker/instance.py +12 -10
- pulumi_gcp/netapp/volume_replication.py +4 -2
- pulumi_gcp/netapp/volume_snapshot.py +4 -2
- pulumi_gcp/networkconnectivity/internal_range.py +14 -12
- pulumi_gcp/networksecurity/gateway_security_policy.py +16 -4
- pulumi_gcp/networksecurity/tls_inspection_policy.py +22 -4
- pulumi_gcp/networkservices/__init__.py +1 -0
- pulumi_gcp/networkservices/_inputs.py +245 -27
- pulumi_gcp/networkservices/gateway.py +12 -6
- pulumi_gcp/networkservices/lb_route_extension.py +663 -0
- pulumi_gcp/networkservices/lb_traffic_extension.py +28 -540
- pulumi_gcp/networkservices/outputs.py +251 -20
- pulumi_gcp/organizations/access_approval_settings.py +4 -2
- pulumi_gcp/orgpolicy/policy.py +2 -2
- pulumi_gcp/parallelstore/instance.py +20 -18
- pulumi_gcp/projects/access_approval_settings.py +4 -2
- pulumi_gcp/pubsub/_inputs.py +16 -0
- pulumi_gcp/pubsub/outputs.py +25 -0
- pulumi_gcp/pubsub/schema.py +4 -2
- pulumi_gcp/pubsub/subscription.py +102 -66
- pulumi_gcp/pubsub/topic.py +4 -2
- pulumi_gcp/pulumi-plugin.json +1 -1
- pulumi_gcp/redis/cluster.py +30 -28
- pulumi_gcp/redis/instance.py +4 -2
- pulumi_gcp/secretmanager/secret.py +4 -2
- pulumi_gcp/securesourcemanager/instance.py +20 -8
- pulumi_gcp/securitycenter/instance_iam_binding.py +14 -12
- pulumi_gcp/securitycenter/instance_iam_member.py +14 -12
- pulumi_gcp/securitycenter/instance_iam_policy.py +14 -12
- pulumi_gcp/serviceaccount/key.py +2 -2
- pulumi_gcp/sql/database_instance.py +4 -2
- pulumi_gcp/sql/user.py +4 -4
- pulumi_gcp/storage/get_project_service_account.py +4 -2
- pulumi_gcp/storage/insights_report_config.py +12 -10
- pulumi_gcp/storage/notification.py +18 -16
- pulumi_gcp/storage/transfer_agent_pool.py +4 -2
- pulumi_gcp/storage/transfer_job.py +14 -4
- pulumi_gcp/tpu/_inputs.py +2 -2
- pulumi_gcp/tpu/outputs.py +2 -2
- pulumi_gcp/tpu/v2_vm.py +10 -6
- pulumi_gcp/vertex/ai_endpoint.py +24 -22
- pulumi_gcp/vertex/ai_index_endpoint.py +20 -18
- pulumi_gcp/vertex/ai_tensorboard.py +14 -12
- pulumi_gcp/vmwareengine/external_address.py +4 -2
- pulumi_gcp/vmwareengine/network.py +8 -4
- {pulumi_gcp-7.24.0a1716588893.dist-info → pulumi_gcp-7.25.0.dist-info}/METADATA +1 -1
- {pulumi_gcp-7.24.0a1716588893.dist-info → pulumi_gcp-7.25.0.dist-info}/RECORD +179 -165
- {pulumi_gcp-7.24.0a1716588893.dist-info → pulumi_gcp-7.25.0.dist-info}/WHEEL +0 -0
- {pulumi_gcp-7.24.0a1716588893.dist-info → pulumi_gcp-7.25.0.dist-info}/top_level.txt +0 -0
@@ -1699,313 +1699,6 @@ class ForwardingRule(pulumi.CustomResource):
|
|
1699
1699
|
|
1700
1700
|
## Example Usage
|
1701
1701
|
|
1702
|
-
### Internal Http Lb With Mig Backend
|
1703
|
-
|
1704
|
-
```python
|
1705
|
-
import pulumi
|
1706
|
-
import pulumi_gcp as gcp
|
1707
|
-
|
1708
|
-
# Internal HTTP load balancer with a managed instance group backend
|
1709
|
-
# VPC network
|
1710
|
-
ilb_network = gcp.compute.Network("ilb_network",
|
1711
|
-
name="l7-ilb-network",
|
1712
|
-
auto_create_subnetworks=False)
|
1713
|
-
# proxy-only subnet
|
1714
|
-
proxy_subnet = gcp.compute.Subnetwork("proxy_subnet",
|
1715
|
-
name="l7-ilb-proxy-subnet",
|
1716
|
-
ip_cidr_range="10.0.0.0/24",
|
1717
|
-
region="europe-west1",
|
1718
|
-
purpose="REGIONAL_MANAGED_PROXY",
|
1719
|
-
role="ACTIVE",
|
1720
|
-
network=ilb_network.id)
|
1721
|
-
# backend subnet
|
1722
|
-
ilb_subnet = gcp.compute.Subnetwork("ilb_subnet",
|
1723
|
-
name="l7-ilb-subnet",
|
1724
|
-
ip_cidr_range="10.0.1.0/24",
|
1725
|
-
region="europe-west1",
|
1726
|
-
network=ilb_network.id)
|
1727
|
-
# health check
|
1728
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
1729
|
-
name="l7-ilb-hc",
|
1730
|
-
region="europe-west1",
|
1731
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
1732
|
-
port_specification="USE_SERVING_PORT",
|
1733
|
-
))
|
1734
|
-
# instance template
|
1735
|
-
instance_template = gcp.compute.InstanceTemplate("instance_template",
|
1736
|
-
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
|
1737
|
-
access_configs=[gcp.compute.InstanceTemplateNetworkInterfaceAccessConfigArgs()],
|
1738
|
-
network=ilb_network.id,
|
1739
|
-
subnetwork=ilb_subnet.id,
|
1740
|
-
)],
|
1741
|
-
name="l7-ilb-mig-template",
|
1742
|
-
machine_type="e2-small",
|
1743
|
-
tags=["http-server"],
|
1744
|
-
disks=[gcp.compute.InstanceTemplateDiskArgs(
|
1745
|
-
source_image="debian-cloud/debian-10",
|
1746
|
-
auto_delete=True,
|
1747
|
-
boot=True,
|
1748
|
-
)],
|
1749
|
-
metadata={
|
1750
|
-
"startup-script": \"\"\"#! /bin/bash
|
1751
|
-
set -euo pipefail
|
1752
|
-
|
1753
|
-
export DEBIAN_FRONTEND=noninteractive
|
1754
|
-
apt-get update
|
1755
|
-
apt-get install -y nginx-light jq
|
1756
|
-
|
1757
|
-
NAME=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/hostname")
|
1758
|
-
IP=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip")
|
1759
|
-
METADATA=$(curl -f -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=True" | jq 'del(.["startup-script"])')
|
1760
|
-
|
1761
|
-
cat <<EOF > /var/www/html/index.html
|
1762
|
-
<pre>
|
1763
|
-
Name: $NAME
|
1764
|
-
IP: $IP
|
1765
|
-
Metadata: $METADATA
|
1766
|
-
</pre>
|
1767
|
-
EOF
|
1768
|
-
\"\"\",
|
1769
|
-
})
|
1770
|
-
# MIG
|
1771
|
-
mig = gcp.compute.RegionInstanceGroupManager("mig",
|
1772
|
-
name="l7-ilb-mig1",
|
1773
|
-
region="europe-west1",
|
1774
|
-
versions=[gcp.compute.RegionInstanceGroupManagerVersionArgs(
|
1775
|
-
instance_template=instance_template.id,
|
1776
|
-
name="primary",
|
1777
|
-
)],
|
1778
|
-
base_instance_name="vm",
|
1779
|
-
target_size=2)
|
1780
|
-
# backend service
|
1781
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
1782
|
-
name="l7-ilb-backend-subnet",
|
1783
|
-
region="europe-west1",
|
1784
|
-
protocol="HTTP",
|
1785
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
1786
|
-
timeout_sec=10,
|
1787
|
-
health_checks=default_region_health_check.id,
|
1788
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
1789
|
-
group=mig.instance_group,
|
1790
|
-
balancing_mode="UTILIZATION",
|
1791
|
-
capacity_scaler=1,
|
1792
|
-
)])
|
1793
|
-
# URL map
|
1794
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
1795
|
-
name="l7-ilb-regional-url-map",
|
1796
|
-
region="europe-west1",
|
1797
|
-
default_service=default_region_backend_service.id)
|
1798
|
-
# HTTP target proxy
|
1799
|
-
default = gcp.compute.RegionTargetHttpProxy("default",
|
1800
|
-
name="l7-ilb-target-http-proxy",
|
1801
|
-
region="europe-west1",
|
1802
|
-
url_map=default_region_url_map.id)
|
1803
|
-
# forwarding rule
|
1804
|
-
google_compute_forwarding_rule = gcp.compute.ForwardingRule("google_compute_forwarding_rule",
|
1805
|
-
name="l7-ilb-forwarding-rule",
|
1806
|
-
region="europe-west1",
|
1807
|
-
ip_protocol="TCP",
|
1808
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
1809
|
-
port_range="80",
|
1810
|
-
target=default.id,
|
1811
|
-
network=ilb_network.id,
|
1812
|
-
subnetwork=ilb_subnet.id,
|
1813
|
-
network_tier="PREMIUM")
|
1814
|
-
# allow all access from IAP and health check ranges
|
1815
|
-
fw_iap = gcp.compute.Firewall("fw-iap",
|
1816
|
-
name="l7-ilb-fw-allow-iap-hc",
|
1817
|
-
direction="INGRESS",
|
1818
|
-
network=ilb_network.id,
|
1819
|
-
source_ranges=[
|
1820
|
-
"130.211.0.0/22",
|
1821
|
-
"35.191.0.0/16",
|
1822
|
-
"35.235.240.0/20",
|
1823
|
-
],
|
1824
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
1825
|
-
protocol="tcp",
|
1826
|
-
)])
|
1827
|
-
# allow http from proxy subnet to backends
|
1828
|
-
fw_ilb_to_backends = gcp.compute.Firewall("fw-ilb-to-backends",
|
1829
|
-
name="l7-ilb-fw-allow-ilb-to-backends",
|
1830
|
-
direction="INGRESS",
|
1831
|
-
network=ilb_network.id,
|
1832
|
-
source_ranges=["10.0.0.0/24"],
|
1833
|
-
target_tags=["http-server"],
|
1834
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
1835
|
-
protocol="tcp",
|
1836
|
-
ports=[
|
1837
|
-
"80",
|
1838
|
-
"443",
|
1839
|
-
"8080",
|
1840
|
-
],
|
1841
|
-
)])
|
1842
|
-
# test instance
|
1843
|
-
vm_test = gcp.compute.Instance("vm-test",
|
1844
|
-
name="l7-ilb-test-vm",
|
1845
|
-
zone="europe-west1-b",
|
1846
|
-
machine_type="e2-small",
|
1847
|
-
network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
|
1848
|
-
network=ilb_network.id,
|
1849
|
-
subnetwork=ilb_subnet.id,
|
1850
|
-
)],
|
1851
|
-
boot_disk=gcp.compute.InstanceBootDiskArgs(
|
1852
|
-
initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
|
1853
|
-
image="debian-cloud/debian-10",
|
1854
|
-
),
|
1855
|
-
))
|
1856
|
-
```
|
1857
|
-
### Internal Tcp Udp Lb With Mig Backend
|
1858
|
-
|
1859
|
-
```python
|
1860
|
-
import pulumi
|
1861
|
-
import pulumi_gcp as gcp
|
1862
|
-
|
1863
|
-
# Internal TCP/UDP load balancer with a managed instance group backend
|
1864
|
-
# VPC
|
1865
|
-
ilb_network = gcp.compute.Network("ilb_network",
|
1866
|
-
name="l4-ilb-network",
|
1867
|
-
auto_create_subnetworks=False)
|
1868
|
-
# backed subnet
|
1869
|
-
ilb_subnet = gcp.compute.Subnetwork("ilb_subnet",
|
1870
|
-
name="l4-ilb-subnet",
|
1871
|
-
ip_cidr_range="10.0.1.0/24",
|
1872
|
-
region="europe-west1",
|
1873
|
-
network=ilb_network.id)
|
1874
|
-
# health check
|
1875
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
1876
|
-
name="l4-ilb-hc",
|
1877
|
-
region="europe-west1",
|
1878
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
1879
|
-
port=80,
|
1880
|
-
))
|
1881
|
-
# instance template
|
1882
|
-
instance_template = gcp.compute.InstanceTemplate("instance_template",
|
1883
|
-
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
|
1884
|
-
access_configs=[gcp.compute.InstanceTemplateNetworkInterfaceAccessConfigArgs()],
|
1885
|
-
network=ilb_network.id,
|
1886
|
-
subnetwork=ilb_subnet.id,
|
1887
|
-
)],
|
1888
|
-
name="l4-ilb-mig-template",
|
1889
|
-
machine_type="e2-small",
|
1890
|
-
tags=[
|
1891
|
-
"allow-ssh",
|
1892
|
-
"allow-health-check",
|
1893
|
-
],
|
1894
|
-
disks=[gcp.compute.InstanceTemplateDiskArgs(
|
1895
|
-
source_image="debian-cloud/debian-10",
|
1896
|
-
auto_delete=True,
|
1897
|
-
boot=True,
|
1898
|
-
)],
|
1899
|
-
metadata={
|
1900
|
-
"startup-script": \"\"\"#! /bin/bash
|
1901
|
-
set -euo pipefail
|
1902
|
-
|
1903
|
-
export DEBIAN_FRONTEND=noninteractive
|
1904
|
-
apt-get update
|
1905
|
-
apt-get install -y nginx-light jq
|
1906
|
-
|
1907
|
-
NAME=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/hostname")
|
1908
|
-
IP=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip")
|
1909
|
-
METADATA=$(curl -f -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=True" | jq 'del(.["startup-script"])')
|
1910
|
-
|
1911
|
-
cat <<EOF > /var/www/html/index.html
|
1912
|
-
<pre>
|
1913
|
-
Name: $NAME
|
1914
|
-
IP: $IP
|
1915
|
-
Metadata: $METADATA
|
1916
|
-
</pre>
|
1917
|
-
EOF
|
1918
|
-
\"\"\",
|
1919
|
-
})
|
1920
|
-
# MIG
|
1921
|
-
mig = gcp.compute.RegionInstanceGroupManager("mig",
|
1922
|
-
name="l4-ilb-mig1",
|
1923
|
-
region="europe-west1",
|
1924
|
-
versions=[gcp.compute.RegionInstanceGroupManagerVersionArgs(
|
1925
|
-
instance_template=instance_template.id,
|
1926
|
-
name="primary",
|
1927
|
-
)],
|
1928
|
-
base_instance_name="vm",
|
1929
|
-
target_size=2)
|
1930
|
-
# backend service
|
1931
|
-
default = gcp.compute.RegionBackendService("default",
|
1932
|
-
name="l4-ilb-backend-subnet",
|
1933
|
-
region="europe-west1",
|
1934
|
-
protocol="TCP",
|
1935
|
-
load_balancing_scheme="INTERNAL",
|
1936
|
-
health_checks=default_region_health_check.id,
|
1937
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
1938
|
-
group=mig.instance_group,
|
1939
|
-
balancing_mode="CONNECTION",
|
1940
|
-
)])
|
1941
|
-
# forwarding rule
|
1942
|
-
google_compute_forwarding_rule = gcp.compute.ForwardingRule("google_compute_forwarding_rule",
|
1943
|
-
name="l4-ilb-forwarding-rule",
|
1944
|
-
backend_service=default.id,
|
1945
|
-
region="europe-west1",
|
1946
|
-
ip_protocol="TCP",
|
1947
|
-
load_balancing_scheme="INTERNAL",
|
1948
|
-
all_ports=True,
|
1949
|
-
allow_global_access=True,
|
1950
|
-
network=ilb_network.id,
|
1951
|
-
subnetwork=ilb_subnet.id)
|
1952
|
-
# allow all access from health check ranges
|
1953
|
-
fw_hc = gcp.compute.Firewall("fw_hc",
|
1954
|
-
name="l4-ilb-fw-allow-hc",
|
1955
|
-
direction="INGRESS",
|
1956
|
-
network=ilb_network.id,
|
1957
|
-
source_ranges=[
|
1958
|
-
"130.211.0.0/22",
|
1959
|
-
"35.191.0.0/16",
|
1960
|
-
"35.235.240.0/20",
|
1961
|
-
],
|
1962
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
1963
|
-
protocol="tcp",
|
1964
|
-
)],
|
1965
|
-
target_tags=["allow-health-check"])
|
1966
|
-
# allow communication within the subnet
|
1967
|
-
fw_ilb_to_backends = gcp.compute.Firewall("fw_ilb_to_backends",
|
1968
|
-
name="l4-ilb-fw-allow-ilb-to-backends",
|
1969
|
-
direction="INGRESS",
|
1970
|
-
network=ilb_network.id,
|
1971
|
-
source_ranges=["10.0.1.0/24"],
|
1972
|
-
allows=[
|
1973
|
-
gcp.compute.FirewallAllowArgs(
|
1974
|
-
protocol="tcp",
|
1975
|
-
),
|
1976
|
-
gcp.compute.FirewallAllowArgs(
|
1977
|
-
protocol="udp",
|
1978
|
-
),
|
1979
|
-
gcp.compute.FirewallAllowArgs(
|
1980
|
-
protocol="icmp",
|
1981
|
-
),
|
1982
|
-
])
|
1983
|
-
# allow SSH
|
1984
|
-
fw_ilb_ssh = gcp.compute.Firewall("fw_ilb_ssh",
|
1985
|
-
name="l4-ilb-fw-ssh",
|
1986
|
-
direction="INGRESS",
|
1987
|
-
network=ilb_network.id,
|
1988
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
1989
|
-
protocol="tcp",
|
1990
|
-
ports=["22"],
|
1991
|
-
)],
|
1992
|
-
target_tags=["allow-ssh"],
|
1993
|
-
source_ranges=["0.0.0.0/0"])
|
1994
|
-
# test instance
|
1995
|
-
vm_test = gcp.compute.Instance("vm_test",
|
1996
|
-
name="l4-ilb-test-vm",
|
1997
|
-
zone="europe-west1-b",
|
1998
|
-
machine_type="e2-small",
|
1999
|
-
network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
|
2000
|
-
network=ilb_network.id,
|
2001
|
-
subnetwork=ilb_subnet.id,
|
2002
|
-
)],
|
2003
|
-
boot_disk=gcp.compute.InstanceBootDiskArgs(
|
2004
|
-
initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
|
2005
|
-
image="debian-cloud/debian-10",
|
2006
|
-
),
|
2007
|
-
))
|
2008
|
-
```
|
2009
1702
|
### Forwarding Rule Externallb
|
2010
1703
|
|
2011
1704
|
```python
|
@@ -2182,43 +1875,6 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2182
1875
|
)],
|
2183
1876
|
base_instance_name="internal-glb",
|
2184
1877
|
target_size=1)
|
2185
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2186
|
-
region="us-central1",
|
2187
|
-
name="website-hc",
|
2188
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2189
|
-
port_specification="USE_SERVING_PORT",
|
2190
|
-
))
|
2191
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2192
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
2193
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2194
|
-
group=rigm.instance_group,
|
2195
|
-
balancing_mode="UTILIZATION",
|
2196
|
-
capacity_scaler=1,
|
2197
|
-
)],
|
2198
|
-
region="us-central1",
|
2199
|
-
name="website-backend",
|
2200
|
-
protocol="HTTP",
|
2201
|
-
timeout_sec=10,
|
2202
|
-
health_checks=default_region_health_check.id)
|
2203
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
2204
|
-
region="us-central1",
|
2205
|
-
name="website-map",
|
2206
|
-
default_service=default_region_backend_service.id)
|
2207
|
-
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
2208
|
-
region="us-central1",
|
2209
|
-
name="website-proxy",
|
2210
|
-
url_map=default_region_url_map.id)
|
2211
|
-
# Forwarding rule for Internal Load Balancing
|
2212
|
-
default = gcp.compute.ForwardingRule("default",
|
2213
|
-
name="website-forwarding-rule",
|
2214
|
-
region="us-central1",
|
2215
|
-
ip_protocol="TCP",
|
2216
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
2217
|
-
port_range="80",
|
2218
|
-
target=default_region_target_http_proxy.id,
|
2219
|
-
network=default_network.id,
|
2220
|
-
subnetwork=default_subnetwork.id,
|
2221
|
-
network_tier="PREMIUM")
|
2222
1878
|
fw1 = gcp.compute.Firewall("fw1",
|
2223
1879
|
name="website-fw-1",
|
2224
1880
|
network=default_network.id,
|
@@ -2244,7 +1900,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2244
1900
|
ports=["22"],
|
2245
1901
|
)],
|
2246
1902
|
target_tags=["allow-ssh"],
|
2247
|
-
direction="INGRESS"
|
1903
|
+
direction="INGRESS",
|
1904
|
+
opts=pulumi.ResourceOptions(depends_on=[fw1]))
|
2248
1905
|
fw3 = gcp.compute.Firewall("fw3",
|
2249
1906
|
name="website-fw-3",
|
2250
1907
|
network=default_network.id,
|
@@ -2256,7 +1913,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2256
1913
|
protocol="tcp",
|
2257
1914
|
)],
|
2258
1915
|
target_tags=["load-balanced-backend"],
|
2259
|
-
direction="INGRESS"
|
1916
|
+
direction="INGRESS",
|
1917
|
+
opts=pulumi.ResourceOptions(depends_on=[fw2]))
|
2260
1918
|
fw4 = gcp.compute.Firewall("fw4",
|
2261
1919
|
name="website-fw-4",
|
2262
1920
|
network=default_network.id,
|
@@ -2276,7 +1934,35 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2276
1934
|
ports=["8000"],
|
2277
1935
|
),
|
2278
1936
|
],
|
2279
|
-
direction="INGRESS"
|
1937
|
+
direction="INGRESS",
|
1938
|
+
opts=pulumi.ResourceOptions(depends_on=[fw3]))
|
1939
|
+
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
1940
|
+
region="us-central1",
|
1941
|
+
name="website-hc",
|
1942
|
+
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
1943
|
+
port_specification="USE_SERVING_PORT",
|
1944
|
+
),
|
1945
|
+
opts=pulumi.ResourceOptions(depends_on=[fw4]))
|
1946
|
+
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
1947
|
+
load_balancing_scheme="INTERNAL_MANAGED",
|
1948
|
+
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
1949
|
+
group=rigm.instance_group,
|
1950
|
+
balancing_mode="UTILIZATION",
|
1951
|
+
capacity_scaler=1,
|
1952
|
+
)],
|
1953
|
+
region="us-central1",
|
1954
|
+
name="website-backend",
|
1955
|
+
protocol="HTTP",
|
1956
|
+
timeout_sec=10,
|
1957
|
+
health_checks=default_region_health_check.id)
|
1958
|
+
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
1959
|
+
region="us-central1",
|
1960
|
+
name="website-map",
|
1961
|
+
default_service=default_region_backend_service.id)
|
1962
|
+
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
1963
|
+
region="us-central1",
|
1964
|
+
name="website-proxy",
|
1965
|
+
url_map=default_region_url_map.id)
|
2280
1966
|
proxy = gcp.compute.Subnetwork("proxy",
|
2281
1967
|
name="website-net-proxy",
|
2282
1968
|
ip_cidr_range="10.129.0.0/26",
|
@@ -2284,6 +1970,18 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2284
1970
|
network=default_network.id,
|
2285
1971
|
purpose="REGIONAL_MANAGED_PROXY",
|
2286
1972
|
role="ACTIVE")
|
1973
|
+
# Forwarding rule for Internal Load Balancing
|
1974
|
+
default = gcp.compute.ForwardingRule("default",
|
1975
|
+
name="website-forwarding-rule",
|
1976
|
+
region="us-central1",
|
1977
|
+
ip_protocol="TCP",
|
1978
|
+
load_balancing_scheme="INTERNAL_MANAGED",
|
1979
|
+
port_range="80",
|
1980
|
+
target=default_region_target_http_proxy.id,
|
1981
|
+
network=default_network.id,
|
1982
|
+
subnetwork=default_subnetwork.id,
|
1983
|
+
network_tier="PREMIUM",
|
1984
|
+
opts=pulumi.ResourceOptions(depends_on=[proxy]))
|
2287
1985
|
```
|
2288
1986
|
### Forwarding Rule Regional Http Xlb
|
2289
1987
|
|
@@ -2327,47 +2025,6 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2327
2025
|
)],
|
2328
2026
|
base_instance_name="internal-glb",
|
2329
2027
|
target_size=1)
|
2330
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2331
|
-
region="us-central1",
|
2332
|
-
name="website-hc",
|
2333
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2334
|
-
port_specification="USE_SERVING_PORT",
|
2335
|
-
))
|
2336
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2337
|
-
load_balancing_scheme="EXTERNAL_MANAGED",
|
2338
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2339
|
-
group=rigm.instance_group,
|
2340
|
-
balancing_mode="UTILIZATION",
|
2341
|
-
capacity_scaler=1,
|
2342
|
-
)],
|
2343
|
-
region="us-central1",
|
2344
|
-
name="website-backend",
|
2345
|
-
protocol="HTTP",
|
2346
|
-
timeout_sec=10,
|
2347
|
-
health_checks=default_region_health_check.id)
|
2348
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
2349
|
-
region="us-central1",
|
2350
|
-
name="website-map",
|
2351
|
-
default_service=default_region_backend_service.id)
|
2352
|
-
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
2353
|
-
region="us-central1",
|
2354
|
-
name="website-proxy",
|
2355
|
-
url_map=default_region_url_map.id)
|
2356
|
-
default_address = gcp.compute.Address("default",
|
2357
|
-
name="website-ip-1",
|
2358
|
-
region="us-central1",
|
2359
|
-
network_tier="STANDARD")
|
2360
|
-
# Forwarding rule for Regional External Load Balancing
|
2361
|
-
default = gcp.compute.ForwardingRule("default",
|
2362
|
-
name="website-forwarding-rule",
|
2363
|
-
region="us-central1",
|
2364
|
-
ip_protocol="TCP",
|
2365
|
-
load_balancing_scheme="EXTERNAL_MANAGED",
|
2366
|
-
port_range="80",
|
2367
|
-
target=default_region_target_http_proxy.id,
|
2368
|
-
network=default_network.id,
|
2369
|
-
ip_address=default_address.address,
|
2370
|
-
network_tier="STANDARD")
|
2371
2028
|
fw1 = gcp.compute.Firewall("fw1",
|
2372
2029
|
name="website-fw-1",
|
2373
2030
|
network=default_network.id,
|
@@ -2393,7 +2050,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2393
2050
|
ports=["22"],
|
2394
2051
|
)],
|
2395
2052
|
target_tags=["allow-ssh"],
|
2396
|
-
direction="INGRESS"
|
2053
|
+
direction="INGRESS",
|
2054
|
+
opts=pulumi.ResourceOptions(depends_on=[fw1]))
|
2397
2055
|
fw3 = gcp.compute.Firewall("fw3",
|
2398
2056
|
name="website-fw-3",
|
2399
2057
|
network=default_network.id,
|
@@ -2405,7 +2063,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2405
2063
|
protocol="tcp",
|
2406
2064
|
)],
|
2407
2065
|
target_tags=["load-balanced-backend"],
|
2408
|
-
direction="INGRESS"
|
2066
|
+
direction="INGRESS",
|
2067
|
+
opts=pulumi.ResourceOptions(depends_on=[fw2]))
|
2409
2068
|
fw4 = gcp.compute.Firewall("fw4",
|
2410
2069
|
name="website-fw-4",
|
2411
2070
|
network=default_network.id,
|
@@ -2425,7 +2084,39 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2425
2084
|
ports=["8000"],
|
2426
2085
|
),
|
2427
2086
|
],
|
2428
|
-
direction="INGRESS"
|
2087
|
+
direction="INGRESS",
|
2088
|
+
opts=pulumi.ResourceOptions(depends_on=[fw3]))
|
2089
|
+
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2090
|
+
region="us-central1",
|
2091
|
+
name="website-hc",
|
2092
|
+
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2093
|
+
port_specification="USE_SERVING_PORT",
|
2094
|
+
),
|
2095
|
+
opts=pulumi.ResourceOptions(depends_on=[fw4]))
|
2096
|
+
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2097
|
+
load_balancing_scheme="EXTERNAL_MANAGED",
|
2098
|
+
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2099
|
+
group=rigm.instance_group,
|
2100
|
+
balancing_mode="UTILIZATION",
|
2101
|
+
capacity_scaler=1,
|
2102
|
+
)],
|
2103
|
+
region="us-central1",
|
2104
|
+
name="website-backend",
|
2105
|
+
protocol="HTTP",
|
2106
|
+
timeout_sec=10,
|
2107
|
+
health_checks=default_region_health_check.id)
|
2108
|
+
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
2109
|
+
region="us-central1",
|
2110
|
+
name="website-map",
|
2111
|
+
default_service=default_region_backend_service.id)
|
2112
|
+
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
2113
|
+
region="us-central1",
|
2114
|
+
name="website-proxy",
|
2115
|
+
url_map=default_region_url_map.id)
|
2116
|
+
default_address = gcp.compute.Address("default",
|
2117
|
+
name="website-ip-1",
|
2118
|
+
region="us-central1",
|
2119
|
+
network_tier="STANDARD")
|
2429
2120
|
proxy = gcp.compute.Subnetwork("proxy",
|
2430
2121
|
name="website-net-proxy",
|
2431
2122
|
ip_cidr_range="10.129.0.0/26",
|
@@ -2433,6 +2124,18 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2433
2124
|
network=default_network.id,
|
2434
2125
|
purpose="REGIONAL_MANAGED_PROXY",
|
2435
2126
|
role="ACTIVE")
|
2127
|
+
# Forwarding rule for Regional External Load Balancing
|
2128
|
+
default = gcp.compute.ForwardingRule("default",
|
2129
|
+
name="website-forwarding-rule",
|
2130
|
+
region="us-central1",
|
2131
|
+
ip_protocol="TCP",
|
2132
|
+
load_balancing_scheme="EXTERNAL_MANAGED",
|
2133
|
+
port_range="80",
|
2134
|
+
target=default_region_target_http_proxy.id,
|
2135
|
+
network=default_network.id,
|
2136
|
+
ip_address=default_address.address,
|
2137
|
+
network_tier="STANDARD",
|
2138
|
+
opts=pulumi.ResourceOptions(depends_on=[proxy]))
|
2436
2139
|
```
|
2437
2140
|
### Forwarding Rule Vpc Psc
|
2438
2141
|
|
@@ -2589,6 +2292,12 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2589
2292
|
name="service-backend",
|
2590
2293
|
region="us-central1",
|
2591
2294
|
load_balancing_scheme="EXTERNAL")
|
2295
|
+
external_forwarding_rule = gcp.compute.ForwardingRule("external",
|
2296
|
+
name="external-forwarding-rule",
|
2297
|
+
region="us-central1",
|
2298
|
+
ip_address=basic.address,
|
2299
|
+
backend_service=external.self_link,
|
2300
|
+
load_balancing_scheme="EXTERNAL")
|
2592
2301
|
steering = gcp.compute.ForwardingRule("steering",
|
2593
2302
|
name="steering-rule",
|
2594
2303
|
region="us-central1",
|
@@ -2598,13 +2307,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2598
2307
|
source_ip_ranges=[
|
2599
2308
|
"34.121.88.0/24",
|
2600
2309
|
"35.187.239.137",
|
2601
|
-
]
|
2602
|
-
|
2603
|
-
name="external-forwarding-rule",
|
2604
|
-
region="us-central1",
|
2605
|
-
ip_address=basic.address,
|
2606
|
-
backend_service=external.self_link,
|
2607
|
-
load_balancing_scheme="EXTERNAL")
|
2310
|
+
],
|
2311
|
+
opts=pulumi.ResourceOptions(depends_on=[external_forwarding_rule]))
|
2608
2312
|
```
|
2609
2313
|
### Forwarding Rule Internallb Ipv6
|
2610
2314
|
|
@@ -2870,336 +2574,29 @@ class ForwardingRule(pulumi.CustomResource):
|
|
2870
2574
|
* For load balancers, see the "Target" column in [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).
|
2871
2575
|
* For Private Service Connect forwarding rules that forward traffic to Google APIs, provide the name of a supported Google API bundle:
|
2872
2576
|
* `vpc-sc` - [ APIs that support VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/supported-products).
|
2873
|
-
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).
|
2874
|
-
|
2875
|
-
For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
|
2876
|
-
"""
|
2877
|
-
...
|
2878
|
-
@overload
|
2879
|
-
def __init__(__self__,
|
2880
|
-
resource_name: str,
|
2881
|
-
args: Optional[ForwardingRuleArgs] = None,
|
2882
|
-
opts: Optional[pulumi.ResourceOptions] = None):
|
2883
|
-
"""
|
2884
|
-
A ForwardingRule resource. A ForwardingRule resource specifies which pool
|
2885
|
-
of target virtual machines to forward a packet to if it matches the given
|
2886
|
-
[IPAddress, IPProtocol, portRange] tuple.
|
2887
|
-
|
2888
|
-
To get more information about ForwardingRule, see:
|
2889
|
-
|
2890
|
-
* [API documentation](https://cloud.google.com/compute/docs/reference/v1/forwardingRules)
|
2891
|
-
* How-to Guides
|
2892
|
-
* [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules)
|
2893
|
-
|
2894
|
-
## Example Usage
|
2895
|
-
|
2896
|
-
### Internal Http Lb With Mig Backend
|
2897
|
-
|
2898
|
-
```python
|
2899
|
-
import pulumi
|
2900
|
-
import pulumi_gcp as gcp
|
2901
|
-
|
2902
|
-
# Internal HTTP load balancer with a managed instance group backend
|
2903
|
-
# VPC network
|
2904
|
-
ilb_network = gcp.compute.Network("ilb_network",
|
2905
|
-
name="l7-ilb-network",
|
2906
|
-
auto_create_subnetworks=False)
|
2907
|
-
# proxy-only subnet
|
2908
|
-
proxy_subnet = gcp.compute.Subnetwork("proxy_subnet",
|
2909
|
-
name="l7-ilb-proxy-subnet",
|
2910
|
-
ip_cidr_range="10.0.0.0/24",
|
2911
|
-
region="europe-west1",
|
2912
|
-
purpose="REGIONAL_MANAGED_PROXY",
|
2913
|
-
role="ACTIVE",
|
2914
|
-
network=ilb_network.id)
|
2915
|
-
# backend subnet
|
2916
|
-
ilb_subnet = gcp.compute.Subnetwork("ilb_subnet",
|
2917
|
-
name="l7-ilb-subnet",
|
2918
|
-
ip_cidr_range="10.0.1.0/24",
|
2919
|
-
region="europe-west1",
|
2920
|
-
network=ilb_network.id)
|
2921
|
-
# health check
|
2922
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2923
|
-
name="l7-ilb-hc",
|
2924
|
-
region="europe-west1",
|
2925
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2926
|
-
port_specification="USE_SERVING_PORT",
|
2927
|
-
))
|
2928
|
-
# instance template
|
2929
|
-
instance_template = gcp.compute.InstanceTemplate("instance_template",
|
2930
|
-
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
|
2931
|
-
access_configs=[gcp.compute.InstanceTemplateNetworkInterfaceAccessConfigArgs()],
|
2932
|
-
network=ilb_network.id,
|
2933
|
-
subnetwork=ilb_subnet.id,
|
2934
|
-
)],
|
2935
|
-
name="l7-ilb-mig-template",
|
2936
|
-
machine_type="e2-small",
|
2937
|
-
tags=["http-server"],
|
2938
|
-
disks=[gcp.compute.InstanceTemplateDiskArgs(
|
2939
|
-
source_image="debian-cloud/debian-10",
|
2940
|
-
auto_delete=True,
|
2941
|
-
boot=True,
|
2942
|
-
)],
|
2943
|
-
metadata={
|
2944
|
-
"startup-script": \"\"\"#! /bin/bash
|
2945
|
-
set -euo pipefail
|
2946
|
-
|
2947
|
-
export DEBIAN_FRONTEND=noninteractive
|
2948
|
-
apt-get update
|
2949
|
-
apt-get install -y nginx-light jq
|
2950
|
-
|
2951
|
-
NAME=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/hostname")
|
2952
|
-
IP=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip")
|
2953
|
-
METADATA=$(curl -f -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=True" | jq 'del(.["startup-script"])')
|
2954
|
-
|
2955
|
-
cat <<EOF > /var/www/html/index.html
|
2956
|
-
<pre>
|
2957
|
-
Name: $NAME
|
2958
|
-
IP: $IP
|
2959
|
-
Metadata: $METADATA
|
2960
|
-
</pre>
|
2961
|
-
EOF
|
2962
|
-
\"\"\",
|
2963
|
-
})
|
2964
|
-
# MIG
|
2965
|
-
mig = gcp.compute.RegionInstanceGroupManager("mig",
|
2966
|
-
name="l7-ilb-mig1",
|
2967
|
-
region="europe-west1",
|
2968
|
-
versions=[gcp.compute.RegionInstanceGroupManagerVersionArgs(
|
2969
|
-
instance_template=instance_template.id,
|
2970
|
-
name="primary",
|
2971
|
-
)],
|
2972
|
-
base_instance_name="vm",
|
2973
|
-
target_size=2)
|
2974
|
-
# backend service
|
2975
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2976
|
-
name="l7-ilb-backend-subnet",
|
2977
|
-
region="europe-west1",
|
2978
|
-
protocol="HTTP",
|
2979
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
2980
|
-
timeout_sec=10,
|
2981
|
-
health_checks=default_region_health_check.id,
|
2982
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2983
|
-
group=mig.instance_group,
|
2984
|
-
balancing_mode="UTILIZATION",
|
2985
|
-
capacity_scaler=1,
|
2986
|
-
)])
|
2987
|
-
# URL map
|
2988
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
2989
|
-
name="l7-ilb-regional-url-map",
|
2990
|
-
region="europe-west1",
|
2991
|
-
default_service=default_region_backend_service.id)
|
2992
|
-
# HTTP target proxy
|
2993
|
-
default = gcp.compute.RegionTargetHttpProxy("default",
|
2994
|
-
name="l7-ilb-target-http-proxy",
|
2995
|
-
region="europe-west1",
|
2996
|
-
url_map=default_region_url_map.id)
|
2997
|
-
# forwarding rule
|
2998
|
-
google_compute_forwarding_rule = gcp.compute.ForwardingRule("google_compute_forwarding_rule",
|
2999
|
-
name="l7-ilb-forwarding-rule",
|
3000
|
-
region="europe-west1",
|
3001
|
-
ip_protocol="TCP",
|
3002
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
3003
|
-
port_range="80",
|
3004
|
-
target=default.id,
|
3005
|
-
network=ilb_network.id,
|
3006
|
-
subnetwork=ilb_subnet.id,
|
3007
|
-
network_tier="PREMIUM")
|
3008
|
-
# allow all access from IAP and health check ranges
|
3009
|
-
fw_iap = gcp.compute.Firewall("fw-iap",
|
3010
|
-
name="l7-ilb-fw-allow-iap-hc",
|
3011
|
-
direction="INGRESS",
|
3012
|
-
network=ilb_network.id,
|
3013
|
-
source_ranges=[
|
3014
|
-
"130.211.0.0/22",
|
3015
|
-
"35.191.0.0/16",
|
3016
|
-
"35.235.240.0/20",
|
3017
|
-
],
|
3018
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
3019
|
-
protocol="tcp",
|
3020
|
-
)])
|
3021
|
-
# allow http from proxy subnet to backends
|
3022
|
-
fw_ilb_to_backends = gcp.compute.Firewall("fw-ilb-to-backends",
|
3023
|
-
name="l7-ilb-fw-allow-ilb-to-backends",
|
3024
|
-
direction="INGRESS",
|
3025
|
-
network=ilb_network.id,
|
3026
|
-
source_ranges=["10.0.0.0/24"],
|
3027
|
-
target_tags=["http-server"],
|
3028
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
3029
|
-
protocol="tcp",
|
3030
|
-
ports=[
|
3031
|
-
"80",
|
3032
|
-
"443",
|
3033
|
-
"8080",
|
3034
|
-
],
|
3035
|
-
)])
|
3036
|
-
# test instance
|
3037
|
-
vm_test = gcp.compute.Instance("vm-test",
|
3038
|
-
name="l7-ilb-test-vm",
|
3039
|
-
zone="europe-west1-b",
|
3040
|
-
machine_type="e2-small",
|
3041
|
-
network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
|
3042
|
-
network=ilb_network.id,
|
3043
|
-
subnetwork=ilb_subnet.id,
|
3044
|
-
)],
|
3045
|
-
boot_disk=gcp.compute.InstanceBootDiskArgs(
|
3046
|
-
initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
|
3047
|
-
image="debian-cloud/debian-10",
|
3048
|
-
),
|
3049
|
-
))
|
3050
|
-
```
|
3051
|
-
### Internal Tcp Udp Lb With Mig Backend
|
2577
|
+
* `all-apis` - [All supported Google APIs](https://cloud.google.com/vpc/docs/private-service-connect#supported-apis).
|
2578
|
+
|
2579
|
+
For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment.
|
2580
|
+
"""
|
2581
|
+
...
|
2582
|
+
@overload
|
2583
|
+
def __init__(__self__,
|
2584
|
+
resource_name: str,
|
2585
|
+
args: Optional[ForwardingRuleArgs] = None,
|
2586
|
+
opts: Optional[pulumi.ResourceOptions] = None):
|
2587
|
+
"""
|
2588
|
+
A ForwardingRule resource. A ForwardingRule resource specifies which pool
|
2589
|
+
of target virtual machines to forward a packet to if it matches the given
|
2590
|
+
[IPAddress, IPProtocol, portRange] tuple.
|
3052
2591
|
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
2592
|
+
To get more information about ForwardingRule, see:
|
2593
|
+
|
2594
|
+
* [API documentation](https://cloud.google.com/compute/docs/reference/v1/forwardingRules)
|
2595
|
+
* How-to Guides
|
2596
|
+
* [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules)
|
2597
|
+
|
2598
|
+
## Example Usage
|
3056
2599
|
|
3057
|
-
# Internal TCP/UDP load balancer with a managed instance group backend
|
3058
|
-
# VPC
|
3059
|
-
ilb_network = gcp.compute.Network("ilb_network",
|
3060
|
-
name="l4-ilb-network",
|
3061
|
-
auto_create_subnetworks=False)
|
3062
|
-
# backed subnet
|
3063
|
-
ilb_subnet = gcp.compute.Subnetwork("ilb_subnet",
|
3064
|
-
name="l4-ilb-subnet",
|
3065
|
-
ip_cidr_range="10.0.1.0/24",
|
3066
|
-
region="europe-west1",
|
3067
|
-
network=ilb_network.id)
|
3068
|
-
# health check
|
3069
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
3070
|
-
name="l4-ilb-hc",
|
3071
|
-
region="europe-west1",
|
3072
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
3073
|
-
port=80,
|
3074
|
-
))
|
3075
|
-
# instance template
|
3076
|
-
instance_template = gcp.compute.InstanceTemplate("instance_template",
|
3077
|
-
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
|
3078
|
-
access_configs=[gcp.compute.InstanceTemplateNetworkInterfaceAccessConfigArgs()],
|
3079
|
-
network=ilb_network.id,
|
3080
|
-
subnetwork=ilb_subnet.id,
|
3081
|
-
)],
|
3082
|
-
name="l4-ilb-mig-template",
|
3083
|
-
machine_type="e2-small",
|
3084
|
-
tags=[
|
3085
|
-
"allow-ssh",
|
3086
|
-
"allow-health-check",
|
3087
|
-
],
|
3088
|
-
disks=[gcp.compute.InstanceTemplateDiskArgs(
|
3089
|
-
source_image="debian-cloud/debian-10",
|
3090
|
-
auto_delete=True,
|
3091
|
-
boot=True,
|
3092
|
-
)],
|
3093
|
-
metadata={
|
3094
|
-
"startup-script": \"\"\"#! /bin/bash
|
3095
|
-
set -euo pipefail
|
3096
|
-
|
3097
|
-
export DEBIAN_FRONTEND=noninteractive
|
3098
|
-
apt-get update
|
3099
|
-
apt-get install -y nginx-light jq
|
3100
|
-
|
3101
|
-
NAME=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/hostname")
|
3102
|
-
IP=$(curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip")
|
3103
|
-
METADATA=$(curl -f -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=True" | jq 'del(.["startup-script"])')
|
3104
|
-
|
3105
|
-
cat <<EOF > /var/www/html/index.html
|
3106
|
-
<pre>
|
3107
|
-
Name: $NAME
|
3108
|
-
IP: $IP
|
3109
|
-
Metadata: $METADATA
|
3110
|
-
</pre>
|
3111
|
-
EOF
|
3112
|
-
\"\"\",
|
3113
|
-
})
|
3114
|
-
# MIG
|
3115
|
-
mig = gcp.compute.RegionInstanceGroupManager("mig",
|
3116
|
-
name="l4-ilb-mig1",
|
3117
|
-
region="europe-west1",
|
3118
|
-
versions=[gcp.compute.RegionInstanceGroupManagerVersionArgs(
|
3119
|
-
instance_template=instance_template.id,
|
3120
|
-
name="primary",
|
3121
|
-
)],
|
3122
|
-
base_instance_name="vm",
|
3123
|
-
target_size=2)
|
3124
|
-
# backend service
|
3125
|
-
default = gcp.compute.RegionBackendService("default",
|
3126
|
-
name="l4-ilb-backend-subnet",
|
3127
|
-
region="europe-west1",
|
3128
|
-
protocol="TCP",
|
3129
|
-
load_balancing_scheme="INTERNAL",
|
3130
|
-
health_checks=default_region_health_check.id,
|
3131
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
3132
|
-
group=mig.instance_group,
|
3133
|
-
balancing_mode="CONNECTION",
|
3134
|
-
)])
|
3135
|
-
# forwarding rule
|
3136
|
-
google_compute_forwarding_rule = gcp.compute.ForwardingRule("google_compute_forwarding_rule",
|
3137
|
-
name="l4-ilb-forwarding-rule",
|
3138
|
-
backend_service=default.id,
|
3139
|
-
region="europe-west1",
|
3140
|
-
ip_protocol="TCP",
|
3141
|
-
load_balancing_scheme="INTERNAL",
|
3142
|
-
all_ports=True,
|
3143
|
-
allow_global_access=True,
|
3144
|
-
network=ilb_network.id,
|
3145
|
-
subnetwork=ilb_subnet.id)
|
3146
|
-
# allow all access from health check ranges
|
3147
|
-
fw_hc = gcp.compute.Firewall("fw_hc",
|
3148
|
-
name="l4-ilb-fw-allow-hc",
|
3149
|
-
direction="INGRESS",
|
3150
|
-
network=ilb_network.id,
|
3151
|
-
source_ranges=[
|
3152
|
-
"130.211.0.0/22",
|
3153
|
-
"35.191.0.0/16",
|
3154
|
-
"35.235.240.0/20",
|
3155
|
-
],
|
3156
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
3157
|
-
protocol="tcp",
|
3158
|
-
)],
|
3159
|
-
target_tags=["allow-health-check"])
|
3160
|
-
# allow communication within the subnet
|
3161
|
-
fw_ilb_to_backends = gcp.compute.Firewall("fw_ilb_to_backends",
|
3162
|
-
name="l4-ilb-fw-allow-ilb-to-backends",
|
3163
|
-
direction="INGRESS",
|
3164
|
-
network=ilb_network.id,
|
3165
|
-
source_ranges=["10.0.1.0/24"],
|
3166
|
-
allows=[
|
3167
|
-
gcp.compute.FirewallAllowArgs(
|
3168
|
-
protocol="tcp",
|
3169
|
-
),
|
3170
|
-
gcp.compute.FirewallAllowArgs(
|
3171
|
-
protocol="udp",
|
3172
|
-
),
|
3173
|
-
gcp.compute.FirewallAllowArgs(
|
3174
|
-
protocol="icmp",
|
3175
|
-
),
|
3176
|
-
])
|
3177
|
-
# allow SSH
|
3178
|
-
fw_ilb_ssh = gcp.compute.Firewall("fw_ilb_ssh",
|
3179
|
-
name="l4-ilb-fw-ssh",
|
3180
|
-
direction="INGRESS",
|
3181
|
-
network=ilb_network.id,
|
3182
|
-
allows=[gcp.compute.FirewallAllowArgs(
|
3183
|
-
protocol="tcp",
|
3184
|
-
ports=["22"],
|
3185
|
-
)],
|
3186
|
-
target_tags=["allow-ssh"],
|
3187
|
-
source_ranges=["0.0.0.0/0"])
|
3188
|
-
# test instance
|
3189
|
-
vm_test = gcp.compute.Instance("vm_test",
|
3190
|
-
name="l4-ilb-test-vm",
|
3191
|
-
zone="europe-west1-b",
|
3192
|
-
machine_type="e2-small",
|
3193
|
-
network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
|
3194
|
-
network=ilb_network.id,
|
3195
|
-
subnetwork=ilb_subnet.id,
|
3196
|
-
)],
|
3197
|
-
boot_disk=gcp.compute.InstanceBootDiskArgs(
|
3198
|
-
initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
|
3199
|
-
image="debian-cloud/debian-10",
|
3200
|
-
),
|
3201
|
-
))
|
3202
|
-
```
|
3203
2600
|
### Forwarding Rule Externallb
|
3204
2601
|
|
3205
2602
|
```python
|
@@ -3376,43 +2773,6 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3376
2773
|
)],
|
3377
2774
|
base_instance_name="internal-glb",
|
3378
2775
|
target_size=1)
|
3379
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
3380
|
-
region="us-central1",
|
3381
|
-
name="website-hc",
|
3382
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
3383
|
-
port_specification="USE_SERVING_PORT",
|
3384
|
-
))
|
3385
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
3386
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
3387
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
3388
|
-
group=rigm.instance_group,
|
3389
|
-
balancing_mode="UTILIZATION",
|
3390
|
-
capacity_scaler=1,
|
3391
|
-
)],
|
3392
|
-
region="us-central1",
|
3393
|
-
name="website-backend",
|
3394
|
-
protocol="HTTP",
|
3395
|
-
timeout_sec=10,
|
3396
|
-
health_checks=default_region_health_check.id)
|
3397
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
3398
|
-
region="us-central1",
|
3399
|
-
name="website-map",
|
3400
|
-
default_service=default_region_backend_service.id)
|
3401
|
-
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
3402
|
-
region="us-central1",
|
3403
|
-
name="website-proxy",
|
3404
|
-
url_map=default_region_url_map.id)
|
3405
|
-
# Forwarding rule for Internal Load Balancing
|
3406
|
-
default = gcp.compute.ForwardingRule("default",
|
3407
|
-
name="website-forwarding-rule",
|
3408
|
-
region="us-central1",
|
3409
|
-
ip_protocol="TCP",
|
3410
|
-
load_balancing_scheme="INTERNAL_MANAGED",
|
3411
|
-
port_range="80",
|
3412
|
-
target=default_region_target_http_proxy.id,
|
3413
|
-
network=default_network.id,
|
3414
|
-
subnetwork=default_subnetwork.id,
|
3415
|
-
network_tier="PREMIUM")
|
3416
2776
|
fw1 = gcp.compute.Firewall("fw1",
|
3417
2777
|
name="website-fw-1",
|
3418
2778
|
network=default_network.id,
|
@@ -3438,7 +2798,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3438
2798
|
ports=["22"],
|
3439
2799
|
)],
|
3440
2800
|
target_tags=["allow-ssh"],
|
3441
|
-
direction="INGRESS"
|
2801
|
+
direction="INGRESS",
|
2802
|
+
opts=pulumi.ResourceOptions(depends_on=[fw1]))
|
3442
2803
|
fw3 = gcp.compute.Firewall("fw3",
|
3443
2804
|
name="website-fw-3",
|
3444
2805
|
network=default_network.id,
|
@@ -3450,7 +2811,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3450
2811
|
protocol="tcp",
|
3451
2812
|
)],
|
3452
2813
|
target_tags=["load-balanced-backend"],
|
3453
|
-
direction="INGRESS"
|
2814
|
+
direction="INGRESS",
|
2815
|
+
opts=pulumi.ResourceOptions(depends_on=[fw2]))
|
3454
2816
|
fw4 = gcp.compute.Firewall("fw4",
|
3455
2817
|
name="website-fw-4",
|
3456
2818
|
network=default_network.id,
|
@@ -3470,7 +2832,35 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3470
2832
|
ports=["8000"],
|
3471
2833
|
),
|
3472
2834
|
],
|
3473
|
-
direction="INGRESS"
|
2835
|
+
direction="INGRESS",
|
2836
|
+
opts=pulumi.ResourceOptions(depends_on=[fw3]))
|
2837
|
+
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2838
|
+
region="us-central1",
|
2839
|
+
name="website-hc",
|
2840
|
+
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2841
|
+
port_specification="USE_SERVING_PORT",
|
2842
|
+
),
|
2843
|
+
opts=pulumi.ResourceOptions(depends_on=[fw4]))
|
2844
|
+
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2845
|
+
load_balancing_scheme="INTERNAL_MANAGED",
|
2846
|
+
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2847
|
+
group=rigm.instance_group,
|
2848
|
+
balancing_mode="UTILIZATION",
|
2849
|
+
capacity_scaler=1,
|
2850
|
+
)],
|
2851
|
+
region="us-central1",
|
2852
|
+
name="website-backend",
|
2853
|
+
protocol="HTTP",
|
2854
|
+
timeout_sec=10,
|
2855
|
+
health_checks=default_region_health_check.id)
|
2856
|
+
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
2857
|
+
region="us-central1",
|
2858
|
+
name="website-map",
|
2859
|
+
default_service=default_region_backend_service.id)
|
2860
|
+
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
2861
|
+
region="us-central1",
|
2862
|
+
name="website-proxy",
|
2863
|
+
url_map=default_region_url_map.id)
|
3474
2864
|
proxy = gcp.compute.Subnetwork("proxy",
|
3475
2865
|
name="website-net-proxy",
|
3476
2866
|
ip_cidr_range="10.129.0.0/26",
|
@@ -3478,6 +2868,18 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3478
2868
|
network=default_network.id,
|
3479
2869
|
purpose="REGIONAL_MANAGED_PROXY",
|
3480
2870
|
role="ACTIVE")
|
2871
|
+
# Forwarding rule for Internal Load Balancing
|
2872
|
+
default = gcp.compute.ForwardingRule("default",
|
2873
|
+
name="website-forwarding-rule",
|
2874
|
+
region="us-central1",
|
2875
|
+
ip_protocol="TCP",
|
2876
|
+
load_balancing_scheme="INTERNAL_MANAGED",
|
2877
|
+
port_range="80",
|
2878
|
+
target=default_region_target_http_proxy.id,
|
2879
|
+
network=default_network.id,
|
2880
|
+
subnetwork=default_subnetwork.id,
|
2881
|
+
network_tier="PREMIUM",
|
2882
|
+
opts=pulumi.ResourceOptions(depends_on=[proxy]))
|
3481
2883
|
```
|
3482
2884
|
### Forwarding Rule Regional Http Xlb
|
3483
2885
|
|
@@ -3521,47 +2923,6 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3521
2923
|
)],
|
3522
2924
|
base_instance_name="internal-glb",
|
3523
2925
|
target_size=1)
|
3524
|
-
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
3525
|
-
region="us-central1",
|
3526
|
-
name="website-hc",
|
3527
|
-
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
3528
|
-
port_specification="USE_SERVING_PORT",
|
3529
|
-
))
|
3530
|
-
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
3531
|
-
load_balancing_scheme="EXTERNAL_MANAGED",
|
3532
|
-
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
3533
|
-
group=rigm.instance_group,
|
3534
|
-
balancing_mode="UTILIZATION",
|
3535
|
-
capacity_scaler=1,
|
3536
|
-
)],
|
3537
|
-
region="us-central1",
|
3538
|
-
name="website-backend",
|
3539
|
-
protocol="HTTP",
|
3540
|
-
timeout_sec=10,
|
3541
|
-
health_checks=default_region_health_check.id)
|
3542
|
-
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
3543
|
-
region="us-central1",
|
3544
|
-
name="website-map",
|
3545
|
-
default_service=default_region_backend_service.id)
|
3546
|
-
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
3547
|
-
region="us-central1",
|
3548
|
-
name="website-proxy",
|
3549
|
-
url_map=default_region_url_map.id)
|
3550
|
-
default_address = gcp.compute.Address("default",
|
3551
|
-
name="website-ip-1",
|
3552
|
-
region="us-central1",
|
3553
|
-
network_tier="STANDARD")
|
3554
|
-
# Forwarding rule for Regional External Load Balancing
|
3555
|
-
default = gcp.compute.ForwardingRule("default",
|
3556
|
-
name="website-forwarding-rule",
|
3557
|
-
region="us-central1",
|
3558
|
-
ip_protocol="TCP",
|
3559
|
-
load_balancing_scheme="EXTERNAL_MANAGED",
|
3560
|
-
port_range="80",
|
3561
|
-
target=default_region_target_http_proxy.id,
|
3562
|
-
network=default_network.id,
|
3563
|
-
ip_address=default_address.address,
|
3564
|
-
network_tier="STANDARD")
|
3565
2926
|
fw1 = gcp.compute.Firewall("fw1",
|
3566
2927
|
name="website-fw-1",
|
3567
2928
|
network=default_network.id,
|
@@ -3587,7 +2948,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3587
2948
|
ports=["22"],
|
3588
2949
|
)],
|
3589
2950
|
target_tags=["allow-ssh"],
|
3590
|
-
direction="INGRESS"
|
2951
|
+
direction="INGRESS",
|
2952
|
+
opts=pulumi.ResourceOptions(depends_on=[fw1]))
|
3591
2953
|
fw3 = gcp.compute.Firewall("fw3",
|
3592
2954
|
name="website-fw-3",
|
3593
2955
|
network=default_network.id,
|
@@ -3599,7 +2961,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3599
2961
|
protocol="tcp",
|
3600
2962
|
)],
|
3601
2963
|
target_tags=["load-balanced-backend"],
|
3602
|
-
direction="INGRESS"
|
2964
|
+
direction="INGRESS",
|
2965
|
+
opts=pulumi.ResourceOptions(depends_on=[fw2]))
|
3603
2966
|
fw4 = gcp.compute.Firewall("fw4",
|
3604
2967
|
name="website-fw-4",
|
3605
2968
|
network=default_network.id,
|
@@ -3619,7 +2982,39 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3619
2982
|
ports=["8000"],
|
3620
2983
|
),
|
3621
2984
|
],
|
3622
|
-
direction="INGRESS"
|
2985
|
+
direction="INGRESS",
|
2986
|
+
opts=pulumi.ResourceOptions(depends_on=[fw3]))
|
2987
|
+
default_region_health_check = gcp.compute.RegionHealthCheck("default",
|
2988
|
+
region="us-central1",
|
2989
|
+
name="website-hc",
|
2990
|
+
http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
|
2991
|
+
port_specification="USE_SERVING_PORT",
|
2992
|
+
),
|
2993
|
+
opts=pulumi.ResourceOptions(depends_on=[fw4]))
|
2994
|
+
default_region_backend_service = gcp.compute.RegionBackendService("default",
|
2995
|
+
load_balancing_scheme="EXTERNAL_MANAGED",
|
2996
|
+
backends=[gcp.compute.RegionBackendServiceBackendArgs(
|
2997
|
+
group=rigm.instance_group,
|
2998
|
+
balancing_mode="UTILIZATION",
|
2999
|
+
capacity_scaler=1,
|
3000
|
+
)],
|
3001
|
+
region="us-central1",
|
3002
|
+
name="website-backend",
|
3003
|
+
protocol="HTTP",
|
3004
|
+
timeout_sec=10,
|
3005
|
+
health_checks=default_region_health_check.id)
|
3006
|
+
default_region_url_map = gcp.compute.RegionUrlMap("default",
|
3007
|
+
region="us-central1",
|
3008
|
+
name="website-map",
|
3009
|
+
default_service=default_region_backend_service.id)
|
3010
|
+
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("default",
|
3011
|
+
region="us-central1",
|
3012
|
+
name="website-proxy",
|
3013
|
+
url_map=default_region_url_map.id)
|
3014
|
+
default_address = gcp.compute.Address("default",
|
3015
|
+
name="website-ip-1",
|
3016
|
+
region="us-central1",
|
3017
|
+
network_tier="STANDARD")
|
3623
3018
|
proxy = gcp.compute.Subnetwork("proxy",
|
3624
3019
|
name="website-net-proxy",
|
3625
3020
|
ip_cidr_range="10.129.0.0/26",
|
@@ -3627,6 +3022,18 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3627
3022
|
network=default_network.id,
|
3628
3023
|
purpose="REGIONAL_MANAGED_PROXY",
|
3629
3024
|
role="ACTIVE")
|
3025
|
+
# Forwarding rule for Regional External Load Balancing
|
3026
|
+
default = gcp.compute.ForwardingRule("default",
|
3027
|
+
name="website-forwarding-rule",
|
3028
|
+
region="us-central1",
|
3029
|
+
ip_protocol="TCP",
|
3030
|
+
load_balancing_scheme="EXTERNAL_MANAGED",
|
3031
|
+
port_range="80",
|
3032
|
+
target=default_region_target_http_proxy.id,
|
3033
|
+
network=default_network.id,
|
3034
|
+
ip_address=default_address.address,
|
3035
|
+
network_tier="STANDARD",
|
3036
|
+
opts=pulumi.ResourceOptions(depends_on=[proxy]))
|
3630
3037
|
```
|
3631
3038
|
### Forwarding Rule Vpc Psc
|
3632
3039
|
|
@@ -3783,6 +3190,12 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3783
3190
|
name="service-backend",
|
3784
3191
|
region="us-central1",
|
3785
3192
|
load_balancing_scheme="EXTERNAL")
|
3193
|
+
external_forwarding_rule = gcp.compute.ForwardingRule("external",
|
3194
|
+
name="external-forwarding-rule",
|
3195
|
+
region="us-central1",
|
3196
|
+
ip_address=basic.address,
|
3197
|
+
backend_service=external.self_link,
|
3198
|
+
load_balancing_scheme="EXTERNAL")
|
3786
3199
|
steering = gcp.compute.ForwardingRule("steering",
|
3787
3200
|
name="steering-rule",
|
3788
3201
|
region="us-central1",
|
@@ -3792,13 +3205,8 @@ class ForwardingRule(pulumi.CustomResource):
|
|
3792
3205
|
source_ip_ranges=[
|
3793
3206
|
"34.121.88.0/24",
|
3794
3207
|
"35.187.239.137",
|
3795
|
-
]
|
3796
|
-
|
3797
|
-
name="external-forwarding-rule",
|
3798
|
-
region="us-central1",
|
3799
|
-
ip_address=basic.address,
|
3800
|
-
backend_service=external.self_link,
|
3801
|
-
load_balancing_scheme="EXTERNAL")
|
3208
|
+
],
|
3209
|
+
opts=pulumi.ResourceOptions(depends_on=[external_forwarding_rule]))
|
3802
3210
|
```
|
3803
3211
|
### Forwarding Rule Internallb Ipv6
|
3804
3212
|
|