Puppet Function: gcompute_global_address_ref

Defined in:
lib/puppet/functions/gcompute_global_address_ref.rb
Function type:
Ruby 4.x API

Overview

gcompute_global_address_ref(String $name, String $project)Any

Builds a reference to the global IP address associated with the Address managed by a ‘gcompute_global_address` resource.

Arguments:

- name: string
  the name of the address resource
- project: string
  the project name where resource is allocated

Examples:

- gcompute_global_address_ref('my-server', 'myproject')

This function is useful for when a reference to a resource that have multiple facts, such as ‘gcompute_global_forwarding_rule { ip_address }`

Parameters:

  • name (String)
  • project (String)

Returns:

  • (Any)


44
45
46
47
48
49
50
51
52
53
# File 'lib/puppet/functions/gcompute_global_address_ref.rb', line 44

Puppet::Functions.create_function(:gcompute_global_address_ref) do
  dispatch :gcompute_global_address_ref do
    param 'String', :name
    param 'String', :project
  end

  def gcompute_global_address_ref(name, project)
    "projects/#{project}/global/addresses/#{name}"
  end
end