CDK, SSM and multistack resource sharing problem

0

Not super facile with typescript, I am trying to develop two simple cdk stacks, one with an graphql api and the other with the database to be used by it.

If I create an SSM parameter in the database stack and then access that same parameter in the second stack, how do I add the database to the api?

const latestDDB = ssm.StringParameter.valueForStringParameter(
  this,
  '/foodir/fooname'
);

 const userDataSource = api.addDynamoDbDataSource(
  'FooDataSource',
  latestDDB <-- this causes an error, "Argument of type 'string' is not assignable to parameter of type 'ITable'.ts(2345) const latestDDB: string"
);

Thanks in advance.

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen