Skip to content

Commit

Permalink
feat: storing executionArn in the migrations history table
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalWilinski committed Aug 10, 2022
1 parent c4da6f6 commit 4c6b75a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/custom-resource-migrations-runner.ts
Expand Up @@ -80,6 +80,7 @@ export default class CustomResourceMigrationsRunner extends Construct {
id: migration.migrationId,
status: "in_progress" as MigrationStatus,
startedAt: response.startDate?.toISOString()!,
executionArn: response.executionArn!,
}),
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/migration.ts
Expand Up @@ -75,6 +75,7 @@ export class Migration<T extends object> extends NestedStack {
const result: ScanOutput<any, any, any> = await $AWS.DynamoDB.Scan({
Table: table,
...options,
// Ensure ExclusiveStartKey is not overwritten by options
ExclusiveStartKey: lastEvaluatedKey,
});

Expand Down Expand Up @@ -137,6 +138,7 @@ export class Migration<T extends object> extends NestedStack {
Table: table,
TotalSegments: totalSegments,
...options,
// Ensure Segment and ExclusiveStartKey are not overwritten by options
Segment: index,
ExclusiveStartKey: lastEvaluatedKey,
});
Expand Down
1 change: 1 addition & 0 deletions src/migrations-manager.ts
Expand Up @@ -25,6 +25,7 @@ export type MigrationHistoryItem = {
id: string;
status: MigrationStatus;
startedAt: string;
executionArn: string;
endedAt?: string;
};

Expand Down

0 comments on commit 4c6b75a

Please sign in to comment.