Skip to content

Commit

Permalink
Change project and stage config to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Jun 21, 2023
1 parent 3028f25 commit 506c344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions infrastructure/cdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { DnsStack } from './providers/dns'

/** Create CDK app and stacks */
const config = new Config()
const { env } = config
const { env, stage } = config
const app = new cdk.App()
const { hostedZone, certificate } = new DnsStack(app, config.getFullStackName('dns'), { env })
const { cluster } = new NetworkStack(app, config.getFullStackName('network'), { env })
if (process.env.STAGE !== 'prod') {
if (stage !== 'prod') {
/** Create development-only stacks */
new AnalyticsStack(app, config.getFullStackName('analytics'), { env })
new UsersStack(app, config.getFullStackName('users'), { env, hostedZone, cluster, certificate })
Expand Down
10 changes: 5 additions & 5 deletions infrastructure/cdk/src/providers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export class Config implements ProjectConfig {

constructor() {
this.checkEnvVars()
this.project = pascalCase(process.env.PROJECT as string)
this.stage = pascalCase(process.env.STAGE as string)
this.project = process.env.PROJECT as string
this.stage = process.env.STAGE as string
this.env = {
account: process.env.AWS_ACCOUNT as string,
region: process.env.AWS_REGION as string
}
this.rootDomain = `${this.stage === 'Prod' ? '' : `${this.stage.toLowerCase()}.`}casimir.co`
this.rootDomain = `${this.stage === 'prod' ? '' : `${this.stage}.`}casimir.co`
this.subdomains = {
nodes: 'nodes',
landing: 'www',
Expand Down Expand Up @@ -60,7 +60,7 @@ export class Config implements ProjectConfig {
* ```
*/
getFullStackName(stackName: string): string {
return this.project + pascalCase(stackName) + this.stage
return pascalCase(this.project) + pascalCase(stackName) + pascalCase(this.stage)
}

/**
Expand All @@ -76,7 +76,7 @@ export class Config implements ProjectConfig {
* ```
*/
getFullStackResourceName(stackName: string, resourceName: string, version?: number): string {
const name = this.project + pascalCase(stackName) + pascalCase(resourceName) + this.stage
const name = pascalCase(this.project) + pascalCase(stackName) + pascalCase(resourceName) + pascalCase(this.stage)
if (version) {
return name + version
}
Expand Down

0 comments on commit 506c344

Please sign in to comment.