issue with client-appstream

0

hello all,

i have a small tsx file that i am wanting to create an appstream url:

import * as AWS from "@aws-sdk/client-appstream";

const client = new AWS.AppStreamClient({ region: "eu-west-2" });

export default function AppStreamURI() {

  const params = {
    "FleetName": "Windows-Fleet",
    "StackName": "Windows-Stack",
    "UserId": "someone@gmail.com",
    "ApplicationArn": "null",
  }  

  const command = new AWS.AssociateApplicationFleetCommand(params);

  client.send(command).then(
    (data) => {
      console.log(data)
    },
    (error) => {
      console.error(error)
    }
  )

  return(
    <div>Hello</div>
  )
}

The ApplicationArn is added as it was throwing an error saying this was needed, but couldnt find it noted in the aws documentation (?).

I have aws config in vscode and is working on Cognito connection and what-not.

I am getting the following error, which i am hoping someone can assist me with:

Error: Credential is missing
    at SignatureV4.credentialProvider (runtimeConfig.browser.js:23:1)
    at SignatureV4.signRequest (SignatureV4.js:83:1)
    at SignatureV4.sign (SignatureV4.js:52:1)
    at middleware.js:12:1
    at async StandardRetryStrategy.retry (StandardRetryStrategy.js:47:1)
    at async loggerMiddleware.js:2:1 undefined

I am using React with "@aws-sdk/client-appstream": "^3.226.0"

gc1980
已提问 1 年前333 查看次数
1 回答
0

Looking at the AppStream 2.0 API documentation, I see that the ApplicationArn is one of the required parameters. For the error you are receiving, make sure that the client is signing the request. If you are using Cognito, you may want to look at the following documentation to retrieve credentials from an identity pool and use that for the appstream client.

AWS
Taka_M
已回答 1 年前

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

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

回答问题的准则