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 年前檢視次數 336 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南