-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add more 10 ts csk * add tests to integration file --------- Co-authored-by: Matan Shati <> Co-authored-by: Omry Mendelovich <[email protected]>
- Loading branch information
Showing
40 changed files
with
1,490 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
cdk_integration_tests/src/typescript/IAMPolicyAttachedToGroupOrRoles/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { aws_iam as iam } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: iam.PolicyProps = { | ||
statements: [{}], | ||
users: [{}] | ||
}; |
26 changes: 26 additions & 0 deletions
26
cdk_integration_tests/src/typescript/IAMPolicyAttachedToGroupOrRoles/fail2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { aws_iam as iam } from 'aws-cdk-lib'; | ||
|
||
const a = new iam.Policy(this, 'userpool-policy', { | ||
statements: [new iam.PolicyStatement({ | ||
actions: ['cognito-idp:DescribeUserPool'], | ||
resources: ['Arn'], | ||
})], | ||
users: ['sdsd'] | ||
}); | ||
|
||
const b = new iam.Policy(this, 'userpool-policy', { | ||
statements: [new iam.PolicyStatement({ | ||
actions: ['cognito-idp:DescribeUserPool'], | ||
resources: ['Arn'], | ||
})], | ||
}); | ||
console.log('dsd') | ||
b.attachToUser({}) | ||
|
||
const c = new iam.Policy(this, 'userpool-policy', { | ||
statements: [new iam.PolicyStatement({ | ||
actions: ['cognito-idp:DescribeUserPool'], | ||
resources: ['Arn'], | ||
})], | ||
}); | ||
c.attachToUser({}) |
15 changes: 15 additions & 0 deletions
15
cdk_integration_tests/src/typescript/IAMPolicyAttachedToGroupOrRoles/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { aws_iam as iam } from 'aws-cdk-lib'; | ||
|
||
const a = new iam.Policy(this, 'userpool-policy', { | ||
statements: [new iam.PolicyStatement({ | ||
actions: ['cognito-idp:DescribeUserPool'], | ||
resources: ['Arn'], | ||
})], | ||
}); | ||
|
||
const cfnSecurityConfigurationProps1: iam.PolicyProps = { | ||
statements: [new iam.PolicyStatement({ | ||
actions: ['cognito-idp:DescribeUserPool'], | ||
resources: ['Arn'], | ||
})], | ||
}; |
10 changes: 10 additions & 0 deletions
10
cdk_integration_tests/src/typescript/KinesisStreamEncryptionType/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { aws_kinesis as kinesis } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: kinesis.CfnStreamProps = { | ||
streamEncryption: { encryptionType: "None", keyId: "dfdf"}, | ||
name: 'name', | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: kinesis.CfnStreamProps = { | ||
name: 'name', | ||
}; |
10 changes: 10 additions & 0 deletions
10
cdk_integration_tests/src/typescript/KinesisStreamEncryptionType/fail2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { aws_kinesis as kinesis } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new kinesis.CfnStream(this, 'MyCfnSecurityConfiguration', { | ||
streamEncryption: { encryptionType: "None", keyId: "dfdf"}, | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new kinesis.CfnStream(this, 'MyCfnSecurityConfiguration', { | ||
name: 'name', | ||
}); |
6 changes: 6 additions & 0 deletions
6
cdk_integration_tests/src/typescript/KinesisStreamEncryptionType/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { aws_kinesis as kinesis } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: kinesis.CfnStreamProps = { | ||
streamEncryption: { encryptionType: "KMS", keyId: "dfdf"}, | ||
name: 'name', | ||
}; |
16 changes: 16 additions & 0 deletions
16
cdk_integration_tests/src/typescript/LambdaDLQConfigured/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { aws_lambda as lambda } from 'aws-cdk-lib'; | ||
import { aws_sam as sam } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
}; | ||
|
||
const cfnSecurityConfigurationProps1: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: sam.CfnFunctionProps = { | ||
name: 'name', | ||
}; |
17 changes: 17 additions & 0 deletions
17
cdk_integration_tests/src/typescript/LambdaDLQConfigured/fail2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { aws_lambda as lambda } from 'aws-cdk-lib'; | ||
import { aws_sam as sam } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfiguration3 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); |
21 changes: 21 additions & 0 deletions
21
cdk_integration_tests/src/typescript/LambdaDLQConfigured/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
deadLetterQueue: {}, | ||
deadLetterQueueEnabled: true, | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
deadLetterConfig: {}, | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
deadLetterQueue: {}, | ||
}); |
29 changes: 29 additions & 0 deletions
29
cdk_integration_tests/src/typescript/LambdaEnvironmentCredentials/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
"bla": "bla", | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps3: sam.CfnFunctionProps = { | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
} | ||
}; |
30 changes: 30 additions & 0 deletions
30
cdk_integration_tests/src/typescript/LambdaEnvironmentCredentials/fail2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { aws_lambda as lambda } from 'aws-cdk-lib'; | ||
import { aws_sam as sam } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
"bla": "bla", | ||
} | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
} | ||
}); | ||
|
||
const cfnSecurityConfiguration3 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
} | ||
}); |
63 changes: 63 additions & 0 deletions
63
cdk_integration_tests/src/typescript/LambdaEnvironmentCredentials/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
"bla": "bla", | ||
}, | ||
environmentEncryption: {} | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
}, | ||
kmsKeyArn: "arn" | ||
}); | ||
|
||
const cfnSecurityConfiguration3 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
}, | ||
kmsKeyArn: "arn" | ||
}); | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
"bla": "bla", | ||
}, | ||
environmentEncryption: {} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
}, | ||
kmsKeyArn: "arn" | ||
}; | ||
|
||
const cfnSecurityConfigurationProps3: sam.CfnFunctionProps = { | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
}, | ||
kmsKeyArn: "arn" | ||
}; |
29 changes: 29 additions & 0 deletions
29
cdk_integration_tests/src/typescript/LambdaEnvironmentEncryptionSettings/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
"bla": "bla", | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps3: sam.CfnFunctionProps = { | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
} | ||
}; |
30 changes: 30 additions & 0 deletions
30
cdk_integration_tests/src/typescript/LambdaEnvironmentEncryptionSettings/fail2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { aws_lambda as lambda } from 'aws-cdk-lib'; | ||
import { aws_sam as sam } from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
"bla": "bla", | ||
}, | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
} | ||
}); | ||
|
||
const cfnSecurityConfiguration3 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
} | ||
}); |
31 changes: 31 additions & 0 deletions
31
cdk_integration_tests/src/typescript/LambdaEnvironmentEncryptionSettings/pass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfiguration1 = new lambda.Function(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfiguration2 = new lambda.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfiguration3 = new sam.CfnFunction(this, 'MyCfnSecurityConfiguration', { | ||
role: "", | ||
name: 'name', | ||
}); | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
}; | ||
|
||
const cfnSecurityConfigurationProps3: sam.CfnFunctionProps = { | ||
name: 'name', | ||
}; |
29 changes: 29 additions & 0 deletions
29
cdk_integration_tests/src/typescript/LambdaFunctionLevelConcurrentExecutionLimit/fail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {aws_lambda as lambda} from 'aws-cdk-lib'; | ||
import {aws_sam as sam} from 'aws-cdk-lib'; | ||
|
||
const cfnSecurityConfigurationProps1: lambda.FunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
"bla": "bla", | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps2: lambda.CfnFunctionProps = { | ||
name: 'name', | ||
role: "", | ||
environment: { | ||
variables: { | ||
"bla": "bla", | ||
} | ||
} | ||
}; | ||
|
||
const cfnSecurityConfigurationProps3: sam.CfnFunctionProps = { | ||
name: 'name', | ||
environment: { | ||
variables: { | ||
bla: "bla", | ||
} | ||
} | ||
}; |
Oops, something went wrong.