Skip to content

Commit

Permalink
[Bugfix] Strip newlines from VERSION file before using it as AWS tag …
Browse files Browse the repository at this point in the history
…value (opensearch-project#449)

Signed-off-by: Kartik Ganesh <gkart@amazon.com>
  • Loading branch information
kartg authored Nov 16, 2023
1 parent 5051356 commit b41128e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deployment/cdk/opensearch-service-migration/bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {App, Tags} from 'aws-cdk-lib';
import {StackComposer} from "../lib/stack-composer";

const app = new App();
const version = readFileSync('../../../VERSION', 'utf-8')
const versionFile = readFileSync('../../../VERSION', 'utf-8')
// Remove any blank newlines because this would be an invalid tag value
const version = versionFile.replace(/\n/g, '');
Tags.of(app).add("migration_deployment", version)
const account = process.env.CDK_DEFAULT_ACCOUNT
const region = process.env.CDK_DEFAULT_REGION
Expand Down

0 comments on commit b41128e

Please sign in to comment.