amazon-web-servicesaws-lambdavisual-studio-2022aws-toolkit

AWS Toolkit for Visual Studio 2022 failing on deploy lambda


I'm trying to update one lambda to the AWS Cloud, but suddenly this error started to appear:

Error attempting to fix the trust policy for IAM Role...

enter image description here

Checking the "Trust Relationoships" tab on AWS Web Console, like demanded by the error message, averything looks like ok:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "lambda.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

Some idea about how to fix it?


Solution

  • How I use more then one account, some time I change this credentials (I know that is possible to configure profiles).

    You can define multiple profiles within the credentials files that live in the .aws folder under your user home folder. Information about these files can be found at https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/credentials.html

    If your credentials are simple access key - secret key pairings, you can use the AWS Toolkit to create new profiles. In Visual Studio, go to the View menu and select AWS Explorer. From the AWS Explorer, there will be buttons that allow you to add/edit/delete credentials profiles. Using these will allow you to create or modify a profile's access key and secret key. More details about this workflow can be found at https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/keys-profiles-credentials.html