S3 Artifact Publisher

The S3ArtifactPublisherDecorator enables a service to publish objects to S3 locations as part of the service lifecycle.

This decorator is implemented as a ServiceDecoratorHookHandler which is supplied to MainEx. For example:

hooks := &sparta.WorkflowHooks{}
payloadData := map[string]interface{}{
  "SomeValue": gocf.Ref("AWS::StackName"),
}

serviceHook := spartaDecorators.S3ArtifactPublisherDecorator(gocf.String("MY-S3-BUCKETNAME"),
  gocf.Join("",
    gocf.String("metadata/"),
    gocf.Ref("AWS::StackName"),
    gocf.String(".json")),
  payloadData)
hooks.ServiceDecorators = []sparta.ServiceDecoratorHookHandler{serviceHook}