aws-sam-cli
aws-sam-cli copied to clipboard
Bug: sam local invoke - InvalidParameterValueException
Description:
SAM CLI unable to find an AWS-managed Lambda layer.
Steps to reproduce:
Create a Lambda with Param and Secrets Extension in CDK, and run Lambda locally with SAM CLI.
const paramsAndSecrets = ParamsAndSecretsLayerVersion.fromVersion(ParamsAndSecretsVersions.V1_0_103, {
cacheSize: 500,
logLevel: stage == STAGE.PROD ? ParamsAndSecretsLogLevel.INFO : ParamsAndSecretsLogLevel.DEBUG,
});
const handlerFunction =
new PythonFunction(this, `${stackPrefix}-${handlerName}`, {
runtime: Runtime.PYTHON_3_12,
description: 'MY DESCRIPTION',
entry: path.join(__dirname, '../../../src'),
environment: {
STAGE: stage,
...additionalEnv,
},
memorySize: 256,
timeout: Duration.minutes(1),
logRetention: RetentionDays.SIX_MONTHS,
paramsAndSecrets,
});
mySecret.grantRead(handlerFunction);
cdk ls && sam local invoke -t cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/AWSSAapnortheast1devDeploymentStacksAWSSAapnortheast1devLambdaE3B5331D.template.json AWSSA-ap-northeast-1-dev-GithubBotHandler
Observed result:
2024-09-05 18:07:12,756 | No config file found in this directory.
2024-09-05 18:07:12,757 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/samconfig.toml'
2024-09-05 18:07:12,759 | Config file location:
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/samconfig.toml
2024-09-05 18:07:12,759 | Config file
'/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/samconfig.toml' does not exist
2024-09-05 18:07:12,776 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/samconfig.toml'
2024-09-05 18:07:12,777 | Using config file: samconfig.toml, config environment: default
2024-09-05 18:07:12,777 | Expand command line arguments to:
2024-09-05 18:07:12,778 |
--template_file=/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/AWSSAapnortheast
1devDeploymentStacksAWSSAapnortheast1devLambdaE3B5331D.template.json --function_logical_id=AWSSA-ap-northeast-1-dev-GithubBotHandler --no_event
--layer_cache_basedir=/Users/shawn.wang/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2024-09-05 18:07:12,778 | local invoke command is called
2024-09-05 18:07:13,937 | Collected default values for parameters: {'BootstrapVersion': '/cdk-bootstrap/hnb659fds/version'}
2024-09-05 18:07:13,966 | CDK Path for resource GithubBotHandlerRole78FCB05B is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'GithubBotHandlerRole', 'Resource']
2024-09-05 18:07:13,966 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerServiceRoleEA5D8DEB is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'ServiceRole', 'Resource']
2024-09-05 18:07:13,967 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerServiceRoleDefaultPolicyCAD33139 is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'ServiceRole', 'DefaultPolicy',
'Resource']
2024-09-05 18:07:13,967 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerD4138CC1 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'Resource']
2024-09-05 18:07:13,968 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerLogRetention7D632C49 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'LogRetention', 'Resource']
2024-09-05 18:07:13,968 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerFunctionUrl59783380 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'FunctionUrl', 'Resource']
2024-09-05 18:07:13,969 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerinvokefunctionurl4E059348 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'invoke-function-url']
2024-09-05 18:07:13,969 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'ServiceRole', 'Resource']
2024-09-05 18:07:13,970 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'ServiceRole',
'DefaultPolicy', 'Resource']
2024-09-05 18:07:13,970 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'Resource']
2024-09-05 18:07:13,971 | CDK Path for resource CDKMetadata is ['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'CDKMetadata',
'Default']
2024-09-05 18:07:13,972 | Unable to resolve property Resource: [OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'}),
OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})].
Leaving as is.
2024-09-05 18:07:13,973 | Unable to resolve property Resource: OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'}). Leaving
as is.
2024-09-05 18:07:13,973 | Unable to resolve property GOOGLE_CREDS_SECRET_NAME: OrderedDict({'Fn::Join': ['-', [OrderedDict({'Fn::Select': [0,
OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'})]})]})]})]}),
OrderedDict({'Fn::Select': [1, OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'})]})]})]})]})]]
}). Leaving as is.
2024-09-05 18:07:13,975 | Unable to resolve property GOOGLE_CREDS_TOKEN_SECRET_NAME: OrderedDict({'Fn::Join': ['-', [OrderedDict({'Fn::Select': [0,
OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})]})]})]})
]}), OrderedDict({'Fn::Select': [1, OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':',
OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})]})]})]})
]})]]}). Leaving as is.
2024-09-05 18:07:13,976 | 0 stacks found in the template
2024-09-05 18:07:13,977 | Collected default values for parameters: {'BootstrapVersion': '/cdk-bootstrap/hnb659fds/version'}
2024-09-05 18:07:13,988 | CDK Path for resource GithubBotHandlerRole78FCB05B is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'GithubBotHandlerRole', 'Resource']
2024-09-05 18:07:13,989 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerServiceRoleEA5D8DEB is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'ServiceRole', 'Resource']
2024-09-05 18:07:13,989 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerServiceRoleDefaultPolicyCAD33139 is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'ServiceRole', 'DefaultPolicy',
'Resource']
2024-09-05 18:07:13,990 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerD4138CC1 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'Resource']
2024-09-05 18:07:13,990 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerLogRetention7D632C49 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'LogRetention', 'Resource']
2024-09-05 18:07:13,991 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerFunctionUrl59783380 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'FunctionUrl', 'Resource']
2024-09-05 18:07:13,991 | CDK Path for resource AWSSAapnortheast1devGithubBotHandlerinvokefunctionurl4E059348 is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'AWSSA-ap-northeast-1-dev-GithubBotHandler', 'invoke-function-url']
2024-09-05 18:07:13,992 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'ServiceRole', 'Resource']
2024-09-05 18:07:13,992 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB is
['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'ServiceRole',
'DefaultPolicy', 'Resource']
2024-09-05 18:07:13,993 | CDK Path for resource LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A is ['AWSSA-ap-northeast-1-dev-DeploymentStacks',
'AWSSA-ap-northeast-1-dev-Lambda', 'LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a', 'Resource']
2024-09-05 18:07:13,993 | CDK Path for resource CDKMetadata is ['AWSSA-ap-northeast-1-dev-DeploymentStacks', 'AWSSA-ap-northeast-1-dev-Lambda', 'CDKMetadata',
'Default']
2024-09-05 18:07:13,994 | Unable to resolve property Resource: [OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'}),
OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})].
Leaving as is.
2024-09-05 18:07:13,995 | Unable to resolve property Resource: OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'}). Leaving
as is.
2024-09-05 18:07:13,995 | Unable to resolve property GOOGLE_CREDS_SECRET_NAME: OrderedDict({'Fn::Join': ['-', [OrderedDict({'Fn::Select': [0,
OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'})]})]})]})]}),
OrderedDict({'Fn::Select': [1, OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsB1803F6AAAECF8CB'})]})]})]})]})]]
}). Leaving as is.
2024-09-05 18:07:13,996 | Unable to resolve property GOOGLE_CREDS_TOKEN_SECRET_NAME: OrderedDict({'Fn::Join': ['-', [OrderedDict({'Fn::Select': [0,
OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':', OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})]})]})]})
]}), OrderedDict({'Fn::Select': [1, OrderedDict({'Fn::Split': ['-', OrderedDict({'Fn::Select': [6, OrderedDict({'Fn::Split': [':',
OrderedDict({'Fn::ImportValue':
'AWSSA-ap-northeast-1-dev-DeploymentStacks-AWSSA-ap-northeast-1-dev-Ssm:ExportsOutputRefAWSSAapnortheast1devGoogleCredentialsTokenEC2EA47A025BB956'})]})]})]})
]})]]}). Leaving as is.
2024-09-05 18:07:13,998 | 11 resources found in the stack
2024-09-05 18:07:13,998 | Found Lambda function with name='AWSSAapnortheast1devGithubBotHandlerD4138CC1' and
CodeUri='../asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7'
2024-09-05 18:07:13,999 | --base-dir is not presented, adjusting uri ../asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7 relative to
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/AWSSAapnortheast1devDeploymentSt
acksAWSSAapnortheast1devLambdaE3B5331D.template.json
2024-09-05 18:07:13,999 | Found Lambda function with name='LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A' and
CodeUri='../asset.4e26bf2d0a26f2097fb2b261f22bb51e3f6b4b52635777b1e54edbd8e2d58c35'
2024-09-05 18:07:14,000 | --base-dir is not presented, adjusting uri ../asset.4e26bf2d0a26f2097fb2b261f22bb51e3f6b4b52635777b1e54edbd8e2d58c35 relative to
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks/AWSSAapnortheast1devDeploymentSt
acksAWSSAapnortheast1devLambdaE3B5331D.template.json
2024-09-05 18:07:17,526 | Found one Lambda function with name 'AWSSA-ap-northeast-1-dev-GithubBotHandler'
2024-09-05 18:07:17,530 | Invoking index.handler (python3.12)
2024-09-05 18:07:17,531 | Loading AWS credentials from session with profile 'None'
2024-09-05 18:07:17,554 | Resolving code path.
Cwd=/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks,
CodeUri=/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7
2024-09-05 18:07:17,555 | Resolved absolute path to code is
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7
2024-09-05 18:07:17,556 | Resolving code path.
Cwd=/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/assembly-AWSSA-ap-northeast-1-dev-DeploymentStacks,
CodeUri=/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7
2024-09-05 18:07:17,556 | Resolved real code path to
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7
2024-09-05 18:07:17,557 | Code
/Users/shawn.wang/workspace/githubbot-workspace/AWSSAGithubBot/cdk/cdk.out/asset.4d4ad466218da20790b1de198a78464d8cae469b8a7089058fea7f63ca2881c7 is not a
zip/jar file
2024-09-05 18:07:18,918 | Cleaning all decompressed code dirs
2024-09-05 18:07:18,920 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-09-05 18:07:19,061 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-09-05 18:07:19,062 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '4c6d11ad-6dbe-4047-88e9-1d42647bd974', 'installationId':
'dff8abce-9c95-4d7e-9056-a0e79ae52de5', 'sessionId': 'b54fdba8-2c80-4b27-947f-2040d7923c76', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion':
'3.12.5', 'samcliVersion': '1.123.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local invoke',
'metricSpecificAttributes': {'projectType': 'CDK', 'gitOrigin': None, 'projectName': 'afc607424cc02c92d4d6af5184a4fef46a69548e465a320808c6ff358b6a3a8d',
'initialCommit': None}, 'duration': 6142, 'exitReason': 'InvalidParameterValueException', 'exitCode': 255}}]}
2024-09-05 18:07:19,062 | Unable to find Click Context for getting session_id.
2024-09-05 18:07:19,065 | Sending Telemetry: {'metrics': [{'events': {'requestId': '7e0d1ceb-7b85-4ed0-8a04-2d26fecf6d5d', 'installationId':
'dff8abce-9c95-4d7e-9056-a0e79ae52de5', 'sessionId': 'b54fdba8-2c80-4b27-947f-2040d7923c76', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion':
'3.12.5', 'samcliVersion': '1.123.0', 'commandName': 'sam local invoke', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension',
'event_value': '.toml', 'thread_id': '1509c4ab299441df81c2f827e5179eb2', 'time_stamp': '2024-09-05 10:07:12.758', 'exception_name': None}, {'event_name':
'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '3ac4a099ce824791ac6faea43878f8c0', 'time_stamp': '2024-09-05 10:07:12.777', 'exception_name':
None}, {'event_name': 'UsedFeature', 'event_value': 'CDK', 'thread_id': '7950555c4e7c4fb69ed5348da6792320', 'time_stamp': '2024-09-05 10:07:18.923',
'exception_name': None}]}}}]}
2024-09-05 18:07:19,708 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
2024-09-05 18:07:19,709 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: An error occurred (InvalidParameterValueException) when calling the GetLayerVersion operation: Invalid Layer name: arn:aws:lambda:ap-northeast-1:133490724326:layer:AWS-Parameters-and-Secrets-Lambda-Extension
Traceback:
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/cli/cli_config_file.py", line 347, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 185, in wrapped
raise exception # pylint: disable=raising-bad-type
^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 150, in wrapped
return_value = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/lib/utils/version_checker.py", line 43, in wrapped
actual_result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/cli/main.py", line 95, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/commands/local/invoke/cli.py", line 108, in cli
do_cli(
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/commands/local/invoke/cli.py", line 209, in do_cli
context.local_lambda_runner.invoke(
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/commands/local/lib/local_lambda.py", line 166, in invoke
self.local_runtime.invoke(
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 325, in wrapped_func
return_value = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/lambdafn/runtime.py", line 224, in invoke
container = self.create(
^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/lambdafn/runtime.py", line 96, in create
container = LambdaContainer(
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/docker/lambda_container.py", line 103, in __init__
image = LambdaContainer._get_image(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/docker/lambda_container.py", line 257, in _get_image
return lambda_image.build(runtime, packagetype, image, layers, architecture, function_name=function_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/docker/lambda_image.py", line 201, in build
downloaded_layers = self.layer_downloader.download_all(layers, self.force_image_build)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/layers/layer_downloader.py", line 76, in download_all
layer_dirs.append(self.download(layer, force))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/layers/layer_downloader.py", line 110, in download
layer_zip_uri = self._fetch_layer_uri(layer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/layers/layer_downloader.py", line 159, in _fetch_layer_uri
raise e
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/samcli/local/layers/layer_downloader.py", line 140, in _fetch_layer_uri
layer_version_response = self.lambda_client.get_layer_version(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/botocore/client.py", line 569, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.123.0/libexec/lib/python3.12/site-packages/botocore/client.py", line 1023, in _make_api_call
raise error_class(parsed_response, operation_name)
An unexpected error was encountered while executing "sam local invoke".
Expected result:
Successfully ran Lambda
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
❯ sam --info
{
"version": "1.123.0",
"system": {
"python": "3.12.5",
"os": "macOS-14.5-arm64-arm-64bit"
},
"additional_dependencies": {
"docker_engine": "27.0.3",
"aws_cdk": "2.154.0 (build 0fc07f3)",
"terraform": "1.9.3"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}