0

When I try to deploy the hello world SAM application using sam deploy --guided, I get the following error. However aws_access_key_id & aws_secret_access_key of IAM User has full admin access.

sam-app>sam deploy --guided

Configuring SAM deploy

    Looking for config file [samconfig.toml] :  Not found

    Setting default arguments for 'sam deploy'
    =========================================
    Stack Name [sam-app]:
    AWS Region [us-west-2]:
    #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    Confirm changes before deploy [y/N]: n
    #SAM needs permission to be able to create roles to connect to the resources in your template
    Allow SAM CLI IAM role creation [Y/n]: y
    #Preserves the state of previously provisioned resources when an operation fails
    Disable rollback [y/N]: y
    HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y
    Save arguments to configuration file [Y/n]: y
    SAM configuration file [samconfig.toml]:
    SAM configuration environment [default]:

    Looking for resources needed for deployment:
    Creating the required resources...

    Error: Failed to create managed resources: An error occurred (SignatureDoesNotMatch) when calling the CreateChangeSet operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Jimson James
  • 2,937
  • 6
  • 43
  • 78
user3812054
  • 101
  • 1
  • 1
  • 3

1 Answers1

0

As this answer explains and the error message explains, it is to do with your AWS credentials. AWS CLI tries to retrieve credentials first from the environment variables and second from the profiles or credential files.

When you do aws configure you save the credentials to the file ~/.aws/credentials. However if you already have

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY

in your environment variables, it overrides the credentials from your credential file. Check your environment variables and remove them if you have to.

nisalap
  • 122
  • 6
  • 1
    Thanks for your response however i got the root cause where i need to open the command prompt/PowerShell with admin rights. This was the only reason to preventing connection with AWS. – user3812054 Mar 06 '23 at 12:53