aws-cdk

How to skip IAM change confirmation during a cdk deploy?

白昼怎懂夜的黑 提交于 2021-01-28 05:24:15
问题 When deploying any changes with the CDK that require IAM policy updates, you get the following message: This deployment will make potentially sensitive changes according to your current security approval level which is followed by the list of policy changes to be made and then a confirmation dialog. In general I think this is a good thing to have, but unfortunately it makes automating deployments difficult. Is there a hidden flag or environment variable that can be set to skip this

How to get logical ID of resource with CDK?

泄露秘密 提交于 2021-01-27 05:52:33
问题 I'm attempting to write some tests for a CDK Construct that validates security group rules defined as part of the construct. The Construct looks something like the following. export interface SampleConstructProps extends StackProps { srcSecurityGroupId: string; } export class SampleConstruct extends Construct { securityGroup: SecurityGroup; constructor(scope: Construct, id: string, props: SampleConstructProps) { super(scope, id, props); // const vpc = Vpc.fromLookup(...); this.securityGroup =

How to get logical ID of resource with CDK?

孤人 提交于 2021-01-27 05:51:04
问题 I'm attempting to write some tests for a CDK Construct that validates security group rules defined as part of the construct. The Construct looks something like the following. export interface SampleConstructProps extends StackProps { srcSecurityGroupId: string; } export class SampleConstruct extends Construct { securityGroup: SecurityGroup; constructor(scope: Construct, id: string, props: SampleConstructProps) { super(scope, id, props); // const vpc = Vpc.fromLookup(...); this.securityGroup =

Step functions task for existing lambda in CDK

徘徊边缘 提交于 2021-01-25 06:44:22
问题 I am new to CDK and we have existing lambda resource and I want to use the lambda function as task in CDK. RunLambdaTask is expecting the lambda function. Is there a way to get the lambda function from the arn? submit_job = sfn.Task( self, "Submit Job", task=sfn_tasks.RunLambdaTask("how to get the lambda function") result_path="$.guid", ) 回答1: In order to get the lambda function using ARN you need to use - lambda.Function.fromFunctionArn . Usage: const lambdaARN = `arn:aws:lambda:${region}:$

Returns JSII error when attempting to create empty stack with python AWS CDK

妖精的绣舞 提交于 2020-12-06 15:32:09
问题 aws cdk returns jsii error on empty stack. Steps to reproduce are at the hello world level which makes me think that I have a version mismatch somewhere. I have re-installed aws cli, cdk and nodejs. Any suggestions on what to look for? Steps to reproduce: mkdir myfolder cdk init --language python .env\Scripts\activate.ps1 python -m pip install -r requirements.txt cdk synth Returns error AND an empty stack: (.env) p$[myfolder]> cdk synth d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii

Returns JSII error when attempting to create empty stack with python AWS CDK

别说谁变了你拦得住时间么 提交于 2020-12-06 15:32:02
问题 aws cdk returns jsii error on empty stack. Steps to reproduce are at the hello world level which makes me think that I have a version mismatch somewhere. I have re-installed aws cli, cdk and nodejs. Any suggestions on what to look for? Steps to reproduce: mkdir myfolder cdk init --language python .env\Scripts\activate.ps1 python -m pip install -r requirements.txt cdk synth Returns error AND an empty stack: (.env) p$[myfolder]> cdk synth d:\myfolder\.env\lib\site-packages\jsii\_embedded\jsii

Lambda can't find modules from outer folders when deployed with CDK

帅比萌擦擦* 提交于 2020-12-03 05:04:52
问题 I am deploying some apis to API Gateway using cdk. My problem is the file that contains the lambda(index.ts) can't import any files or npm modules outside that folder(folder named get-users ). I tried copying node_modules folder and other files (which were outside the folder get-users ) to the folder get-users and it worked perfectly. Example error when importing lodash is as follows, "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'lodash'", "stack": [

Lambda can't find modules from outer folders when deployed with CDK

浪尽此生 提交于 2020-12-03 05:03:55
问题 I am deploying some apis to API Gateway using cdk. My problem is the file that contains the lambda(index.ts) can't import any files or npm modules outside that folder(folder named get-users ). I tried copying node_modules folder and other files (which were outside the folder get-users ) to the folder get-users and it worked perfectly. Example error when importing lodash is as follows, "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'lodash'", "stack": [

Lambda can't find modules from outer folders when deployed with CDK

余生颓废 提交于 2020-12-03 05:01:19
问题 I am deploying some apis to API Gateway using cdk. My problem is the file that contains the lambda(index.ts) can't import any files or npm modules outside that folder(folder named get-users ). I tried copying node_modules folder and other files (which were outside the folder get-users ) to the folder get-users and it worked perfectly. Example error when importing lodash is as follows, "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'lodash'", "stack": [