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

access_token

string

The access token used to authenticate.

auth_kind

string / required

The type of credential used.

Choices:

  • "accesstoken"

  • "application"

  • "machineaccount"

  • "serviceaccount"

description

string

An optional description of the spoke.

env_type

string

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.

gateway

dictionary

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.

capacity

string / required

the capacity of the gateway spoke, in Gbps.

Choices:

  • "CAPACITY_1_GBPS"

  • "CAPACITY_10_GBPS"

  • "CAPACITY_100_GBPS"

ip_range_reservations

list / elements=dictionary / required

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.

ip_range

string / required

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.

routers

list / elements=string

Set of Cloud Routers that are attached to this NCC-GW.

group

string

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.

hub

string / required

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.

labels

dictionary

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.

linked_interconnect_attachments

dictionary

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.

exclude_export_ranges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

exclude_import_ranges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

include_export_ranges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

include_import_ranges

list / elements=string

Hub routes fully encompassed by include import ranges are included during import from hub.

“ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed.

site_to_site_data_transfer

boolean / required

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:

  • false

  • true

uris

list / elements=string / required

The URIs of linked interconnect attachment resources.

This property is immutable, to change it, you must delete and recreate the resource.

linked_producer_vpc_network

dictionary

Producer VPC network that is associated with the spoke.

This property is immutable, to change it, you must delete and recreate the resource.

exclude_export_ranges

list / elements=string

IP ranges encompassing the subnets to be excluded from peering.

include_export_ranges

list / elements=string

IP ranges allowed to be included from peering.

network

string / required

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.

peering

string / required

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.

producer_network

string

The URI of the Producer VPC.

This property is immutable, to change it, you must delete and recreate the resource.

linked_router_appliance_instances

dictionary

The URIs of linked Router appliance resources.

exclude_export_ranges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

exclude_import_ranges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

include_export_ranges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

include_import_ranges

list / elements=string

Hub routes fully encompassed by include import ranges are included during import from hub.

“ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed.

instances

list / elements=dictionary / required

The list of router appliance instances.

ip_address

string / required

The IP address on the VM to use for peering.

virtual_machine

string / required

The URI of the virtual machine resource.

site_to_site_data_transfer

boolean / required

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:

  • false

  • true

linked_vpc_network

dictionary

VPC network that is associated with the spoke.

exclude_export_ranges

list / elements=string

IP ranges encompassing the subnets to be excluded from peering.

include_export_ranges

list / elements=string

IP ranges allowed to be included from peering.

uri

string / required

The URI of the VPC network resource.

This property is immutable, to change it, you must delete and recreate the resource.

linked_vpn_tunnels

dictionary

The URIs of linked VPN tunnel resources.

exclude_export_ranges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

exclude_import_ranges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

include_export_ranges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

include_import_ranges

list / elements=string

Hub routes fully encompassed by include import ranges are included during import from hub.

“ALL_IPV4_RANGES” or IPv4 CIDR ranges are allowed.

site_to_site_data_transfer

boolean / required

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:

  • false

  • true

uris

list / elements=string / required

The URIs of linked VPN tunnel resources.

This property is immutable, to change it, you must delete and recreate the resource.

location

string / required

The location for the resource.

This property is immutable, to change it, you must delete and recreate the resource.

name

string / required

The name of the spoke.

Spoke names must be unique.

This property is immutable, to change it, you must delete and recreate the resource.

project

string

The Google Cloud Platform project to use.

scopes

list / elements=string

Array of scopes to be used.

service_account_contents

jsonarg

The contents of a Service Account JSON file,

either in a dictionary or as a JSON string that represents it.

service_account_email

string

An optional service account email address if machineaccount is

selected and the user does not wish to use the default email.

service_account_file

path

The path of a Service Account JSON file if serviceaccount

is selected as type.

state

string

Whether the resource should exist.

Choices:

  • "present" ← (default)

  • "absent"

Notes

Note

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

changed

boolean

Whether the resource was changed.

Returned: always

createTime

string

Output only.

The time the spoke was created.

Returned: success

description

string

An optional description of the spoke.

Returned: when set

gateway

dictionary

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

capacity

string

the capacity of the gateway spoke, in Gbps.

Returned: always

ipRangeReservations

list / elements=dictionary

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

ipRange

string

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

routers

list / elements=string

Set of Cloud Routers that are attached to this NCC-GW.

Returned: success

group

string

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

hub

string

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

labels

dictionary

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

linkedInterconnectAttachments

dictionary

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

excludeExportRanges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

Returned: when set

excludeImportRanges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

Returned: when set

includeExportRanges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

Returned: when set

includeImportRanges

list / elements=string

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

siteToSiteDataTransfer

boolean

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

uris

list / elements=string

The URIs of linked interconnect attachment resources.

This property is immutable, to change it, you must delete and recreate the resource.

Returned: always

linkedProducerVpcNetwork

dictionary

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

excludeExportRanges

list / elements=string

IP ranges encompassing the subnets to be excluded from peering.

Returned: when set

includeExportRanges

list / elements=string

IP ranges allowed to be included from peering.

Returned: when set

network

string

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

peering

string

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

producerNetwork

string

The URI of the Producer VPC.

This property is immutable, to change it, you must delete and recreate the resource.

Returned: success

linkedRouterApplianceInstances

dictionary

The URIs of linked Router appliance resources.

Returned: when set

excludeExportRanges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

Returned: when set

excludeImportRanges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

Returned: when set

includeExportRanges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

Returned: when set

includeImportRanges

list / elements=string

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

instances

list / elements=dictionary

The list of router appliance instances.

Returned: always

ipAddress

string

The IP address on the VM to use for peering.

Returned: always

virtualMachine

string

The URI of the virtual machine resource.

Returned: always

siteToSiteDataTransfer

boolean

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

linkedVpcNetwork

dictionary

VPC network that is associated with the spoke.

Returned: when set

excludeExportRanges

list / elements=string

IP ranges encompassing the subnets to be excluded from peering.

Returned: when set

includeExportRanges

list / elements=string

IP ranges allowed to be included from peering.

Returned: when set

uri

string

The URI of the VPC network resource.

This property is immutable, to change it, you must delete and recreate the resource.

Returned: always

linkedVpnTunnels

dictionary

The URIs of linked VPN tunnel resources.

Returned: when set

excludeExportRanges

list / elements=string

Dynamic routes overlapped/encompassed by exclude export ranges are excluded during export to hub.

Returned: when set

excludeImportRanges

list / elements=string

Hub routes overlapped/encompassed by exclude import ranges are excluded during import from hub.

Returned: when set

includeExportRanges

list / elements=string

Dynamic routes fully encompassed by include export ranges are included during export to hub.

Returned: when set

includeImportRanges

list / elements=string

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

siteToSiteDataTransfer

boolean

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

uris

list / elements=string

The URIs of linked VPN tunnel resources.

This property is immutable, to change it, you must delete and recreate the resource.

Returned: always

name

string

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

reasons

list / elements=dictionary

The reasons for the current state in the lifecycle.

Returned: success

code

string

The code associated with this reason.

Returned: when set

message

string

Human-readable details about this reason.

Returned: when set

userDetails

string

Additional information provided by the user in the RejectSpoke call.

Returned: when set

state

string

Output only.

The current lifecycle state of this spoke.

Returned: success

uniqueId

string

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

updateTime

string

Output only.

The time the spoke was last updated.

Returned: success

Authors

  • Google Inc. (@googlecloudplatform)