class MU::Config::Endpoint

Basket of Kittens config schema and parser logic. See modules/mu/providers/*/api.rb

Public Class Methods

schema() click to toggle source

Base configuration schema for an Endpoint (e.g. AWS API Gateway) @return [Hash]

# File modules/mu/config/endpoint.rb, line 22
def self.schema
{
  "type" => "object",
  "title" => "API Endpoint",
  "description" => "Create a cloud API endpoint, e.g. Amazon API Gateway",
  "required" => ["name", "cloud", "region"],
  "additionalProperties" => false,
  "properties" => {
    "cloud" => MU::Config.cloud_primitive,
    "name" => {"type" => "string"},
    "iam_role" => {"type" => "string"},
    "region" => MU::Config.region_primitive,
    "vpc" => MU::Config::VPC.reference(MU::Config::VPC::NO_SUBNETS, MU::Config::VPC::NO_NAT_OPTS),
    "dns_records" => MU::Config::DNSZone.records_primitive(need_target: false, default_type: "CNAME", need_zone: true, embedded_type: "endpoint"),
    "methods" => {
      "type" => "array",
      "items" => {
        "type" => "object",
        "description" => "Method, as in HTTP method",
        "required" => ["path", "type"],
        "properties" => {
          "path" => {
            "type" => "string",
            "description" => "The path underneath our endpoint at this invocation will be triggered",
            "default" => "/"
          },
          "type" => {
            "type" => "string",
            "enum" => ["GET", "POST", "PUT", "HEAD", "DELETE", "CONNECT", "OPTIONS", "TRACE"],
            "default" => "GET"
          }
        }
      }
    }
  }
} 
end
validate(_endpoint, _configurator) click to toggle source

Generic pre-processing of {MU::Config::BasketofKittens::endpoints}, bare and unvalidated. @param _endpoint [Hash]: The resource to process and validate @param _configurator [MU::Config]: The overall deployment configurator of which this resource is a member @return [Boolean]: True if validation succeeded, False otherwise

# File modules/mu/config/endpoint.rb, line 64
def self.validate(_endpoint, _configurator)
  ok = true

  ok
end