Skip to content

Commit

Permalink
fix: add new config
Browse files Browse the repository at this point in the history
  • Loading branch information
amfage committed Nov 2, 2023
1 parent adeb6d1 commit bc5fb3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion infra/charts/argo.workflows.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Chart, ChartProps, Duration, Helm } from 'cdk8s';
import { Construct } from 'constructs';

import { CfnOutputKeys } from '../constants.js';
import { applyDefaultLabels } from '../util/labels.js';

export interface ArgoWorkflowsProps {
Expand Down Expand Up @@ -67,7 +68,7 @@ export class ArgoWorkflows extends Chart {
archive: true,
archiveTTL: '180d',
postgresql: {
host: 'argodbaf-argodatabaseaf4be14fa2-p8yjinijwbro.cmpyjhgv78aj.ap-southeast-2.rds.amazonaws.com',
host: CfnOutputKeys.ArgoDbEndpoint,
port: 5432,
database: 'postgres',
tableName: 'argo_workflows',
Expand Down
3 changes: 3 additions & 0 deletions infra/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const DbName = 'ArgoDb';
export const CfnOutputKeys = {
ClusterEndpoint: 'ClusterEndpoint',

ArgoDbEndpoint: 'ArgoDbEndpoint',

KarpenterServiceAccountName: 'KarpenterServiceAccountName',
KarpenterServiceAccountRoleArn: 'KarpenterServiceAccountRoleArn',
KarpenterDefaultInstanceProfile: 'KarpenterDefaultInstanceProfile',
Expand All @@ -17,6 +19,7 @@ export const CfnOutputKeys = {
ArgoRunnerServiceAccountName: 'ArgoRunnerServiceAccountName',

TempBucketName: 'TempBucketName',

Check failure on line 22 in infra/constants.ts

View workflow job for this annotation

GitHub Actions / Format & Deploy(master)

Delete `⏎`
} as const;

/** The list of possible keys */
Expand Down
11 changes: 5 additions & 6 deletions infra/rds/argo.rds.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { App, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { CfnOutput, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as rds from 'aws-cdk-lib/aws-rds';
import { Construct } from 'constructs';

import { DbName } from './../constants.js';
import { CfnOutputKeys, DbName } from './../constants.js';

/*
TODO:
Expand All @@ -16,7 +17,7 @@ Database configuration decisions e.g. replication, scaling.
export class ArgoRdsStack extends Stack {
db: rds.DatabaseInstance;
vpc: ec2.IVpc;
constructor(scope: App, id: string, props?: StackProps) {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
this.vpc = ec2.Vpc.fromLookup(this, 'Vpc', { tags: { BaseVPC: 'true' } });
this.db = new rds.DatabaseInstance(this, DbName, {
Expand All @@ -27,9 +28,6 @@ export class ArgoRdsStack extends Stack {
publiclyAccessible: false, // will default to false in a non-public VPC
allocatedStorage: 10,
maxAllocatedStorage: 40,
// masterUsername: 'admin',
// masterUserPassword: cdk.SecretValue.plainText('password'),
// password rotation will automatically be 30 days, we may want to override this
credentials: rds.Credentials.fromGeneratedSecret('argodbuser'), // Cannot use IAM with Argo?
deletionProtection: false,
removalPolicy: RemovalPolicy.DESTROY, // setting for nonprod
Expand All @@ -38,5 +36,6 @@ export class ArgoRdsStack extends Stack {
enablePerformanceInsights: false, // default is false, noted in as something we might want
// Configure CloudWatch options?
});
new CfnOutput(this, CfnOutputKeys.ArgoDbEndpoint, { value: this.db.dbInstanceEndpointAddress });
}
}

0 comments on commit bc5fb3e

Please sign in to comment.