Class: SparkleFormation::SparkleStruct::Google

Inherits:
SparkleFormation::SparkleStruct show all
Includes:
SparkleFormation::SparkleAttribute, SparkleFormation::SparkleAttribute::Google
Defined in:
lib/sparkle_formation/sparkle_struct.rb

Overview

Google specific struct

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from SparkleFormation::SparkleStruct

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SparkleFormation::SparkleStruct

Instance Method Details

#__attribute_key(key) ⇒ String Originally defined in module SparkleFormation::SparkleAttribute

Format the provided key. If symbol type is provided formatting is forced. Otherwise the default formatting is applied

Parameters:

  • key (String, Symbol)

    given key

Returns:

  • (String)

    formatted key

#_dynamic(resource_type, custom_name, options = {}) ⇒ self #_dynamic(dynamic_name, custom_name, options = {}) ⇒ self Also known as: dynamic! Originally defined in module SparkleFormation::SparkleAttribute

Overloads:

  • #_dynamic(resource_type, custom_name, options = {}) ⇒ self
    Note:

    All other options are set into the new resource's properties

    Insert builtin resource

    Parameters:

    • resource_type (String, Symbol)

      provider resource type

    • custom_name (String, Symbol)

      custom name used for resource name generation

    • options (Hash) (defaults to: {})

    Options Hash (options):

    • :resource_name_suffix (String, NilClass)

      custom suffix to use for name generation (defaults to resource_type)

  • #_dynamic(dynamic_name, custom_name, options = {}) ⇒ self
    Note:

    All options are passed to dynamic with custom_name

    Call custom dynamic from available sparkle packs

    Parameters:

    • dynamic_name (Symbol)

      name of registered dynamic

    • custom_name (Symbol, String)

      unique name passed directly to registered dynamic

    • options (Hash) (defaults to: {})

    Options Hash (options):

    • :provider (String, Symbol)

      override provider restriction when fetching dynamic

Yields:

  • (new_struct)

    Provides newly inserted structure

Yield Parameters:

  • new_struct (SparkleStruct)

    newly inserted structure which can be modified

Yield Returns:

  • (Object)

    discarded

Returns:

  • (self)

#_env(e_name) ⇒ SparkleFormation::JinjaExpressionStruct Also known as: env! Originally defined in module SparkleFormation::SparkleAttribute::Google

Request deployment manager environment variable

Parameters:

  • e_name (String, Symbol)

    environment variable name

Returns:

#_google_dynamic!(name, *args, &block) ⇒ Object Originally defined in module SparkleFormation::SparkleAttribute::Google

Note:

generate unique names using the :sparkle_unique argument

Customized dynamic to provide automatic unique name generation for built in resources

#_jinjaSparkleFormation::JinjaExpressionStruct Also known as: jinja!, fn! Originally defined in module SparkleFormation::SparkleAttribute::Google

Jinja function string wrapper

#_method(sym) ⇒ Method Also known as: method! Originally defined in module SparkleFormation::SparkleAttribute

Note:

usually used as puts! method!(:foo).source_location

Lookup a method definition on self

Parameters:

  • sym (Symbol)

    name of method

Returns:

  • (Method)

See Also:

  • Object#method

#_nest(template, *names, options = {}) ⇒ self Also known as: nest! Originally defined in module SparkleFormation::SparkleAttribute

Nest a stack resource

Parameters:

  • template (String, Symbol)

    name of desired template

  • names (String, Symbol)

    list of optional string/symbol values for resource name generation

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :provider (String, Symbol)

    override provider restriction when fetching template

  • :overwrite_name (Truthy, Falsey)

    when set to true, will not include template name in resource name

  • :parameters (Hash)

    compile time parameter values to pass to nested template

Yields:

  • (new_struct)

    Provides newly inserted structure

Yield Parameters:

  • new_struct (SparkleStruct)

    newly inserted structure which can be modified

Yield Returns:

  • (Object)

    discarded

Returns:

  • (self)

#_property(p_name) ⇒ SparkleFormation::JinjaExpressionStruct Also known as: property!, properties! Originally defined in module SparkleFormation::SparkleAttribute::Google

TODO:

Provide lookup validation that defined p_name is valid

Access a property value supplied to template

Parameters:

  • p_name (String, Symbol)

    parameter name

Returns:

#_puts(obj, ...) ⇒ NilClass Also known as: puts! Originally defined in module SparkleFormation::SparkleAttribute

Print to stdout

Parameters:

  • obj (Object)

    object to print

Returns:

  • (NilClass)

See Also:

  • Kernel.puts

#_raise(*args) ⇒ Object Also known as: raise! Originally defined in module SparkleFormation::SparkleAttribute

Raise an exception

See Also:

  • Kernel.raise

#_ref(r_name) ⇒ SparkleFormation::GoogleStruct Also known as: ref! Originally defined in module SparkleFormation::SparkleAttribute::Google

Reference generator. Will lookup defined resource name to validate exist.

Parameters:

  • r_name (String, Symbol)

    resource name

Returns:

#_registry(name) ⇒ Object #_registry(name, *args, options = {}) ⇒ Object Also known as: registry! Originally defined in module SparkleFormation::SparkleAttribute

Return value of registry item

Overloads:

  • #_registry(name) ⇒ Object

    Return value from registry item with given name

    Parameters:

    • name (String, Symbol)

      registry item name

  • #_registry(name, *args, options = {}) ⇒ Object
    Note:

    args and options will be passed directly to registry item when called

    Pass given parameters to registry item with given name and return the value

    Parameters:

    • name (String, Symbol)

      registry item name

    • options (Hash) (defaults to: {})
    • options (Hash) (defaults to: {})

      :provider override provider restriction when fetching registry item

    • args (Object)

      argument list

Returns:

  • (Object)

    return value of registry item

#_resource_nameString Also known as: resource_name! Originally defined in module SparkleFormation::SparkleAttribute

Return current resource name

Returns:

  • (String)

#_stack_output(stack_name, output_name) ⇒ SparkleFormation::JinjaExpressionStruct Also known as: stack_output! Originally defined in module SparkleFormation::SparkleAttribute::Google

Reference output value from nested stack

Parameters:

  • stack_name (String, Symbol)

    logical resource name of stack

  • output_name (String, Symbol)

    stack output name

Returns:

#_statement(line) ⇒ SparkleFormation::JinjaStatementStruct Also known as: statement! Originally defined in module SparkleFormation::SparkleAttribute::Google

Generate a statement

Parameters:

  • line (String)

Returns:

#_system(command) ⇒ String Also known as: system! Originally defined in module SparkleFormation::SparkleAttribute

Execute system command

Parameters:

  • command (String)

Returns:

  • (String)

    result