Running this through the debugger, you can see tha...
# help
j
Running this through the debugger, you can see that the
topicBus
environment only contains the two variables set in the
defaultFunctionProps
. It does not include
TOPIC_BUS_ARN
f
Hey @Jason S, try this:
Copy code
this.topicBus.addSubscribers(this,
      [{
        // handler for creating a new brokerage
        function: {
          handler: "modules/brokerage/commands/create_brokerage/create_brokerage_notification_controller.main",
          functionName: "CreateBrokerageNotificationHandler",
          environment: {
            TOPIC_BUS_ARN: this.topicBus.topicArn
          },
          permissions: [this.topicBus],
        },
        subscriberProps: {
          filterPolicy: {
            event: SubscriptionFilter.stringFilter({
              allowlist: ["TRANSACTION_IMPORT_CREATED"],
            }),
          },
        },
      }]
     )
j
Crushing Frank thank you sir that sorted it
I assume this was because of the
function
key. What is this doing under the hood that made it work?
f
it’s really just that
functionName
,
environment
and
permissions
should all go under the
function
props.
If u r using TypeScript, ur editor would’ve caught it 😉 ie. here’s what the error would look like in VS Code