aws / aws-sam-cli-pipeline-init-templates

MIT No Attribution
44 stars 39 forks source link

NameError: name 'ssm' is not defined #60

Closed Gambit08 closed 1 year ago

Gambit08 commented 1 year ago

The Inline Code for the Serverless Function MonorepoTriggerFunction defined in the AWS-CodePipeline/sam-monorepo-pipeline-template/{{cookiecutter.outputDir}}/codepipeline.yaml has missing boto3 client for Amazon Simple Systems Manager (SSM).

The lambda threw an error when it was invoked on updates pushed to the branch in the Codecommit Repository.

Error -

[ERROR] NameError: name 'ssm' is not defined
Traceback (most recent call last):
  File "/opt/python/aws_lambda_powertools/logging/logger.py", line 354, in decorate
    return lambda_handler(event, context, *args, **kwargs)
  File "/var/task/index.py", line 22, in lambda_handler
    update_last_commit(repository, commit_id, branch_name)
  File "/var/task/index.py", line 47, in update_last_commit
    ssm.put_parameter(Name=param_name_last_commit(repository, branch_name),

It can be assigned to me so I can create a PR for the fix. Thanks!

sriram-mv commented 1 year ago

Thanks for the issue and PR with the fix!