Skip to content

Commit

Permalink
Update per PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tanner Lewis <[email protected]>
  • Loading branch information
lewijacn committed Nov 22, 2024
1 parent bb4c2dd commit 63c4c36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 2 additions & 6 deletions deployment/migration-assistant-solution/bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@ const getProps = () => {

const app = new App();
const infraProps = getProps()
const baseImportVPCStackName = "Migration-Assistant-Infra-Import-VPC"
const baseCreateVPCStackName = "Migration-Assistant-Infra-Create-VPC"
new SolutionsInfrastructureStack(app, baseImportVPCStackName, {
new SolutionsInfrastructureStack(app, "Migration-Assistant-Infra-Import-VPC", {
synthesizer: new DefaultStackSynthesizer(),
createVPC: false,
stackName: infraProps.stackNameSuffix ? `${baseImportVPCStackName}-${infraProps.stackNameSuffix}` : baseImportVPCStackName,
...infraProps
});
new SolutionsInfrastructureStack(app, baseCreateVPCStackName, {
new SolutionsInfrastructureStack(app, "Migration-Assistant-Infra-Create-VPC", {
synthesizer: new DefaultStackSynthesizer(),
createVPC: true,
stackName: infraProps.stackNameSuffix ? `${baseCreateVPCStackName}-${infraProps.stackNameSuffix}` : baseCreateVPCStackName,
...infraProps
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface SolutionsInfrastructureStackProps extends StackProps {
readonly solutionVersion: string;
readonly codeBucket: string;
readonly createVPC: boolean;
readonly stackNameSuffix?: string;
}

interface ParameterLabel {
Expand Down Expand Up @@ -113,7 +114,8 @@ function getVpcEndpointForEFS(stack: Stack): InterfaceVpcEndpointAwsService {
export class SolutionsInfrastructureStack extends Stack {

constructor(scope: Construct, id: string, props: SolutionsInfrastructureStackProps) {
super(scope, id, props);
const finalId = props.stackNameSuffix ? `${id}-${props.stackNameSuffix}` : id
super(scope, finalId, props);
this.templateOptions.templateFormatVersion = '2010-09-09';
new CfnMapping(this, 'Solution', {
mapping: {
Expand Down Expand Up @@ -189,15 +191,15 @@ export class SolutionsInfrastructureStack extends Stack {
});

const serviceEndpoints = [
// Logs and disk usage scales based on total data transfer
// Logs and disk usage scales based on total data transfer
InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS,
getVpcEndpointForEFS(this),

// Elastic container registry is used for all images in the solution
InterfaceVpcEndpointAwsService.ECR,
InterfaceVpcEndpointAwsService.ECR_DOCKER,
];

serviceEndpoints.forEach(service => {
new InterfaceVpcEndpoint(this, `${service.shortName}VpcEndpoint`, {
service,
Expand Down
4 changes: 2 additions & 2 deletions vars/solutionsCFNTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def call(Map config = [:]) {
sh "sudo npm install"
withCredentials([string(credentialsId: 'migrations-test-account-id', variable: 'MIGRATIONS_TEST_ACCOUNT_ID')]) {
withAWS(role: 'JenkinsDeploymentRole', roleAccount: "${MIGRATIONS_TEST_ACCOUNT_ID}", region: "us-east-1", duration: 3600, roleSessionName: 'jenkins-session') {
sh "sudo --preserve-env cdk deploy 'Migration-Assistant-Infra-Create-VPC' --parameters Stage=${stage} --require-approval never --concurrency 3"
sh "sudo --preserve-env cdk deploy Migration-Assistant-Infra-Create-VPC-${env.STACK_NAME_SUFFIX} --parameters Stage=${stage} --require-approval never --concurrency 3"
}
}
// Wait for instance to be ready to accept SSM commands
Expand Down Expand Up @@ -84,7 +84,7 @@ def call(Map config = [:]) {
script {
withCredentials([string(credentialsId: 'migrations-test-account-id', variable: 'MIGRATIONS_TEST_ACCOUNT_ID')]) {
withAWS(role: 'JenkinsDeploymentRole', roleAccount: "${MIGRATIONS_TEST_ACCOUNT_ID}", region: "us-east-1", duration: 3600, roleSessionName: 'jenkins-session') {
sh "sudo --preserve-env cdk destroy 'Migration-Assistant-Infra-Create-VPC' --force"
sh "sudo --preserve-env cdk destroy Migration-Assistant-Infra-Create-VPC-${env.STACK_NAME_SUFFIX} --force"
}
}
}
Expand Down

0 comments on commit 63c4c36

Please sign in to comment.