-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
252 additions
and
278 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
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
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,16 @@ | ||
import * as aws from '@pulumi/aws' | ||
import * as pulumi from '@pulumi/pulumi' | ||
|
||
const cfg = new pulumi.Config() | ||
|
||
const mailerApiKey = new aws.secretsmanager.Secret('MAILER_API_KEY', { | ||
description: 'API key for the mailer service', | ||
name: 'MAILER_API_KEY', | ||
}) | ||
|
||
new aws.secretsmanager.SecretVersion('MAILER_API_KEY_VERSION', { | ||
secretId: mailerApiKey.id, | ||
secretString: cfg.requireSecret('MAILER_API_KEY'), | ||
}) | ||
|
||
export const mailerApiKeyArn = mailerApiKey.arn |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,30 @@ const dbPassword = dbPasswordSecretId.apply((secretId) => | |
}) | ||
.then((secret) => secret.secretString), | ||
) | ||
const mailerApiKeyArn = coreStack.requireOutput('mailerApiKeyArn') | ||
const cacheEndpoint = coreStack.requireOutput('cacheEndpoint') | ||
const mailerApiKey = mailerApiKeyArn.apply((arn) => { | ||
const secret = aws.secretsmanager.getSecretVersionOutput({ | ||
secretId: arn, | ||
}) | ||
|
||
return secret.secretString | ||
}) | ||
|
||
export const dbUrl = pulumi.interpolate`postgresql://${dbUsername}:${dbPassword}@${dbEndpoint}/${dbName}?sslmode=verify-full&sslrootcert=/app/packages/core/src/assets/eu-central-1-bundle.pem` | ||
export const environment = pulumi | ||
.all([cacheEndpoint, dbUrl, mailerApiKey]) | ||
.apply(() => { | ||
return [ | ||
{ name: 'HOSTNAME', value: '0.0.0.0' }, | ||
{ name: 'PORT', value: '8080' }, | ||
{ name: 'DATABASE_URL', value: dbUrl }, | ||
{ name: 'REDIS_HOST', value: cacheEndpoint }, | ||
{ name: 'GATEWAY_HOSTNAME', value: 'gateway.latitude.so' }, | ||
{ name: 'GATEWAY_SSL', value: 'true' }, | ||
{ name: 'LATITUDE_DOMAIN', value: 'latitude.so' }, | ||
{ name: 'LATITUDE_URL', value: 'https://app.latitude.so' }, | ||
{ name: 'FROM_MAILER_EMAIL', value: '[email protected]' }, | ||
{ name: 'MAILER_API_KEY', value: mailerApiKey }, | ||
] | ||
}) |
Oops, something went wrong.