Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
feat: env & account construct
Browse files Browse the repository at this point in the history
since stage has problems
  • Loading branch information
aripalo committed Mar 7, 2022
1 parent 87d207b commit 9a89806
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/stage/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,20 @@ export class AccountStage extends Stage {
}


export class AccountConstruct extends Construct {

constructor(scope: Construct) {

const accountType = AccountContext.getAccountType(scope);
const id = `${pascalCase(accountType)}Account`;

super(scope, id);

// Ensure no environment access from within Account Construct
this.node.setContext('environment-type', undefined);
this.node.setContext('environment', undefined);
this.node.setContext('env', undefined);
}
}


8 changes: 8 additions & 0 deletions src/stage/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ export class EnvironmentStage extends Stage {
}
}

export class EnvironmentConstruct extends Construct {
constructor(scope: Construct) {
const type = EnvironmentContext.getName(scope);
const id = `${pascalCase(type)}Environment`;
super(scope, id);
}
}


0 comments on commit 9a89806

Please sign in to comment.