2 Answers
- Newest
- Most votes
- Most comments
1
First, make sure your CloudFormation template pm2dicts-lambda.yml
has the Parameters
section includes LambdaName
parameter, e.g.,
Parameters: LambdaName: Type: String # ... rest of parameters
Next, make sure your AWS::Lambda::Function
resource (or AWS::Serverless::Function
if you use SAM extension) has its FunctionName
references the Parameter
named LambdaName
, e.g.,
Resources: MyLambdaFunction: Type: AWS::Lambda::Function Properties: FunctionName: Ref: LambdaName # ... rest of settings
answered 8 months ago
1
Does it work if you specify FunctionName
instead of LambdaName
? This page refers to FunctionName
.
answered 8 months ago
Instead does not work because of error. It requires LambdaName. Wen I have added FunctionName=pm2dicts and FunctionName=pm2dicts in the command line the result is the same: it is again pm2dictx-app-dev-pm2dicts instead of pm2dicts
Relevant content
- asked 10 months ago
- asked a year ago
- asked 10 months ago
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
When I change
FunctionName: !Sub ${Application}-${Environment}-${LambdaName} to #FunctionName: !Sub ${LambdaName} the Workflow completed with error aws cloudformation deploy --template-file ./aws/cfn/pm2dicts-lambda.yml --stack-name pm2dictx-stack --parameter-overrides
Application=pm2dictx-app
Environment=dev
LambdaName=pm2dicts
FunctionName=pm2dicts
LambdaHandler=pm2dicts
LambdaBucketName=pm2dictx-bucket
LambdaZipFile=pm2dictxlambda-8be6e4aa7303adc00a9ba99e8c521a31988fedc3.zip
--capabilities CAPABILITY_IAM shell: /usr/bin/bash -e {0} env: APPLICATION_PACKAGE: pm2dictxlambda APPLICATION_NAME: pm2dictx-app LAMBDA_BUCKET_NAME: pm2dictx-bucket LAMBDA_STACK_NAME: pm2dictx-stack SLN_WORKING_DIR: . AWS_DEFAULT_REGION: eu-west-2 AWS_REGION: eu-west-2 AWS_ACCESS_KEY_ID: *** AWS_SECRET_ACCESS_KEY: ***
Waiting for changeset to be created.. Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command to fetch the list of events leading up to the failure aws cloudformation describe-stack-events --stack-name pm2dictx-stack Error: Process completed with exit code 255.
But when I change it back it competed successfully and I see the Lambda with long name
It is so difficult to troubleshoot your issue without a detailed deployment error or full CloudFormation template. One possibility is that some of the short named resources already exist and you are not allowed to deploy the resource with the same name. Moreover, seems that you have merely commented out the function name with this.
@HS I understand, I can provide my yml files but I do not see how to attach them here