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年前308ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ