-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sam-beta-cdk raises an error without any additional context #2968
Comments
hey @jabalsad , thanks for reporting this issue! Update: Can you please also share |
There is a
|
Thanks @jabalsad ! How large is your |
The
|
I'm guessing you're more interested in the actual template? |
Not sure why, but this workaround at least allows you to continue using
|
I have run into this same issue when trying to run |
I've also run into this issue when trying to use The branch where I'm trying to convert to using the CDK on the my project is here. pseudo-su/golang-serverless-cdk-template#1 Using Versions$ sam-beta-cdk --version
> SAM CLI, version 1.22.0.dev202107140310
$ cdk --version
> 1.115.0 (build f0ca40f) cdk.json{
"app": "npx ts-node --project cdk/tsconfig.json --prefer-ts-exts cdk/app.ts",
"context": {
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
"@aws-cdk/core:enableStackNameDuplicates": "true",
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true",
"@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true,
"@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true,
"@aws-cdk/aws-kms:defaultKeyPolicies": true,
"@aws-cdk/aws-s3:grantWriteWithoutAcl": true,
"@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true,
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
"@aws-cdk/aws-efs:defaultEncryptionAtRest": true,
"@aws-cdk/aws-lambda:recognizeVersionProps": true
}
}
Error logSynthesizing CDK App
Traceback (most recent call last):
File "/usr/local/bin/sam-beta-cdk", line 8, in <module>
sys.exit(cli())
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/utils/helpers.py", line 50, in wrapper
iac_plugin, project = get_iac_plugin(project_type, kwargs, with_build)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/utils/helpers.py", line 40, in get_iac_plugin
project = iac_plugin.get_project(lookup_paths)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/cdk/plugin.py", line 114, in get_project
project = self._get_project_from_cloud_assembly(cloud_assembly_dir)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/cdk/plugin.py", line 211, in _get_project_from_cloud_assembly
stacks: List[Stack] = [self._build_stack(cloud_assembly, ca_stack) for ca_stack in cloud_assembly.stacks]
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/cdk/plugin.py", line 211, in <listcomp>
stacks: List[Stack] = [self._build_stack(cloud_assembly, ca_stack) for ca_stack in cloud_assembly.stacks]
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/cdk/plugin.py", line 232, in _build_stack
self._build_resources_section(assets, ca_stack, cloud_assembly, section, section_dict)
File "/usr/local/Cellar/aws-sam-cli-beta-cdk/202107140310/libexec/lib/python3.8/site-packages/samcli/lib/iac/cdk/plugin.py", line 292, in _build_resources_section
asset = assets[asset_path]
KeyError: '/Development/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.bdcfdea2d98c16355538f9f634bcd57355fd4b78dc36661da93c6546fa77bcd6'
make: *** [dev] Error 1 Asset filesoutput of "aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.bdcfdea2d98c16355538f9f634bcd57355fd4b78dc36661da93c6546fa77bcd6",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.11b1fbd97647ec3b4f3f2f3fd5c7fa53f0386bfd5cc831be00cb829546b5e262",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.39d9372624a85803a5161b014625dc5a138ff0817ffa2c1213cbeb27fb547a26",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.39d9372624a85803a5161b014625dc5a138ff0817ffa2c1213cbeb27fb547a26",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.25d701c2234f6c2a11e2c0592dc76db6d7621fb883c1e9fbe742072fd542e46a",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.699b4676864820810a21ba9e48842d0cade14020fda9a0e0339612d56da7ab30",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.eb606aa355165ed613af9b46f6961758add994cf2d06f6557d6d4fc583a0924f",
"aws:asset:path": "/Users/stableford/Development/Projects/Personal/golang-serverless-cdk-template/.aws-sam/.cdk-out/asset.11b1fbd97647ec3b4f3f2f3fd5c7fa53f0386bfd5cc831be00cb829546b5e262", |
SAM CLI's CDK support went into GA yesterday with some changes. Now sam-cli won't run cdk but user will have to run and provide the path. This should solve this problem. Please let us know if you have more questions. |
Description:
sam-beta-cdk
raises an error when trying tostart-api
orinvoke
locally. I'm hoping I don't have to post the entire CDK stack template here because it is large.Steps to reproduce:
brew install aws-sam-cli-beta-cdk
(osx)sam-beta-cdk local start-api
Observed result:
Expected result:
It starts the API
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: `SAM CLI, version 1.22.0.dev202104291816``us-east-1
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: