1

I have followed the simplest route to create a basic AWS lambda function on my PC - but when I try to deploy it it fails with an obscure message.

Error: Failed to create changeset for the stack: sam-app, An error occurred (InternalFailure) when calling the CreateChangeSet operation (reached max retries: 4): Unknown

I believe I have provided all the required permissions :

  • AmazonS3FullAccess
  • AWSCodeDeployFullAccess
  • AWSLambdaRole
  • AWSCloudFormationFullAccess
  • AWSLambda_FullAccess

and additionally :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:CreateRole"
            ],
            "Resource": "*"
        }
    ]
}

My terminal session commands & responses are :

c:\My Projects\Nuzum-AWS\sam-app>sam deploy --guided --template-file .aws-sam\build\template.yaml

Configuring SAM deploy

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

    Setting default arguments for 'sam deploy'
    =========================================
    Stack Name [sam-app]:
    AWS Region [eu-west-1]:
    #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    Confirm changes before deploy [y/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]:
    #Preserves the state of previously provisioned resources when an operation fails
    Disable rollback [y/N]:
    HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y
    Save arguments to configuration file [Y/n]:
    SAM configuration file [samconfig.toml]:
    SAM configuration environment [default]:

    Looking for resources needed for deployment:
     Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-dee0ker00dts
     A different default S3 bucket can be set in samconfig.toml

    Saved arguments to config file
    Running 'sam deploy' for future deployments will use the parameters saved above.
    The above parameters can be changed by modifying samconfig.toml
    Learn more about samconfig.toml syntax at
    https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html

Uploading to sam-app/7b33e513850748d9482c8e504aacefb2 533 / 533 (100.00%)

    Deploying with following values
    ===============================
    Stack name                   : sam-app
    Region                       : eu-west-1
    Confirm changeset            : False
    Disable rollback             : False
    Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-dee0ker00dts
    Capabilities                 : ["CAPABILITY_IAM"]
    Parameter overrides          : {}
    Signing Profiles             : {}

Initiating deployment

Uploading to sam-app/4e272b888be3f30dedd7ac0cf77b1925.template 1361 / 1361 (100.00%) Error: Failed to create changeset for the stack: sam-app, An error occurred (InternalFailure) when calling the CreateChangeSet operation (reached max retries: 4): Unknown

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • I just used the sam init to create to generate the “Hello world” lambda function in Typescript for Node 16. Then I ran sam build to build it - this all works as expected, and tested the function locally. – greatweatherforducks Dec 03 '22 at 23:20
  • Did you try with --capabilities CAPABILITY_IAM flag when calling sam deploy? – Arpit Jain Dec 04 '22 at 11:26
  • Yes, that capability was there - but I also put it explicitly on the sam deploy command line - same outcome. c:\My Projects\Nuzum-AWS\sam-app>sam deploy --guided --template-file .aws-sam\build\template.yaml --capabilities CAPABILITY_IAM ...Error: Failed to create changeset for the stack: sam-app, An error occurred (InternalFailure) when calling the CreateChangeSet operation (reached max retries: 4): Unknown c:\My Projects\Nuzum-AWS\sam-app> – greatweatherforducks Dec 04 '22 at 14:16
  • Could you add the code of your template.yml file to the question? – Salvino D'sa Dec 05 '22 at 03:00

1 Answers1

0

You gave confirm change set value as false. you have to give that as true. Can you try giving these values while deploying?

  1. Confirm changes before deploy [y/N]:y.
  2. Allow SAM CLI IAM role creation [Y/n]:y
  3. Disable rollback [y/N]:n
  4. Save arguments to configuration file [Y/n]:y
AMAL
  • 81
  • 1
  • 2