github.com/mweagle/Sparta@v1.15.0/docs/reference/decorators/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/decorators/</link> 6 <description>Recent content on Sparta - AWS Lambda Microservices</description> 7 <generator>Hugo -- gohugo.io</generator> 8 <language>en-US</language> 9 <lastBuildDate>Sat, 01 Dec 2018 06:18:10 +0000</lastBuildDate> 10 11 <atom:link href="/reference/decorators/index.xml" rel="self" type="application/rss+xml" /> 12 13 14 <item> 15 <title>Application Load Balancer</title> 16 <link>/reference/decorators/application_load_balancer/</link> 17 <pubDate>Sat, 10 Aug 2019 14:59:12 +0000</pubDate> 18 19 <guid>/reference/decorators/application_load_balancer/</guid> 20 <description>The ApplicationLoadBalancerDecorator allows you to expose lambda functions as Application Load Balancer targets. 21 This can be useful to provide HTTP(S) access to one or more Lambda functions without requiring an API-Gateway service. 22 Lambda Function Application Load Balancer (ALB) lambda targets must satisfy a prescribed Lambda signature: 23 import ( awsEvents &#34;github.com/aws/aws-lambda-go/events&#34; ) func(context.Context, awsEvents.ALBTargetGroupRequest) awsEvents.ALBTargetGroupResponse See the ALBTargetGroupRequest and ALBTargetGroupResponse godoc entries for more information. 24 An example ALB-eligible target function might look like:</description> 25 </item> 26 27 <item> 28 <title>CloudMap Service Discovery</title> 29 <link>/reference/decorators/cloudmap/</link> 30 <pubDate>Mon, 27 May 2019 22:31:25 +0000</pubDate> 31 32 <guid>/reference/decorators/cloudmap/</guid> 33 <description>The CloudMapServiceDecorator allows your service to register a service instance for your application. 34 For example, an application that provisions a SQS queue and an AWS Lambda function that consumes messages from that queue may need a way for the Lambda function to discover the dynamically provisioned queue. 35 Sparta supports an environment-based discovery service but that discovery is limited to a single Service. 36 The CloudMapServiceDecorator leverages the CloudMap service to support intra- and inter-service resource discovery.</description> 37 </item> 38 39 <item> 40 <title>CloudFront Distribution</title> 41 <link>/reference/decorators/cloudfront_distribution/</link> 42 <pubDate>Mon, 22 Jan 2018 21:49:38 +0000</pubDate> 43 44 <guid>/reference/decorators/cloudfront_distribution/</guid> 45 <description>The CloudFrontDistributionDecorator associates a CloudFront Distribution with your S3-backed website. It is implemented as a ServiceDecoratorHookHandler as a single service can only provision one CloudFront distribution. 46 Sample usage: 47 //////////////////////////////////////////////////////////////////////////////// // CloudFront settings const subdomain = &#34;mySiteSubdomain&#34; // The domain managed by Route53. const domainName = &#34;myRoute53ManagedDomain.net&#34; // The site will be available at // https://mySiteSubdomain.myRoute53ManagedDomain.net // The S3 bucketname must match the subdomain.domain // name pattern to serve as a CloudFront Distribution target var bucketName = fmt.</description> 48 </item> 49 50 <item> 51 <title>Lambda Versioning Decorator</title> 52 <link>/reference/decorators/lambda_versioning/</link> 53 <pubDate>Mon, 22 Jan 2018 21:49:38 +0000</pubDate> 54 55 <guid>/reference/decorators/lambda_versioning/</guid> 56 <description> TODO: LambdaVersioningDecorator 57 </description> 58 </item> 59 60 <item> 61 <title>Publishing Outputs</title> 62 <link>/reference/decorators/publish_outputs/</link> 63 <pubDate>Mon, 22 Jan 2018 21:49:38 +0000</pubDate> 64 65 <guid>/reference/decorators/publish_outputs/</guid> 66 <description>CloudFormation stack outputs can be used to advertise information about a service. 67 Sparta provides different publishing output decorators depending on the type of CloudFormation resource output: 68 Ref: PublishRefOutputDecorator Fn::Att: PublishAttOutputDecorator Publishing Resource Ref Values For example, to publish the dynamically lambda resource name for a given AWS Lambda function, use PublishRefOutputDecorator such as: 69 lambdaFunctionName := &#34;Hello World&#34; lambdaFn, _ := sparta.NewAWSLambda(lambdaFunctionName, helloWorld, sparta.IAMRoleDefinition{}) lambdaFn.Decorators = append(lambdaFn.Decorators, spartaDecorators.PublishRefOutputDecorator(fmt.Sprintf(&#34;%s FunctionName&#34;, lambdaFunctionName), fmt.</description> 70 </item> 71 72 <item> 73 <title>S3 Artifact Publisher</title> 74 <link>/reference/decorators/s3_artifact_publisher/</link> 75 <pubDate>Mon, 22 Jan 2018 21:49:38 +0000</pubDate> 76 77 <guid>/reference/decorators/s3_artifact_publisher/</guid> 78 <description>The S3ArtifactPublisherDecorator enables a service to publish objects to S3 locations as part of the service lifecycle. 79 This decorator is implemented as a ServiceDecoratorHookHandler which is supplied to MainEx. For example: 80 hooks := &amp;sparta.WorkflowHooks{} payloadData := map[string]interface{}{ &#34;SomeValue&#34;: gocf.Ref(&#34;AWS::StackName&#34;), } serviceHook := spartaDecorators.S3ArtifactPublisherDecorator(gocf.String(&#34;MY-S3-BUCKETNAME&#34;), gocf.Join(&#34;&#34;, gocf.String(&#34;metadata/&#34;), gocf.Ref(&#34;AWS::StackName&#34;), gocf.String(&#34;.json&#34;)), payloadData) hooks.ServiceDecorators = []sparta.ServiceDecoratorHookHandler{serviceHook} </description> 81 </item> 82 83 <item> 84 <title>Dynamic Infrastructure</title> 85 <link>/reference/decorators/dynamic_infrastructure/</link> 86 <pubDate>Sat, 01 Dec 2018 06:28:42 +0000</pubDate> 87 88 <guid>/reference/decorators/dynamic_infrastructure/</guid> 89 <description>In addition to provisioning AWS Lambda functions, Sparta supports the creation of other CloudFormation Resources. This enables a service to move towards immutable infrastructure, where the service and its infrastructure requirements are treated as a logical unit. 90 For instance, consider the case where two developers are working in the same AWS account. 91 Developer 1 is working on analyzing text documents. Their lambda code is triggered in response to uploading sample text documents to S3.</description> 92 </item> 93 94 </channel> 95 </rss>