Skip to content

Commit

Permalink
test: add unique discriminator to testing-tier props (#1166)
Browse files Browse the repository at this point in the history
Signed-off-by: Caden Marofke <marofke@amazon.com>
  • Loading branch information
marofke authored Dec 20, 2023
1 parent da99c9a commit 4fa745b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const structs: Array<StorageStruct> = [
}),
];

new RepositoryTestingTier(app, 'RFDKInteg-DL-TestingTier' + integStackTag, { env, integStackTag, structs });
new RepositoryTestingTier(app, 'RFDKInteg-DL-TestingTier' + integStackTag, { env, integStackTag, structs, discriminator: 'DL' });

// Adds IAM Policy to Instance and ASG Roles
Aspects.of(app).add(new SSMInstancePolicyAspect());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const structs: Array<RenderStruct> = [
}),
];

new RenderQueueTestingTier(app, 'RFDKInteg-RQ-TestingTier' + integStackTag, { env, integStackTag, structs });
new RenderQueueTestingTier(app, 'RFDKInteg-RQ-TestingTier' + integStackTag, { env, integStackTag, structs, discriminator: 'RQ' });

// Adds IAM Policy to Instance and ASG Roles
Aspects.of(app).add(new SSMInstancePolicyAspect());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ oss.forEach( (os, index) => {
}));
});

new WorkerFleetTestingTier(app, 'RFDKInteg-WF-TestingTier' + integStackTag, {env, integStackTag, structs});
new WorkerFleetTestingTier(app, 'RFDKInteg-WF-TestingTier' + integStackTag, {env, integStackTag, structs, discriminator: 'WF'});

// Adds IAM Policy to Instance and ASG Roles
Aspects.of(app).add(new SSMInstancePolicyAspect());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ oss.forEach( (os, index) => {
}));
});

new WorkerFleetTestingTier(app, 'RFDKInteg-WFS-TestingTier' + integStackTag, {env, integStackTag, structs});
new WorkerFleetTestingTier(app, 'RFDKInteg-WFS-TestingTier' + integStackTag, {env, integStackTag, structs, discriminator: 'WFS'});

// Adds IAM Policy to Instance and ASG Roles
Aspects.of(app).add(new SSMInstancePolicyAspect());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ async function main() {
integStackTag,
renderStruct,
storageStruct,
discriminator: 'SM',
});

// Adds IAM Policy to Instance and ASG Roles
Expand Down
6 changes: 5 additions & 1 deletion integ/lib/testing-tier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export interface TestingTierProps extends StackProps {
* The unique suffix given to all stacks in the testing app
*/
readonly integStackTag: string;
/**
* The unique discriminator for constructs created in the testing app
*/
readonly discriminator: string;
}

/**
Expand Down Expand Up @@ -75,7 +79,7 @@ export abstract class TestingTier extends Stack {

// Create an instance that can be used for testing; SSM commands are communicated to the
// host instance to run test scripts installed during setup of the instance
this.testInstance = new BastionHostLinux(this, 'Bastion', {
this.testInstance = new BastionHostLinux(this, 'Bastion' + props.discriminator + props.integStackTag, {
vpc: this.vpc,
subnetSelection: { subnetGroupName: NetworkTier.subnetConfig.testRunner.name },
instanceType: new InstanceType('t3.small'),
Expand Down

0 comments on commit 4fa745b

Please sign in to comment.