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.

没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则