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
demandé il y a un an336 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions