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.

Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas