network#

State module for managing Networks.

async idem_gcp.states.gcp.compute.network.present(hub, ctx, name: str, resource_id: str = None, request_id: str = None, project: str = None, auto_create_subnetworks: bool = None, description: str = None, enable_ula_internal_ipv6: bool = None, internal_ipv6_range: str = None, mtu: int = None, network_firewall_policy_enforcement_order: str = None, routing_config: ~types.NetworkRoutingConfig = None, peerings: ~typing.List[~types.NetworkPeering] = None, id_: (dict_tools.typing.Computed.<class 'str'>, 'alias=id') = None) Dict[str, Any][source]#

Creates a network in the specified project using the data included in the request.

Parameters:
  • name (str) – An Idem name of the resource.

  • request_id (str, Optional) – An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). Defaults to None.

  • project (str, Optional) – Project ID for this request.

  • routing_config (NetworkRoutingConfig, Optional) –

    The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. Defaults to None.

    • routing_mode(str, Optional):

      The network-wide routing mode to use. If set to REGIONAL, this network’s Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network’s Cloud Routers will advertise routes with all subnets of this network, across regions. Enum type. Allowed values:

      ”GLOBAL” “REGIONAL”

  • description (str, Optional) – An optional description of this resource. Provide this field when you create the resource. Defaults to None.

  • auto_create_subnetworks (bool, Optional) – Must be set to create a VPC network. If not set, a legacy network is created. When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. For custom mode VPC networks, you can add subnets using the subnetworks insert method. Defaults to None.

  • internal_ipv6_range (str, Optional) – When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. . Defaults to None.

  • network_firewall_policy_enforcement_order (str, Optional) – The network firewall policy enforcement order. Can be either AFTER_CLASSIC_FIREWALL or BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is not specified. Defaults to None.

  • enable_ula_internal_ipv6 (bool, Optional) – Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. . Defaults to None.

  • mtu (int, Optional) – Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. Defaults to None.

  • resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.

  • peerings (List[Dict[str, Any]], Optional) –

    A list of network peerings for the resource. Defaults to None.

    • export_custom_routes(bool, Optional):

      Whether to export the custom routes to peer network. The default value is false.

    • auto_create_routes(bool, Optional):

      This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

    • network(str, Optional):

      The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

    • name(str, Optional):

      Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression [a-z]([-a-z0-9]*[a-z0-9])?. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

    • state(str, Optional):

      [Output Only] State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there’s a matching configuration in the peer network. Enum type. Allowed values:

      ”ACTIVE” - Matching configuration exists on the peer. “INACTIVE” - There is no matching configuration on the peer, including the case when peer does not exist.

    • peer_mtu(int, Optional):

      Maximum Transmission Unit in bytes.

    • import_subnet_routes_with_public_ip(bool, Optional):

      Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.

    • import_custom_routes(bool, Optional):

      Whether to import the custom routes from peer network. The default value is false.

    • state_details(str, Optional):

      [Output Only] Details about the current state of the peering.

    • export_subnet_routes_with_public_ip(bool, Optional):

      Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.

    • exchange_subnet_routes(bool, Optional):

      Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.

    • stack_type(str, Optional):

      Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Enum type. Allowed values:

      ”IPV4_IPV6” - This Peering will allow IPv4 traffic and routes to be exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6 traffic and routes will be exchanged as well. “IPV4_ONLY” - This Peering will only allow IPv4 traffic and routes to be exchanged, even if the matching peering is IPV4_IPV6.

  • id (str, Optional) – The unique identifier for the resource. This identifier is defined by the server. Read-only property

Returns:

Dict[str, Any]

Examples

example_resource_name:
  gcp.compute.network.present:
    - project: project-name
    - auto_create_subnetworks: false
async idem_gcp.states.gcp.compute.network.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

Retrieves the list of networks available to the specified project.

Returns:

Dict[str, Dict[str, Any]]

Examples

$ idem describe gcp.compute.network
idem_gcp.states.gcp.compute.network.is_pending(hub, ret: dict, state: str = None, **pending_kwargs) bool[source]#

Default implemented for each module.