Ok this is my working Dynamo -> S3 import.
https://gist.github.com/osvadimos/2954ce4c0f7fc249594c999822e639f2
Regarding your question.
First you have to create Fail/Success Object
public static PipelineObject getSNSFailActivity() {
String name = "FailureNotify";
String id = "FailureNotify";
Field type = new Field()
.withKey("type")
.withStringValue("SnsAlarm");
Field topicArn = new Field()
.withKey("topicArn")
.withStringValue("#{myTopicFail}");
Field role = new Field()
.withKey("role")
.withStringValue("DataPipelineDefaultRole");
Field subject = new Field()
.withKey("subject")
.withStringValue("FAIL: #{node.@scheduledStartTime}");
Field message = new Field()
.withKey("message")
.withStringValue("#{myDDBTableName}");
List<Field> fieldsList = Lists.newArrayList(type,
role,
topicArn,
subject,
message);
return new PipelineObject()
.withName(name)
.withId(id)
.withFields(fieldsList);
}
You have to add reference of Fail/Success object to your S3BackupLocation object
public static PipelineObject getS3BackupLocation() {
String name = "S3BackupLocation";
String id = "S3BackupLocation";
Field type = new Field()
.withKey("type")
.withStringValue("S3DataNode");
Field directoryPath = new Field()
.withKey("directoryPath")
.withStringValue("#{myOutputS3Location}#{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}");
Field onFail = new Field()
.withKey("onFail")
.withRefValue("FailureNotify");
Field onSuccess = new Field()
.withKey("onSuccess")
.withRefValue("SuccessNotify");
List<Field> fieldsList = Lists.newArrayList(type,
directoryPath,
onFail,
onSuccess);
return new PipelineObject()
.withName(name)
.withId(id)
.withFields(fieldsList);
}