All Versions
73
Latest Version
Avg Release Cycle
50 days
Latest Release
-
Changelog History
Page 2
Changelog History
Page 2
-
v1.9.2 Changes
February 17, 2019- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Added
API.EndpointConfiguration
field to API. - This field exposes the EndpointConfiguration property to specify either EDGE or REGIONAL API types.
- Added
decorator.APIGatewayDomainDecorator
to associate a custom domain with an API Gateway instance - Usage:
hooks := &sparta.WorkflowHooks{} serviceDecorator := spartaDecorators.APIGatewayDomainDecorator(apiGateway, gocf.String(acmCertARNLiteral), "", // Optional base path value "subdomain.mydomain.net") hooks.ServiceDecorators = []sparta.ServiceDecoratorHookHandler{ serviceDecorator, }
- See apigateway_domain_test for a complete example.
- See the AWS Documentation for more information.
- Added
๐ :bug: FIXED
-
v1.9.1 Changes
February 03, 2019- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Added
CodeCommitPermission
type to support CodeCommit notifications - There is an archetype constructor that encapsulates this type of Lambda reactor.
- Usage:
func echoCodeCommit(ctx context.Context, event awsLambdaEvents.CodeCommitEvent) (interface{}, error) { // ... return &event, nil } func main() { // ... reactor, reactorErr := spartaArchetype.NewCodeCommitReactor(spartaArchetype.CodeCommitReactorFunc(echoCodeCommit), gocf.String("TestCodeCommitRepo"), nil, nil, nil) ... }
- Updated to staticcheck.io
- Added
๐ :bug: FIXED
-
v1.9.0 Changes
January 21, 2019- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Added
LambdaAWSInfo.Layers
field to support Lambda Layers - Usage:
lambdaRole := sparta.IAMRoleDefinition{ Privileges: []sparta.IAMRolePrivilege{ iamBuilder.Allow("lambda:GetLayerVersion"). ForResource(). Literal("*"). ToPrivilege(), }, } lambdaFn, lambdaFnErr := sparta.NewAWSLambda("Hello World", helloWorld, lambdaRole) lambdaFn.Layers = []gocf.Stringable{ gocf.String("arn:aws:lambda:us-west-2:123412341234:layer:ffmpeg:1"), }
- Added
WithCondition
to IAM Builder - Added
s3Site.UserManifestData
map property to allow for custom user data to be included in MANIFEST.json content that is deployed to an S3 Site bucket. - Userdata is scoped to a userdata keyname in MANIFEST.json
- See the SpartaAmplify sample app for a complete example.
- Added
github.com/mweagle/Sparta/system.RunAndCaptureOSCommand
- This is convenience function to support alternative
io.Writer
sinks for stdout and stderr. - Minor usability improvements to
--status
report output
- Added
๐ :bug: FIXED
-
v1.8.0 Changes
- ๐ฅ :warning: BREAKING
- Renamed
archetype.CloudWatchLogsReactor
toarchetype.CloudWatchReactor
- Also changed
OnLogMessage
toOnCloudWatchMessage
- I consistently forget the fact that CloudWatch is more than logs
- Moved the internal
cloudwatchlogs
package to thecloudwatch/logs
import path - Renamed fluent typenames in github.com/mweagle/Sparta/aws/iam/builder to support Principal-based builders
- Renamed
step.NewTaskState
tostep.NewLambdaTaskState
to enable type specific Step function services. - Simplified versioning Lambda resource so that the Lambda::Version resource is orphaned (via DeletionPolicy) rather than the prior implementation, which fetched all versions from the provisioned template and accumulated them over time.
- This also obsoleted the
ContextKeyLambdaVersions
constant
- Renamed
:checkered_flag: CHANGES
- More documentation
- Added Step function service integrations
- See the SpartaStepServicefull project for an example of a service that:
- Provisions no Lambda functions
- Dockerizes itself
- Pushes that image to ECR
- Uses the resulting ECR Image URL as a Fargate Task in a Step function:
- Added github.com/mweagle/Sparta/aws/iam/builder.IAMBuilder::ForPrincipals fluent builder. Example usage:
"Statement": []spartaIAM.PolicyStatement{ iamBuilder.Allow("sts:AssumeRole"). ForPrincipals("states.amazonaws.com"). ToPolicyStatement(),
- Upgraded to
docker login --password-stdin
for local authentication. Previously useddocker login --password
. Example:
INFO[0005] df64d3292fd6: Preparing INFO[0006] denied: Your Authorization Token has expired. Please run 'aws ecr get-login --no-include-email' to fetch a new one. INFO[0006] ECR push failed - reauthorizing Error="exit status 1" INFO[0006] Login Succeeded INFO[0006] The push refers to repository [123412341234.dkr.ecr.us-west-2.amazonaws.com/argh]
- See the Docker docs
- Include
docker -v
output in log when calling BuildDockerImage - Added
StateMachineNamedDecorator(stepFunctionResourceName)
to supply the name of the Step function - Migrated all API-Gateway integration mappings to use the mapping override support in VTL.
- This reduces the number of API-Gateway RegExp-based integration mappings and relies on a Lambda function returning a shape that matches the default application/json expectations:
{ "code" : int, "body" : ..., "headers": { "x-lowercase-header" : "foo", } }
- The default shape can be customized by providing custom mapping templates to the IntegrationResponses
- rest.MethodHandler:Headers has been deprecated.
- Moving all header management to VTL eliminated the need to explicitly declare headers.
- Added
spartaDecorators.PublishAllResourceOutputs(cfResourceName, gocf.ResourceProperties)
which adds all the associated resourceRef
andAtt
values to the Stack Outputs - The set of
Att
values is extracted from the CloudFormation Resource Specification via the go-cloudformation project.
๐ :bug: FIXED
- API Gateway custom headers were not being properly returned
- RegisterLambdaUtilizationMetricPublisher Name ref obsolete
- ๐ฅ :warning: BREAKING
-
v1.7.3 Changes
- ๐ฅ :warning: BREAKING
- Renamed
archetype.NewCloudWatchLogsReactor
toarchetype.NewCloudWatchReactor
- Renamed
- :checkered_flag: CHANGES
- Moved all documentation into the master branch to make it a bit easier to update docs together with code.
- See /docs_source/content/meta/_index.md for how to edit, preview, and submit.
- Added
archetype.NewCloudWatchScheduledReactor
andarchetype.NewCloudWatchEventedReactor
- ๐ :bug: FIXED
- ๐ฅ :warning: BREAKING
-
v1.7.2 Changes
- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Moved
decorator.DriftDetector
tovalidator.DriftDetector
and changed signature to ServiceValidationHookHandler - Clearly I was too focused on enabling drift detection than enabling it in an appropriate place.
- Updated usage:
import ( "github.com/mweagle/Sparta/v3/validator" ) workflowHooks := &sparta.WorkflowHooks{ Validators: []sparta.ServiceValidationHookHandler{ validator.DriftDetector(true), }, }
- Added
LambdaFuncName
to output when stack drift detected. - Example:
WARN[0013] Stack drift detected Actual=debug Expected=info LambdaFuncName="Hello World" PropertyPath=/Environment/Variables/SPARTA_LOG_LEVEL Relation=NOT_EQUAL Resource=HelloWorldLambda80576f7b21690b0cb485a6b69c927aac972cd693
- Moved
๐ :bug: FIXED
-
v1.7.1 Changes
- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Added
decorator.DriftDetector
to optionally prevent operations in the presence of CloudFormation Drift. - Usage:
workflowHooks := &sparta.WorkflowHooks{ PreBuilds: []sparta.WorkflowHookHandler{ decorator.DriftDetector(false), }, }
- Sample output:
INFO[0001] Calling WorkflowHook Phase=PreBuild WorkflowHookContext="map[]" INFO[0001] Waiting for drift detection to complete Status=DETECTION_IN_PROGRESS ERRO[0012] Stack drift detected Actual=debug Expected=info PropertyPath=/Environment/Variables/SPARTA_LOG_LEVEL Relation=NOT_EQUAL Resource=HelloWorldLambda80576f7b21690b0cb485a6b69c927aac972cd693 INFO[0012] Invoking rollback functions ERRO[0012] Failed to provision service: DecorateWorkflow returned an error: stack MyHelloWorldStack-mweagle prevented update due to drift being detected
- Usability improvements when errors produced. Previously the usage instructions were output on every failed command. Now they are only displayed if there are CLI argument validation errors.
- Usability improvement to log individual validation errors if the CLI arguments are invalid.
- Added
๐ :bug: FIXED
- Fixed latent issue where Sparta misreported its internal version
-
v1.7.0 Changes
- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Added
LambdaAWSInfo.Interceptors
support Interceptors
are functions (func(context.Context, json.RawMessage) context.Context
) called in the normal event handling lifecycle to support cross cutting concerns. They are the runtime analog toWorkflowHooks
.- The following stages are supported:
- Begin: Called as soon as Sparta determines which user-function to invoke
- BeforeSetup: Called before Sparta creates your lambda's
context
value - AfterSetup: Called after Sparta creates your lambda's
context
value - BeforeDispatch: Called before Sparta invokes your lambda function
- AfterDispatch: Called after Sparta invokes your lambda function
- Complete: Called immediately before Sparta returns your function return value(s) to AWS
- The first interceptor is
interceptor.RegisterXRayInterceptor(ctx, options)
which creates a custom XRay Segment spanning your lambda's execution and supports:- Including the service BuildID in the Trace Annotation
- Optionally including the incoming event, all log statements (trace and higher), and AWS request-id as Trace Metadata ONLY in the case when your lambda function returns an error.
- Log messages are stored in a ring buffer and limited to 1024 entries.
- This data is associated with XRay Traces in the console. Example:
- See the SpartaXRayInterceptor repo for a complete sample
- Go back in time to when you wish you had enabled debug-level logging before the error ever occurred.
- Expose
sparta.ProperName
as framework name literal - Add lightweight Key-Value interface and S3 and DynamoDB implementations to support SpartaTodoBackend
- The DynamoDB provider uses dynamodbattribute to map
go
structs to attributes. - See the aws.accessor docs
- Added
๐ :bug: FIXED
-
v1.6.0 Changes
- ๐ฅ :warning: BREAKING
- Eliminate pre 1.0 GM Sparta function signature:
type LambdaFunction func(*json.RawMessage, *LambdaContext, http.ResponseWriter, *logrus.Logger)
๐ - See the AWS Docs for officially supported signatures
- Changed API Gateway response mapping to support body and header return values.
- API Gateway lambda functions should use
aws/apigateway.NewResponse
to produce a newResponse
type with struct fields that are properly interpreted by the new$input.json('$.body')
mapping expression. - The change was driven by the SpartaTodoBackend service's need to return both a body and HTTP location header.
- See the response for an example
- Eliminate pre 1.0 GM Sparta function signature:
:checkered_flag: CHANGES
- Add more go idiomatic
sparta.NewAWSLambda(...) (*sparta.LambdaAWSInfo, error)
constructor - The existing
sparta.HandleAWSLambda
function is deprecated and will be removed in a subsequent release - Added Sparta/archetype/rest package to streamline REST-based Sparta services.
- This package includes a fluent builder (
MethodHandler
) and constructor function (RegisterResource
) that transforms a rest.Resource implementing struct into an API Gateway resource. - Usage:
// File: resource.go // TodoItemResource is the /todo/{id} resource type TodoItemResource struct { } // ResourceDefinition returns the Sparta REST definition for the Todo item func (svc *TodoItemResource) ResourceDefinition() (spartaREST.ResourceDefinition, error) { return spartaREST.ResourceDefinition{ URL: todoItemURL, MethodHandlers: spartaREST.MethodHandlerMap{ ... } }, nil } // File: main.go func() { myResource := &TodoItemResource{} resourceMap, resourcesErr := spartaREST.RegisterResource(apiGatewayInstance, myResource) }
- Sample fluent method builder:
// GET http.MethodGet: spartaREST.NewMethodHandler(svc.Get, http.StatusOK). StatusCodes(http.StatusInternalServerError). Privileges(svc.S3Accessor.KeysPrivilege("s3:GetObject"), svc.S3Accessor.BucketPrivilege("s3:ListBucket")),
- See SpartaTodoBackend for a complete example
- The SpartaTodoBackend is a self-deploying CORS-accessible service that satisfies the TodoBackend online tests
- Added Sparta/aws/accessor package to streamline S3-backed service creation.
- Embed a
services.S3Accessor
type to enable utility methods for:Put
Get
GetAll
Delete
DeleteAll
- Added prealloc check to ensure that slices are preallocated when possible
- Add more go idiomatic
๐ :bug: FIXED
- Fix latent issue where CloudWatch Log ARN was malformed commit
- ๐ฅ :warning: BREAKING
-
v1.5.0 Changes
- ๐ฅ :warning: BREAKING
:checkered_flag: CHANGES
- Expose
sparta.InstanceID()
that returns a random instance identifier for a single Lambda container instance - The instanceID field is also included in the ContextLogger
- Add a self-monitoring function that publishes container-level metrics to CloudWatch.
- Usage:
import spartaCloudWatch "github.com/mweagle/Sparta/v3/aws/cloudwatch" func main() { ... spartaCloudWatch.RegisterLambdaUtilizationMetricPublisher(map[string]string{ "BuildId": sparta.StampedBuildID, }) ... }
- The optional
map[string]string
parameter is the custom Name-Value pairs to use as a CloudWatch Dimension - Add
WorkflowHooks.Validators
to support policy-based validation of the materialized template. - Each validator receives a complete read-only copy of the template
- Add magefile actions in github.com/mweagle/Sparta/magefile to support cross platform scripting.
- A Sparta service can use a standard magefile.go as in:
// +build mage package main import ( spartaMage "github.com/mweagle/Sparta/v3/magefile" ) // Provision the service func Provision() error { return spartaMage.Provision() } // Describe the stack by producing an HTML representation of the CloudFormation // template func Describe() error { return spartaMage.Describe() } // Delete the service, iff it exists func Delete() error { return spartaMage.Delete() } // Status report if the stack has been provisioned func Status() error { return spartaMage.Status() } // Version information func Version() error { return spartaMage.Version() }
which exposes the most common Sparta command line options.
- Usage:
mage status
:
$ mage status INFO[0000] โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ INFO[0000] โโโโโโโโโโฆโโโโฆโโโโ Version : 1.5.0 INFO[0000] โโโโ โโโ โโฃโ โฆโ โ โ โโฃ SHA : 8f199e1 INFO[0000] โโโโฉ โฉ โฉโฉโโ โฉ โฉ โฉ Go : go1.11.1 INFO[0000] โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ INFO[0000] Service: MyHelloWorldStack-mweagle LinkFlags= Option=status UTC="2018-10-20T04:46:57Z" INFO[0000] โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ INFO[0001] StackId Id="arn:aws:cloudformation:us-west-2:************:stack/MyHelloWorldStack-mweagle/5817dff0-c5f1-11e8-b43a-503ac9841a99" INFO[0001] Stack status State=UPDATE_COMPLETE INFO[0001] Created Time="2018-10-02 03:14:59.127 +0000 UTC" INFO[0001] Last Update Time="2018-10-19 03:23:00.048 +0000 UTC" INFO[0001] Tag io:gosparta:buildId=7ee3e1bc52f15c4a636e05061eaec7b748db22a9
- Expose
๐ :bug: FIXED
- Fix latent issue where multiple archetype handlers of the same type would collide.