github.com/mweagle/Sparta@v1.15.0/docs/reference/application/index.xml (about)

     1  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
     2  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
     3    <channel>
     4      <title>Sparta - AWS Lambda Microservices</title>
     5      <link>/reference/application/</link>
     6      <description>Recent content on Sparta - AWS Lambda Microservices</description>
     7      <generator>Hugo -- gohugo.io</generator>
     8      <language>en-US</language>
     9      <lastBuildDate>Wed, 09 Mar 2016 19:56:50 +0100</lastBuildDate>
    10      
    11  	<atom:link href="/reference/application/index.xml" rel="self" type="application/rss+xml" />
    12      
    13      
    14      <item>
    15        <title>Custom Commands</title>
    16        <link>/reference/application/custom_commands/</link>
    17        <pubDate>Wed, 09 Mar 2016 19:56:50 +0100</pubDate>
    18        
    19        <guid>/reference/application/custom_commands/</guid>
    20        <description>In addition to custom flags, an application may register completely new commands. For example, to support alternative topologies or integrated automated acceptance tests as part of a CI/CD pipeline.
    21  To register a custom command, define a new cobra.Command and add it to the sparta.CommandLineOptions.Root command value. Ensure you use the xxxxE Cobra functions so that errors can be properly propagated.
    22  httpServerCommand := &amp;amp;cobra.Command{ Use: &amp;#34;httpServer&amp;#34;, Short: &amp;#34;Sample HelloWorld HTTP server&amp;#34;, Long: `Sample HelloWorld HTTP server that binds to port: ` + HTTPServerPort, RunE: func(cmd *cobra.</description>
    23      </item>
    24      
    25      <item>
    26        <title>Custom Flags</title>
    27        <link>/reference/application/custom_flags/</link>
    28        <pubDate>Wed, 09 Mar 2016 19:56:50 +0100</pubDate>
    29        
    30        <guid>/reference/application/custom_flags/</guid>
    31        <description>Some commands (eg: provision) may require additional options. For instance, your application&amp;rsquo;s provision logic may require VPC subnets or EC2 SSH Key Names.
    32  The default Sparta command line option flags may be extended and validated by building on the exposed Cobra command objects.
    33  Adding Flags To add a flag, use one of the pflag functions to register your custom flag with one of the standard CommandLineOption values.
    34  For example:
    35  // SSHKeyName is the SSH KeyName to use when provisioning new EC2 instance var SSHKeyName string func main() { // And add the SSHKeyName option to the provision step  sparta.</description>
    36      </item>
    37      
    38      <item>
    39        <title>Managing Environments</title>
    40        <link>/reference/application/environments/</link>
    41        <pubDate>Wed, 09 Mar 2016 19:56:50 +0100</pubDate>
    42        
    43        <guid>/reference/application/environments/</guid>
    44        <description>It&amp;rsquo;s common for a single Sparta application to target multiple environments. For example:
    45   Development Staging Production  Each environment is largely similar, but the application may need slightly different configuration in each context.
    46  To support this, Sparta uses Go&amp;rsquo;s conditional compilation support to ensure that configuration information is validated at build time. Conditional compilation is supported via the --tags/-t command line argument.
    47  This example will work through the SpartaConfig sample.</description>
    48      </item>
    49      
    50      <item>
    51        <title>CloudFormation Resources</title>
    52        <link>/reference/application/custom_lambda_resources/</link>
    53        <pubDate>Wed, 09 Mar 2016 19:56:50 +0100</pubDate>
    54        
    55        <guid>/reference/application/custom_lambda_resources/</guid>
    56        <description>In addition to per-lambda custom resources, a service may benefit from the ability to include a service-scoped Lambda backed CustomResource.
    57  Including a custom service scoped resource is a multi-step process. The code excerpts below are from the SpartaCustomResource sample application.
    58  1. Resource Type The first step is to define a custom CloudFormation Resource Type
    59  //////////////////////////////////////////////////////////////////////////////// // 1 - Define the custom type const spartaHelloWorldResourceType = &amp;#34;Custom::sparta::HelloWorldResource&amp;#34; 2. Request Parameters The next step is to define the parameters that are supplied to the custom resource invocation.</description>
    60      </item>
    61      
    62      <item>
    63        <title>Custom Resources</title>
    64        <link>/reference/application/custom_resources/</link>
    65        <pubDate>Wed, 09 Mar 2016 19:56:50 +0100</pubDate>
    66        
    67        <guid>/reference/application/custom_resources/</guid>
    68        <description>In some circumstances your service may need to provision or access resources that fall outside the standard workflow. In this case you can use CloudFormation Lambda-backed CustomResources to create or access resources during your CloudFormation stack&amp;rsquo;s lifecycle.
    69  Sparta provides unchecked access to the CloudFormation resource lifecycle via the RequireCustomResource function. This function registers an AWS Lambda Function as an CloudFormation custom resource lifecycle.
    70  In this section we&amp;rsquo;ll walk through a sample user-defined custom resource and discuss how a custom resource&amp;rsquo;s outputs can be propagated to an application-level Sparta lambda function.</description>
    71      </item>
    72      
    73    </channel>
    74  </rss>