forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opensearch-project#987 from AndreKurait/CDKSonarQube
Cdk maintenance and tests
- Loading branch information
Showing
16 changed files
with
341 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,6 @@ | ||
#!/usr/bin/env node | ||
import 'source-map-support/register'; | ||
import {readFileSync} from 'fs'; | ||
import {App, Tags} from 'aws-cdk-lib'; | ||
import {StackComposer} from "../lib/stack-composer"; | ||
import { createApp } from './createApp'; | ||
|
||
const app = new App(); | ||
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 | ||
// Environment setting to allow providing an existing AWS AppRegistry application ARN which each created CDK stack | ||
// from this CDK app will be added to. | ||
const migrationsAppRegistryARN = process.env.MIGRATIONS_APP_REGISTRY_ARN | ||
if (migrationsAppRegistryARN) { | ||
console.info(`App Registry mode is enabled for CFN stack tracking. Will attempt to import the App Registry application from the MIGRATIONS_APP_REGISTRY_ARN env variable of ${migrationsAppRegistryARN} and looking in the configured region of ${region}`) | ||
} | ||
const customReplayerUserAgent = process.env.CUSTOM_REPLAYER_USER_AGENT | ||
|
||
new StackComposer(app, { | ||
migrationsAppRegistryARN: migrationsAppRegistryARN, | ||
customReplayerUserAgent: customReplayerUserAgent, | ||
migrationsSolutionVersion: version, | ||
env: { account: account, region: region } | ||
}); | ||
const app = createApp(); | ||
app.synth(); |
28 changes: 28 additions & 0 deletions
28
deployment/cdk/opensearch-service-migration/bin/createApp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { App, Tags } from 'aws-cdk-lib'; | ||
import { readFileSync } from 'fs'; | ||
import { StackComposer } from "../lib/stack-composer"; | ||
|
||
export function createApp(): App { | ||
const app = new App(); | ||
const versionFile = readFileSync('../../../VERSION', 'utf-8'); | ||
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; | ||
const migrationsAppRegistryARN = process.env.MIGRATIONS_APP_REGISTRY_ARN; | ||
const customReplayerUserAgent = process.env.CUSTOM_REPLAYER_USER_AGENT; | ||
|
||
if (migrationsAppRegistryARN) { | ||
console.info(`App Registry mode is enabled for CFN stack tracking. Will attempt to import the App Registry application from the MIGRATIONS_APP_REGISTRY_ARN env variable of ${migrationsAppRegistryARN} and looking in the configured region of ${region}`); | ||
} | ||
|
||
new StackComposer(app, { | ||
migrationsAppRegistryARN: migrationsAppRegistryARN, | ||
customReplayerUserAgent: customReplayerUserAgent, | ||
migrationsSolutionVersion: version, | ||
env: { account: account, region: region } | ||
}); | ||
|
||
return app; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
deployment/cdk/opensearch-service-migration/lib/service-stacks/migration-console-stack.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.