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.

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠