GithubHelp home page GithubHelp logo

Comments (6)

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ Mohit Alonja commented:

leungas Thank you for reporting this issue, Can you please give it a try with a latest release or latest docker image? We have tried to reproduce it (using events also), but we are not able to. Also, recently our upstream package spulec/moto ( getmoto/moto@49d9286#diff-9497eee72b94d2373afce2e63017ec39 )(commit) has done singificant cloudformation refactoring. This might have solved this issue already. Thanks.

from aws-cdk-local.

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ Danilo Pereira commented:

Similar issues happening here.

Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command requirements:cleanCache
Serverless: Load command deploy
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command studio

Serverless Warning --------------------------------------

A valid environment variable to satisfy the declaration 'env:SHOPPER_PLAN_TOPIC_ARN' could not be found.

Serverless Warning --------------------------------------

A valid environment variable to satisfy the declaration 'env:SHOPPER_PLAN_TOPIC_ARN' could not be found.

Serverless: [AWS ssm 400 0.698s 0 retries] getParameter({
Name: '/aws/reference/secretsmanager/local/mysql_application_credentials',
WithDecryption: true
})

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless Warning --------------------------------------

A valid SSM parameter to satisfy the declaration 'ssm:/aws/reference/secretsmanager/local/mysql_application_credentials~true' could not be found.

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Using serverless-localstack
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Generating requirements.txt from Pipfile...
Serverless: Parsed requirements.txt from Pipfile in /home/danilo/Code/clubbi/delivery-planner/.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /home/danilo/.cache/serverless-python-requirements/1712547e4ebdc05b79e5a71087615c045868cd578fcdd896a3b4c43256850d20_slspyc ...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 200 0.032s 0 retries] describeStacks({ StackName: 'orders-local' })
Serverless: [AWS cloudformation 200 0.016s 0 retries] describeStackResource({
StackName: 'orders-local',
LogicalResourceId: 'ServerlessDeploymentBucket'
})
Serverless: [AWS s3 200 0.022s 0 retries] listObjectsV2({
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Prefix: 'serverless/orders/local'
})
Serverless: [AWS s3 200 0.034s 0 retries] headObject({
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601993915002-2020-10-06T14:18:35.002Z/orders.zip'
})
Serverless: [AWS s3 200 0.038s 0 retries] headObject({
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601993915002-2020-10-06T14:18:35.002Z/compiled-cloudformation-template.json'
})
Serverless: [AWS lambda 404 0.019s 0 retries] getFunction({ FunctionName: 'local-generate_shopper_plan' })
Serverless: [AWS lambda 404 0.025s 0 retries] getFunction({ FunctionName: 'local-save_order' })
Serverless: [AWS lambda 404 0.01s 0 retries] getFunction({ FunctionName: 'local-send_shopper_plan_email' })
Serverless: [AWS sts 200 0.019s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.018s 0 retries] putObject({
Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... 9478 more bytes>,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/compiled-cloudformation-template.json',
ContentType: 'application/json',
Metadata: { filesha256: '7L9dGoFR2uDBFpxTRkEpQZTG8uUalVPLoKnohyIl4v8=' }
})
Serverless: Uploading artifacts...
Serverless: Uploading service orders.zip file to S3 (27.62 MB)...
Serverless: [AWS s3 200 0.037s 0 retries] createMultipartUpload({
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
ContentType: 'application/zip',
Metadata: { filesha256: 'cIAqq1Ikop+0Fruhq9QyuyVdX9GfmnYNX1ILklYT56U=' }
})
Serverless: [AWS s3 200 0.29s 0 retries] uploadPart({
Body: <Buffer 16 03 8a 9c 07 14 29 0c 81 74 cc af b9 65 11 c4 ba 95 ff 73 20 6b 30 fa d1 bb d5 da 82 fd 93 f9 24 73 3a 57 a4 3b 48 40 ad db 22 57 a3 92 d9 f4 c1 9b ... 5242830 more bytes>,
ContentLength: 5242880,
PartNumber: 2,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.341s 0 retries] uploadPart({
Body: <Buffer 49 2a fe 3f 66 d4 16 85 51 09 14 b1 8f 5c d0 d9 d2 54 6d 1c 63 7f 9f 82 fd aa 73 4c 52 c5 39 e2 d5 f4 52 63 82 14 8e c0 1e d1 0f dc fc 52 35 41 ca 1d ... 5242830 more bytes>,
ContentLength: 5242880,
PartNumber: 3,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.358s 0 retries] uploadPart({
Body: <Buffer 50 4b 03 04 0a 00 00 00 08 00 00 00 21 00 b5 47 7a cc 76 00 00 00 18 01 00 00 12 00 00 00 6c 61 6d 62 64 61 5f 68 61 6e 64 6c 65 72 73 2e 70 79 75 ce ... 5242830 more bytes>,
ContentLength: 5242880,
PartNumber: 1,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.125s 0 retries] uploadPart({
Body: <Buffer 17 42 bd f2 1c 4a b4 c7 bc 26 54 a9 39 64 ea 00 f8 58 ba a2 54 7e d0 6d f0 6f 17 c8 f7 d4 84 fa cd 93 7a 30 ee ad fc 19 e0 5e d4 81 06 7d 13 3d 94 0d ... 2745289 more bytes>,
ContentLength: 2745339,
PartNumber: 6,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.279s 0 retries] uploadPart({
Body: <Buffer 4b 6e a0 24 39 b7 59 ca 9e a6 6c f5 ed 92 6b bf b7 bd c2 6f aa 19 c2 1e 4a d5 ef 22 c5 f7 2b 3a 0d 11 51 54 34 05 88 f6 bb 8e 40 54 14 ec 7d 8f c6 ad ... 5242830 more bytes>,
ContentLength: 5242880,
PartNumber: 5,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.33s 0 retries] uploadPart({
Body: <Buffer 3c 0a 10 4e b5 01 7d 4b a3 93 ba 61 97 c6 63 db c7 e1 05 eb de 11 c2 b8 88 5b 1f 2b bf 52 01 22 28 40 93 70 ed e0 1d 1e 2b af 42 c9 6f 80 fe 87 fe be ... 5242830 more bytes>,
ContentLength: 5242880,
PartNumber: 4,
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: [AWS s3 200 0.036s 0 retries] completeMultipartUpload({
MultipartUpload: {
Parts: [
{ ETag: '"6201b1ced4a8827de3c34443040c0a32"', PartNumber: 1 },
{ ETag: '"5de6ba5d00fbf3ecb6f65841c588888f"', PartNumber: 2 },
{ ETag: '"b5481faffd2cb4de02309efdedd0d60e"', PartNumber: 3 },
{ ETag: '"7a6deb5c005eaf26c09900eb64fcb64a"', PartNumber: 4 },
{ ETag: '"191faca21ed3d1c4c24797609c02e04b"', PartNumber: 5 },
{ ETag: '"fc694d2c5134d0aabf319d71ad1970c4"', PartNumber: 6 },
[length]: 6
]
},
Bucket: 'orders-local-serverlessdeploymentbucket-rhk27u1y2suv',
Key: 'serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/orders.zip',
UploadId: 'q78JQ8E2rybcCHW3Bb8Vu372QTCJNPUu9PtpLld0vc0xl7VlaNX3EqA'
})
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 200 0.181s 0 retries] updateStack({
StackName: 'orders-local',
Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
Parameters: [ [length]: 0 ],
TemplateURL: 'https://s3.amazonaws.com/orders-local-serverlessdeploymentbucket-rhk27u1y2suv/serverless/orders/local/1601994111990-2020-10-06T14:21:51.990Z/compiled-cloudformation-template.json',
Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Checking Stack update progress...
Serverless: [AWS cloudformation 200 0.039s 0 retries] describeStackEvents({
StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/orders-local/46a8d068-3b88-4255-9b65-ab955c2761e9'
})
.
Serverless: Stack update finished...
Serverless: Invoke aws:info
Serverless: [AWS cloudformation 200 0.033s 0 retries] describeStacks({ StackName: 'orders-local' })
Serverless: [AWS cloudformation 500 0.621s 3 retries] listStackResources({ StackName: 'orders-local', NextToken: undefined })

Type Error ---------------------------------------------

TypeError: message.startsWith is not a function
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:816:23
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
From previous event:
at persistentRequest (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:743:7)
at Object.promiseGenerator (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:798:7)
at Queue._dequeue (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:153:30)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:109:18
From previous event:
at Queue.add (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:94:16)
at AwsProvider.request (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:797:39)
at LocalstackPlugin.interceptRequest (/home/danilo/Code/clubbi/delivery-planner/node_modules/serverless-localstack/src/index.js:518:17)
at AwsProvider.providerRequest [as request] (/home/danilo/Code/clubbi/delivery-planner/node_modules/serverless-localstack/src/index.js:391:22)
at AwsInfo.getResourceCount (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/info/getResourceCount.js:11:26)
From previous event:
at Object.aws:info:gatherData [as hook] (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/info/index.js:53:12)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:510:55
From previous event:
at PluginManager.invoke (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:510:22)
at PluginManager.spawn (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:530:17)
at AwsInfo. (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/info/index.js:45:48)
From previous event:
at Object.deploy:deploy [as hook] (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/plugins/aws/info/index.js:41:30)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:510:55
From previous event:
at PluginManager.invoke (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:510:22)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:545:24
From previous event:
at PluginManager.run (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/classes/PluginManager.js:545:8)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/Serverless.js:168:33
From previous event:
at Serverless.run (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/lib/Serverless.js:155:74)
at /home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/scripts/serverless.js:50:26
at processImmediate (internal/timers.js:456:21)
From previous event:
at Object. (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/scripts/serverless.js:50:4)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/home/danilo/.nvm/versions/node/v12.18.3/lib/node_modules/serverless/bin/serverless.js:47:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.18.3
Framework Version: 2.4.0
Plugin Version: 4.0.4
SDK Version: 2.3.2
Components Version: 3.2.1

from aws-cdk-local.

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ Doggy commented:

Also seeing this TypeError: message.startsWith is not a function error. Deleting the old docker image seems to be working for me.

from aws-cdk-local.

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ Danilo Pereira commented:

joedevgee can you please tell me your image ID?

My is 5b792b1d1ef2

from aws-cdk-local.

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ msteve-tokzu commented:

I'm also seeing this when I try to deploy multiple cognito triggers using the CDK in the latest localstack pull (as of today).

When I try to deploy to localstack with cdklocal I get the following error:

localstack_main | 2020-10-27T20:26:42:WARNING:localstack.utils.cloudformation.template_deployer: Error calling <bound method ClientCreator._create_api_method.._api_call of <botocore.client.Lambda object at 0x7fec4952e790>> with params: {'Action': 'lambda:InvokeFunction', 'Principal': 'cognito-idp.amazonaws.com', 'StatementId': '576273f1'} for resource: {'Type': 'AWS::Lambda::Permission', 'Properties': {'Action': 'lambda:InvokeFunction', 'Principal': 'cognito-idp.amazonaws.com'}, 'Metadata': {'aws:cdk:path': 'ReproStack/cogsignup/PreSignUpCognito'}}
localstack_main | 2020-10-27T20:26:42:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "cogsignupPreSignUpCognito639C1C9E": Parameter validation failed:
localstack_main | Missing required parameter in input: "FunctionName" Traceback (most recent call last):
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 283, in parse_and_create_resource
localstack_main | return parseand_create_resource(
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 395, in parseand_create_resource
localstack_main | result = deploy_func(logical_id, resource_map_new, stack_name=stack_name)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1163, in deploy_resource
localstack_main | return execute_resource_action(resource_id, resources, stack_name, ACTION_CREATE)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1206, in execute_resource_action
localstack_main | result = configure_resource_via_sdk(resource_id, resources, resource_type, func, stack_name)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1292, in configure_resource_via_sdk
localstack_main | raise e
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1289, in configure_resource_via_sdk
localstack_main | result = function(**params)
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 357, in apicall
localstack_main | return self._make_api_call(operation_name, kwargs)
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 648, in makeapi_call
localstack_main | request_dict = self._convert_to_request_dict(
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 696, in convertto_request_dict
localstack_main | request_dict = self._serializer.serialize_to_request(
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/validate.py", line 297, in serialize_to_request
localstack_main | raise ParamValidationError(report=report.generate_report())
localstack_main | botocore.exceptions.ParamValidationError: Parameter validation failed:
localstack_main | Missing required parameter in input: "FunctionName"
localstack_main |
localstack_main | 2020-10-27T20:26:42:WARNING:bootstrap.py: Thread run method <function apply_patches..cloudformation_backend_execute_change_set..do_execute at 0x7fec4a5ac280>(None) failed: Parameter validation failed:
localstack_main | Missing required parameter in input: "FunctionName" Traceback (most recent call last):
localstack_main | File "/opt/code/localstack/localstack/utils/bootstrap.py", line 534, in run
localstack_main | result = self.func(self.params)
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 1065, in do_execute
localstack_main | cloudformation_backend_execute_change_set_orig(self, change_set_name, stack_name)
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/cloudformation/models.py", line 682, in execute_change_set
localstack_main | stack.initialize_resources()
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 989, in initialize_resources
localstack_main | self.resource_map.create(self.template_dict)
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/cloudformation/parsing.py", line 589, in create
localstack_main | if isinstance(self[resource], ec2_models.TaggedEC2Resource):
localstack_main | File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/cloudformation/parsing.py", line 451, in getitem
localstack_main | new_resource = parse_and_create_resource(
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 283, in parse_and_create_resource
localstack_main | return parseand_create_resource(
localstack_main | File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 395, in parseand_create_resource
localstack_main | result = deploy_func(logical_id, resource_map_new, stack_name=stack_name)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1163, in deploy_resource
localstack_main | return execute_resource_action(resource_id, resources, stack_name, ACTION_CREATE)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1206, in execute_resource_action
localstack_main | result = configure_resource_via_sdk(resource_id, resources, resource_type, func, stack_name)
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1292, in configure_resource_via_sdk
localstack_main | raise e
localstack_main | File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 1289, in configure_resource_via_sdk
localstack_main | result = function(**params)I verified in the generated cloudformation template that the resource cogsignupPreSignUpCognito639C1C9E has a FunctionName parameter in

"cogsignupPreSignUpCognito639C1C9E": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"Action": "lambda:InvokeFunction",
"FunctionName": {
"Fn::GetAtt": [
"cogsignupF20EC8E8",
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
},
"Metadata": {
"aws:cdk:path": "ReproStack/cogsignup/PreSignUpCognito"
}
},
Here is the CDK template (I have tried with CDK dependencies pinned to 1.64.1):

import * as cdk from "@aws-cdk/core";
import * as ddb from "@aws-cdk/aws-dynamodb";
import * as lambda from "@aws-cdk/aws-lambda";
import * as apigw from "@aws-cdk/aws-apigateway";
import * as cognito from "@aws-cdk/aws-cognito";
import {UserPool, AccountRecovery, StringAttribute} from "@aws-cdk/aws-cognito";
import { Duration } from "@aws-cdk/core";
import * as path from "path";

export class ReproStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

// Create databases
const myTable = new ddb.Table(this, "mytable", {
partitionKey: {
name: "Pk",
type: ddb.AttributeType.STRING,
},
tableName: "mytable",
billingMode: ddb.BillingMode.PAY_PER_REQUEST,
});

const lambdaFn = new lambda.Function(this, "apilambda", {
code: lambda.Code.fromAsset(
path.join(__dirname, "../../../out/function.zip")
),
timeout: cdk.Duration.seconds(300),
runtime: lambda.Runtime.GO_1_X,
handler: "server_unix",
environment: {
TABLE_NAME: myTable.tableName,
},
});

const signUpLambdaFn = new lambda.Function(this, "cogsignup", {
code: lambda.Code.fromAsset(
path.join(__dirname, "../../../out/cogs.zip")
),
timeout: cdk.Duration.seconds(300),
runtime: lambda.Runtime.GO_1_X,
handler: "cog_signup",
environment: {
USER_PROFILE_TABLE_NAME: myTable.tableName,
},
});

const postConfLambdaFn = new lambda.Function(this, "cogpostconf", {
code: lambda.Code.fromAsset(
path.join(__dirname, "../../../out/cogp.zip")
),
timeout: cdk.Duration.seconds(300),
runtime: lambda.Runtime.GO_1_X,
handler: "cog_postconf",
environment: {
USER_PROFILE_TABLE_NAME: myTable.tableName,
},
});

// Create user pool
const userPool: UserPool = new cognito.UserPool(this, id + "pool", {
userPoolName: ${id}-pool,
autoVerify: {
email: true
},
passwordPolicy: {
minLength: 8,
requireDigits: false,
requireLowercase: false,
requireSymbols: false,
requireUppercase: false,
tempPasswordValidity: Duration.days(7)
},
selfSignUpEnabled: true,
accountRecovery: AccountRecovery.EMAIL_ONLY,
signInAliases: {
email: true,
preferredUsername: true,
username: true
},
signInCaseSensitive: false,
standardAttributes: {
givenName: {
mutable: true,
required: false
},
familyName: {
mutable: true,
required: false
},
email: {
mutable: true,
required: true
},
phoneNumber: {
mutable: true,
required: false
},
profilePicture: {
mutable: true,
required: false
},
birthdate: {
mutable: true,
required: false
}
},
customAttributes: {
'dummystuff': new StringAttribute({
mutable: true

})
},
lambdaTriggers: {
preSignUp: signUpLambdaFn,
postConfirmation: postConfLambdaFn
}
});

// Create client with some cfn goodness
const userPoolClient = new cognito.UserPoolClient(this, id + "web", {
userPool: userPool,
generateSecret: false,
authFlows: {
adminUserPassword: true,
userPassword: true
},
oAuth: {
callbackUrls: ["http://localhost:3000"],
scopes: [
cognito.OAuthScope.COGNITO_ADMIN,
cognito.OAuthScope.EMAIL,
cognito.OAuthScope.OPENID,
cognito.OAuthScope.PHONE,
cognito.OAuthScope.PROFILE
],
flows: {
authorizationCodeGrant: true,
implicitCodeGrant: true
}
}
});

myTable.grantReadWriteData(lambdaFn);
myTable.grantReadWriteData(signUpLambdaFn);
myTable.grantReadWriteData(postConfLambdaFn);

const api = new apigw.RestApi(this, "myapiendpoint", {
restApiName: "MyRestApi",
});
const apiRoot = api.root.addResource("api");
const integration = new apigw.LambdaIntegration(lambdaFn);
const proxy = apiRoot.addProxy({
anyMethod: true,
defaultIntegration: integration,
});
}
}

from aws-cdk-local.

sync-by-unito avatar sync-by-unito commented on August 15, 2024

➤ msteve-tokzu commented:

This PR looks like a similar issue but after looking at the code, I'm not sure it's going to fix the root cause here: getmoto/moto#3396

from aws-cdk-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.