From 3c921dc5cd85c7bccb3b9d0cc12023aace004e55 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 12 Feb 2021 09:00:49 -0800 Subject: [PATCH] Added support for Private Services Connect for Google APIs (#4358) (#376) * updated to mmv1 folder * replaced data source with resources in tests Signed-off-by: Modular Magician --- plugins/modules/gcp_compute_global_address.py | 16 +++++++++---- .../gcp_compute_global_address_info.py | 7 ++++-- .../gcp_compute_global_forwarding_rule.py | 24 ++++++++++++++----- ...gcp_compute_global_forwarding_rule_info.py | 11 +++++++-- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/plugins/modules/gcp_compute_global_address.py b/plugins/modules/gcp_compute_global_address.py index 31df97c..4dab893 100644 --- a/plugins/modules/gcp_compute_global_address.py +++ b/plugins/modules/gcp_compute_global_address.py @@ -78,7 +78,8 @@ options: description: - The prefix length of the IP range. If not present, it means the address field is a single IP address. - - This field is not applicable to addresses with addressType=EXTERNAL. + - This field is not applicable to addresses with addressType=EXTERNAL, or addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT . required: false type: int address_type: @@ -93,8 +94,10 @@ options: purpose: description: - The purpose of the resource. For global internal addresses it can be * VPC_PEERING - - for peer networks This should only be set when using an Internal address. - - 'Some valid choices include: "VPC_PEERING"' + - for peer networks * PRIVATE_SERVICE_CONNECT - for ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Private Service Connect networks This should only be set when using an + Internal address. + - 'Some valid choices include: "VPC_PEERING", "PRIVATE_SERVICE_CONNECT"' required: false type: str network: @@ -218,7 +221,8 @@ prefixLength: description: - The prefix length of the IP range. If not present, it means the address field is a single IP address. - - This field is not applicable to addresses with addressType=EXTERNAL. + - This field is not applicable to addresses with addressType=EXTERNAL, or addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT . returned: success type: int addressType: @@ -231,7 +235,9 @@ addressType: purpose: description: - The purpose of the resource. For global internal addresses it can be * VPC_PEERING - - for peer networks This should only be set when using an Internal address. + - for peer networks * PRIVATE_SERVICE_CONNECT - for ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Private Service Connect networks This should only be set when using an Internal + address. returned: success type: str network: diff --git a/plugins/modules/gcp_compute_global_address_info.py b/plugins/modules/gcp_compute_global_address_info.py index f86436a..e6357d4 100644 --- a/plugins/modules/gcp_compute_global_address_info.py +++ b/plugins/modules/gcp_compute_global_address_info.py @@ -158,7 +158,8 @@ resources: description: - The prefix length of the IP range. If not present, it means the address field is a single IP address. - - This field is not applicable to addresses with addressType=EXTERNAL. + - This field is not applicable to addresses with addressType=EXTERNAL, or addressType=INTERNAL + when purpose=PRIVATE_SERVICE_CONNECT . returned: success type: int addressType: @@ -171,7 +172,9 @@ resources: purpose: description: - The purpose of the resource. For global internal addresses it can be * VPC_PEERING - - for peer networks This should only be set when using an Internal address. + - for peer networks * PRIVATE_SERVICE_CONNECT - for ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Private Service Connect networks This should only be set when using + an Internal address. returned: success type: str network: diff --git a/plugins/modules/gcp_compute_global_forwarding_rule.py b/plugins/modules/gcp_compute_global_forwarding_rule.py index 7c856d7..5c5951f 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule.py @@ -83,7 +83,9 @@ options: ip_protocol: description: - The IP protocol to which this rule applies. When the load balancing scheme is - INTERNAL_SELF_MANAGED, only TCP is valid. + INTERNAL_SELF_MANAGED, only TCP is valid. This field must not be set if the + global address is configured as a purpose of PRIVATE_SERVICE_CONNECT and addressType + of INTERNAL . - 'Some valid choices include: "TCP", "UDP", "ESP", "AH", "SCTP", "ICMP"' required: false type: str @@ -98,8 +100,9 @@ options: - This signifies what the GlobalForwardingRule will be used for. - 'The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External - Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) NOTE: Currently - global forwarding rules cannot be used for INTERNAL load balancing.' + Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Note: This field must be set "" if the global address is configured as + a purpose of PRIVATE_SERVICE_CONNECT and addressType of INTERNAL.' - 'Some valid choices include: "EXTERNAL", "INTERNAL_SELF_MANAGED"' required: false default: EXTERNAL @@ -196,6 +199,9 @@ options: - The URL of the target resource to receive the matched traffic. - The forwarded traffic must be of a type appropriate to the target object. - For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid. + - ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) For global address with a purpose of PRIVATE_SERVICE_CONNECT and addressType + of INTERNAL, only "all-apis" and "vpc-sc" are valid. required: true type: str project: @@ -361,7 +367,9 @@ IPAddress: IPProtocol: description: - The IP protocol to which this rule applies. When the load balancing scheme is - INTERNAL_SELF_MANAGED, only TCP is valid. + INTERNAL_SELF_MANAGED, only TCP is valid. This field must not be set if the global + address is configured as a purpose of PRIVATE_SERVICE_CONNECT and addressType + of INTERNAL . returned: success type: str ipVersion: @@ -374,8 +382,9 @@ loadBalancingScheme: - This signifies what the GlobalForwardingRule will be used for. - 'The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External - Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) NOTE: Currently - global forwarding rules cannot be used for INTERNAL load balancing.' + Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Note: This field must be set "" if the global address is configured as a + purpose of PRIVATE_SERVICE_CONNECT and addressType of INTERNAL.' returned: success type: str metadataFilters: @@ -461,6 +470,9 @@ target: - The URL of the target resource to receive the matched traffic. - The forwarded traffic must be of a type appropriate to the target object. - For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid. + - ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) For global address with a purpose of PRIVATE_SERVICE_CONNECT and addressType + of INTERNAL, only "all-apis" and "vpc-sc" are valid. returned: success type: str ''' diff --git a/plugins/modules/gcp_compute_global_forwarding_rule_info.py b/plugins/modules/gcp_compute_global_forwarding_rule_info.py index 1a3836f..75ec21c 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule_info.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule_info.py @@ -155,7 +155,9 @@ resources: IPProtocol: description: - The IP protocol to which this rule applies. When the load balancing scheme - is INTERNAL_SELF_MANAGED, only TCP is valid. + is INTERNAL_SELF_MANAGED, only TCP is valid. This field must not be set if + the global address is configured as a purpose of PRIVATE_SERVICE_CONNECT and + addressType of INTERNAL . returned: success type: str ipVersion: @@ -169,7 +171,9 @@ resources: - 'The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External Global Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) - NOTE: Currently global forwarding rules cannot be used for INTERNAL load balancing.' + ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) Note: This field must be set "" if the global address is configured + as a purpose of PRIVATE_SERVICE_CONNECT and addressType of INTERNAL.' returned: success type: str metadataFilters: @@ -259,6 +263,9 @@ resources: - The forwarded traffic must be of a type appropriate to the target object. - For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid. + - ([Beta](U(https://terraform.io/docs/providers/google/guides/provider_versions.html)) + only) For global address with a purpose of PRIVATE_SERVICE_CONNECT and addressType + of INTERNAL, only "all-apis" and "vpc-sc" are valid. returned: success type: str '''