José Ribeiro
05/28/2021, 12:48 PMtest("Test Stack", () => {
const app = new <http://sst.App|sst.App>();
const stack = new PeopleEnrichmentStack(app, "test-stack");
expect(stack).to(haveResource("AWS::SQS"));
});
, but I’m getting
Cannot find a handler file at src/people_data_enrichment/handlers/people_data_enricher.js".
which seems to be related to the test expecting a .js
file when it really should be .py
since I’m using python. Any thoughts?Frank
José Ribeiro
05/28/2021, 5:11 PMexport default class PeopleDataEnrichmentStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const queue = new sst.Queue(this, "people-data-enrichment", {
consumer: {
function: {
handler: "handlers/people_data_enricher.handler",
srcPath: "src/people_data_enrichment",
},
consumerProps: {
batchSize: 1,
},
},
});
const topic = new sst.Topic(this, "user-events", {
defaultFunctionProps: {
srcPath: "src/people_data_enrichment",
},
subscribers: [queue],
});
const api = new sst.Api(this, "Api", {
routes: {
"POST /": {
function: {
srcPath: "src/people_data_enrichment",
handler: "handlers/sns_publisher.handler",
environment: {
USER_EVENTS_TOPIC_ARN: topic.topicArn,
FULLCONTACT_API_KEY: process.env.FULLCONTACT_API_KEY,
},
permissions: [topic],
},
},
},
});
this.addOutputs({
ApiEndpoint: api.url,
TopicName: topic.topicArn,
});
}
}
Frank
José Ribeiro
05/28/2021, 5:13 PMJosé Ribeiro
05/28/2021, 5:14 PMapp.setDefaultFunctionProps({
runtime: "python3.8",
});
Frank
Frank
app
construct:
const app = new <http://sst.App|sst.App>();
José Ribeiro
05/28/2021, 5:15 PM