Skip to content

Commit

Permalink
Remove prints and comments re: the stack param
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasnaphas committed Feb 28, 2021
1 parent 0837a05 commit 3d2939f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
7 changes: 0 additions & 7 deletions bin/madliberation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@ const stackname = require("@cdk-turnkey/stackname");
let ssmResponse: any;
ssmResponse = await new Promise((resolve, reject) => {
ssm.getParameter(ssmParams, (err: any, data: any) => {
console.log("in callback...");
console.log("data:");
console.log(data);
console.log(err);
console.log(err);
if (data && data.Parameter && data.Parameter.Value) {
console.log("data.Parameter.Value");
}
console.log(data.Parameter.Value);
resolve({ err, data });
});
});
Expand All @@ -35,7 +29,6 @@ const stackname = require("@cdk-turnkey/stackname");
ssmResponse.data.Parameter &&
ssmResponse.data.Parameter.Value
) {
console.log("assigning to sesEmailVerificationFromAddress");
sesEmailVerificationFromAddress = ssmResponse.data.Parameter.Value;
}
new MadliberationUe1(app, stackname("ue1"), {
Expand Down
43 changes: 0 additions & 43 deletions lib/madliberation-ue1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as cognito from "@aws-cdk/aws-cognito";
const stackname = require("@cdk-turnkey/stackname");
const crypto = require("crypto");
import { Effect, PolicyStatement } from "@aws-cdk/aws-iam";
const AWS = require("aws-sdk");

export interface MadLiberationUe1Props extends cdk.StackProps {
sesEmailVerificationFromAddress?: string;
Expand All @@ -20,61 +19,19 @@ export class MadliberationUe1 extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: MadLiberationUe1Props) {
super(scope, id, props);

// condition an output on an SSM param
const ssm = new AWS.SSM();
let ssmResponse: any;
// const paramName = stackname("example-param-1");
// const ssmParams = {
// Name: paramName,
// };
let outputBasedOnParam: any = "the default for outputBasedOnParam";
if (props?.sesEmailVerificationFromAddress) {
outputBasedOnParam = props.sesEmailVerificationFromAddress;
}
// (async () => {
// ssmResponse = await new Promise((resolve, reject) => {
// ssm.getParameter(ssmParams, (err: any, data: any) => {
// console.log("in callback...");
// console.log("data:");
// console.log(data);
// console.log(err);
// console.log(err);
// if (data && data.Parameter && data.Parameter.Value) {
// console.log("data.Parameter.Value");
// }
// console.log(data.Parameter.Value);
// resolve({ err, data });
// });
// });
// })();
// maybe the above isn't being awaited?
// it isn't. the important parts are happening after the constructor returns.
// I need to move the async part, the sdk call, into the bin/ file.
// if (
// ssmResponse &&
// ssmResponse.data &&
// ssmResponse.data.Parameter &&
// ssmResponse.data.Parameter.Value
// ) {
// console.log("assigning to outputBasedOnParam");
// console.log(outputBasedOnParam);
// outputBasedOnParam = ssmResponse.data.Parameter.Value;
// }
new cdk.CfnOutput(this, "outputBasedOnParam", {
value: outputBasedOnParam,
});

// If a

new cdk.CfnOutput(this, "ue1StackStatus", {
value: "created",
});
const someEnvVarOutput = process.env.someV1 || "default val";
new cdk.CfnOutput(this, "someEnvVar", {
value: someEnvVarOutput,
});
// new cdk.CfnOutput(this, "paramName", {
// value: paramName,
// });
}
}

0 comments on commit 3d2939f

Please sign in to comment.