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.

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions