google.cloud.gcp_networkconnectivity_spoke module – Manages a NetworkConnectivity.Spoke resource
Note
This module is part of the google.cloud collection (version 1.16.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install google.cloud.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: google.cloud.gcp_networkconnectivity_spoke.
Synopsis
The NetworkConnectivity Spoke resource
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.8
requests >= 2.18.4
google-auth >= 2.25.1
Parameters
Parameter |
Comments |
|---|---|
The access token used to authenticate. |
|
The type of credential used. Choices:
|
|
An optional description of the spoke. |
|
Specifies which Ansible environment you’re running this module within. This should not be set unless you know what you’re doing. This only alters the User Agent string for any API requests. |
|
This is a gateway that can apply specialized processing to traffic going through it. This property is immutable, to change it, you must delete and recreate the resource. |
|
the capacity of the gateway spoke, in Gbps. Choices:
|
|
A list of IP ranges that are reserved for this gateway’s internal infrastructure. This property is immutable, to change it, you must delete and recreate the resource. |
|
A block of IP address ranges used to allocate supporting infrastructure for this gateway—for example, 10.1.2.0/23. The IP address block must be a /23 range. This IP address block must not overlap with subnets in any spoke or peer network that the gateway can communicate with. This property is immutable, to change it, you must delete and recreate the resource. |
|
Set of Cloud Routers that are attached to this NCC-GW. |
|
The name of the group that this spoke is associated with. This property is immutable, to change it, you must delete and recreate the resource. |
|
The URI of the hub that this spoke is attached to. This property is immutable, to change it, you must delete and recreate the resource. |
|
Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://docs.cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. |
|
A collection of VLAN attachment resources. These resources should be redundant attachments that all advertise the same prefixes to Google Cloud. Alternatively, in active/passive configurations, all attachments should be capable of advertising the same prefixes. |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Choices:
|
|
The URIs of linked interconnect attachment resources. This property is immutable, to change it, you must delete and recreate the resource. |
|
Producer VPC network that is associated with the spoke. This property is immutable, to change it, you must delete and recreate the resource. |
|
IP ranges encompassing the subnets to be excluded from peering. |
|
IP ranges allowed to be included from peering. |
|
The URI of the Service Consumer VPC that the Producer VPC is peered with. This property is immutable, to change it, you must delete and recreate the resource. |
|
The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state. This property is immutable, to change it, you must delete and recreate the resource. |
|
The URI of the Producer VPC. This property is immutable, to change it, you must delete and recreate the resource. |
|
The URIs of linked Router appliance resources. |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. |
|
The list of router appliance instances. |
|
The IP address on the VM to use for peering. |
|
The URI of the virtual machine resource. |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Choices:
|
|
VPC network that is associated with the spoke. |
|
IP ranges encompassing the subnets to be excluded from peering. |
|
IP ranges allowed to be included from peering. |
|
The URI of the VPC network resource. This property is immutable, to change it, you must delete and recreate the resource. |
|
The URIs of linked VPN tunnel resources. |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Choices:
|
|
The URIs of linked VPN tunnel resources. This property is immutable, to change it, you must delete and recreate the resource. |
|
The location for the resource. This property is immutable, to change it, you must delete and recreate the resource. |
|
The name of the spoke. Spoke names must be unique. This property is immutable, to change it, you must delete and recreate the resource. |
|
The Google Cloud Platform project to use. |
|
Array of scopes to be used. |
|
The contents of a Service Account JSON file, either in a dictionary or as a JSON string that represents it. |
|
An optional service account email address if machineaccount is selected and the user does not wish to use the default email. |
|
The path of a Service Account JSON file if serviceaccount is selected as type. |
|
Whether the resource should exist. Choices:
|
Notes
Note
API Reference: https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.spokes
Official Documentation Guide: https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/overview
For authentication, you can set auth_kind using the
GCP_AUTH_KINDenv variable.For authentication, you can set service_account_file using the
GCP_SERVICE_ACCOUNT_FILEenv variable.For authentication, you can set service_account_contents using the
GCP_SERVICE_ACCOUNT_CONTENTSenv variable.For authentication, you can set service_account_email using the
GCP_SERVICE_ACCOUNT_EMAILenv variable.For authentication, you can set access_token using the
GCP_ACCESS_TOKENenv variable.For authentication, you can set scopes using the
GCP_SCOPESenv variable.Environment variables values will only be used if the playbook values are not set.
The
service_account_email,service_account_file,service_account_fileandaccess_tokenoptions are mutually exclusive.
Examples
- name: Create Network Connectivity Spoke
google.cloud.gcp_networkconnectivity_spoke:
name: my-spoke
state: present
description: A gateway spoke
location: us-central1
hub: projects/my-project/locations/global/hubs/my-hub
gateway:
ip_range_reservations:
- ip_range: 10.0.0.0/23
capacity: CAPACITY_1_GBPS
group: gateways
################################################################################
- name: Delete Network Connectivity Spoke
google.cloud.gcp_networkconnectivity_spoke:
name: my-spoke
state: absent
location: us-central1
hub: projects/my-project/locations/global/hubs/my-hub
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the resource was changed. Returned: always |
|
Output only. The time the spoke was created. Returned: success |
|
An optional description of the spoke. Returned: when set |
|
This is a gateway that can apply specialized processing to traffic going through it. This property is immutable, to change it, you must delete and recreate the resource. Returned: when set |
|
the capacity of the gateway spoke, in Gbps. Returned: always |
|
A list of IP ranges that are reserved for this gateway’s internal infrastructure. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
A block of IP address ranges used to allocate supporting infrastructure for this gateway—for example, 10.1.2.0/23. The IP address block must be a /23 range. This IP address block must not overlap with subnets in any spoke or peer network that the gateway can communicate with. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
Set of Cloud Routers that are attached to this NCC-GW. Returned: success |
|
The name of the group that this spoke is associated with. This property is immutable, to change it, you must delete and recreate the resource. Returned: when set |
|
The URI of the hub that this spoke is attached to. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://docs.cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Returned: when set |
|
A collection of VLAN attachment resources. These resources should be redundant attachments that all advertise the same prefixes to Google Cloud. Alternatively, in active/passive configurations, all attachments should be capable of advertising the same prefixes. Returned: when set |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. Returned: when set |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. Returned: when set |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. Returned: when set |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. Returned: when set |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The URIs of linked interconnect attachment resources. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
Producer VPC network that is associated with the spoke. This property is immutable, to change it, you must delete and recreate the resource. Returned: when set |
|
IP ranges encompassing the subnets to be excluded from peering. Returned: when set |
|
IP ranges allowed to be included from peering. Returned: when set |
|
The URI of the Service Consumer VPC that the Producer VPC is peered with. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The URI of the Producer VPC. This property is immutable, to change it, you must delete and recreate the resource. Returned: success |
|
The URIs of linked Router appliance resources. Returned: when set |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. Returned: when set |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. Returned: when set |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. Returned: when set |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. Returned: when set |
|
The list of router appliance instances. Returned: always |
|
The IP address on the VM to use for peering. Returned: always |
|
The URI of the virtual machine resource. Returned: always |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
VPC network that is associated with the spoke. Returned: when set |
|
IP ranges encompassing the subnets to be excluded from peering. Returned: when set |
|
IP ranges allowed to be included from peering. Returned: when set |
|
The URI of the VPC network resource. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The URIs of linked VPN tunnel resources. Returned: when set |
|
Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub. Returned: when set |
|
Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub. Returned: when set |
|
Dynamic routes fully encompassed by include export ranges are included during export to hub. Returned: when set |
|
Hub routes fully encompassed by include import ranges are included during import from hub. “ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed. Returned: when set |
|
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The URIs of linked VPN tunnel resources. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The name of the spoke. Spoke names must be unique. This property is immutable, to change it, you must delete and recreate the resource. Returned: always |
|
The reasons for the current state in the lifecycle. Returned: success |
|
The code associated with this reason. Returned: when set |
|
Human-readable details about this reason. Returned: when set |
|
Additional information provided by the user in the RejectSpoke call. Returned: when set |
|
Output only. The current lifecycle state of this spoke. Returned: success |
|
Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different unique_id. Returned: success |
|
Output only. The time the spoke was last updated. Returned: success |