Skip to content

Commit

Permalink
Merge branch 'main' into huijbers/undeprecate-addwarning
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 30, 2023
2 parents 41b13fc + 57bcd9a commit 1c90db2
Show file tree
Hide file tree
Showing 882 changed files with 139,491 additions and 12,917 deletions.
20 changes: 11 additions & 9 deletions INTEGRATION_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
This document describes the purpose of integration tests as well as acting as a guide
on what type of changes require integrations tests and how you should write integration tests.

- [What are CDK Integration Tests](#what-are-cdk-integration-tests)
- [When are integration tests required](#when-are-integration-tests-required)
- [How to write Integration Tests](#how-to-write-integration-tests)
- [Creating a test](#creating-a-test)
- [New L2 Constructs](#new-l2-constructs)
- [Existing L2 Constructs](#existing-l2-constructs)
- [Assertions](#assertions)
- [Running Integration Tests](#running-integration-tests)
- [Integration Tests](#integration-tests)
- [What are CDK Integration Tests](#what-are-cdk-integration-tests)
- [When are Integration Tests Required](#when-are-integration-tests-required)
- [How to write Integration Tests](#how-to-write-integration-tests)
- [Creating a Test](#creating-a-test)
- [New L2 Constructs](#new-l2-constructs)
- [Existing L2 Constructs](#existing-l2-constructs)
- [Assertions](#assertions)
- [Running Integration Tests](#running-integration-tests)
- [Running large numbers of Tests](#running-large-numbers-of-tests)

## What are CDK Integration Tests

Expand Down Expand Up @@ -94,7 +96,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-lambda-1');
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_LATEST,
});

new integ.IntegTest(app, 'LambdaTest', {
Expand Down
2 changes: 1 addition & 1 deletion design/code-asset-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const resource = new serverless.CfnFunction(this, 'Func', {
bucket: asset.s3BucketName,
key: asset.s3ObjectKey
},
runtime: 'nodejs8.10',
runtime: 'nodejs18.x',
handler: 'index.handler'
});

Expand Down
18 changes: 9 additions & 9 deletions design/construct-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This is a Lambda function that has it’s handler code written as an asset:

```typescript
new lambda.Function(this, 'HelloWorldHandler', {
runtime: lambda.Runtime.NODE_JS_8_10,
runtime: lambda.Runtime.NODEJS_LATEST,
code: lambda.Code.directory('lambda'),
handler: 'hello.handler'
});
Expand Down Expand Up @@ -119,19 +119,19 @@ The construct tree will be a list of paths that are indexed into a map of constr

### Construct properties

|Property |Type |Required |Source | Description |
|--- |--- |--- |--- | --- |
|path |string |Required |`construct.node.path` | Full, absolute path of the construct within the tree |
|children |Array |Not Required |`construct.node.children` | All direct children of this construct. Array of the absolute paths of the constructs. Will be used to walk entire list of constructs |
|attributes |Array |Not Required |`construct.node.attributes` | Attributes describing all constructs/resources/properties that are encapsulated by the construct |
| Property | Type | Required | Source | Description |
| ---------- | ------ | ------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| path | string | Required | `construct.node.path` | Full, absolute path of the construct within the tree |
| children | Array | Not Required | `construct.node.children` | All direct children of this construct. Array of the absolute paths of the constructs. Will be used to walk entire list of constructs |
| attributes | Array | Not Required | `construct.node.attributes` | Attributes describing all constructs/resources/properties that are encapsulated by the construct |

### Metadata Properties

The following metadata properties will be included by the construct that produces the `tree.json` output.

|Property |Type |Required | Description |
|--- |--- |--- | --- |
|attributes |Array |Not Required | constructs can fill in arbitrary metadata such as configuration, type, properties, etc |
| Property | Type | Required | Description |
| ---------- | ----- | ------------ | -------------------------------------------------------------------------------------- |
| attributes | Array | Not Required | constructs can fill in arbitrary metadata such as configuration, type, properties, etc |

Attributes are an extensible list and their keys should be namespaced by convention to avoid conflicts.

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build-all": "tsc -b"
},
"devDependencies": {
"@nx/workspace": "^16.7.3",
"@nx/workspace": "^16.7.4",
"@types/node": "18.11.19",
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
Expand All @@ -24,12 +24,12 @@
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.11",
"jest-junit": "^13.2.0",
"jsii-diff": "1.87.0",
"jsii-pacmak": "1.87.0",
"jsii-reflect": "1.87.0",
"jsii-rosetta": "~5.1.10",
"lerna": "^7.1.5",
"nx": "^16.7.3",
"jsii-diff": "1.88.0",
"jsii-pacmak": "1.88.0",
"jsii-reflect": "1.88.0",
"jsii-rosetta": "~5.1.11",
"lerna": "^7.2.0",
"nx": "^16.7.4",
"patch-package": "^6.5.1",
"semver": "^7.5.4",
"standard-version": "^9.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@types/semver": "^7.5.0",
"@types/semver": "^7.5.1",
"@types/yargs": "^15.0.15",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
Expand All @@ -39,11 +39,11 @@
},
"dependencies": {
"@octokit/rest": "^18.12.0",
"aws-sdk": "^2.1442.0",
"aws-sdk": "^2.1447.0",
"axios": "^0.27.2",
"fs-extra": "^9.1.0",
"glob": "^7.2.3",
"jest": "^29.6.3",
"jest": "^29.6.4",
"jest-junit": "^14.0.1",
"make-runnable": "^1.4.1",
"npm": "^8.19.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,19 @@ class LambdaStack extends cdk.Stack {
// see the 'upgrade legacy bootstrap stack' test
const synthesizer = parent.node.tryGetContext('legacySynth') === 'true' ?
new LegacyStackSynthesizer({
fileAssetsBucketName: parent.node.tryGetContext('bootstrapBucket'),
fileAssetsBucketName: parent.node.tryGetContext('bootstrapBucket'),
})
: new DefaultStackSynthesizer({
fileAssetsBucketName: parent.node.tryGetContext('bootstrapBucket'),
})
: new DefaultStackSynthesizer({
fileAssetsBucketName: parent.node.tryGetContext('bootstrapBucket'),
})
super(parent, id, {
...props,
synthesizer: synthesizer,
});

const fn = new lambda.Function(this, 'my-function', {
code: lambda.Code.asset(path.join(__dirname, 'lambda')),
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler'
});

Expand All @@ -248,7 +248,7 @@ class LambdaHotswapStack extends cdk.Stack {

const fn = new lambda.Function(this, 'my-function', {
code: lambda.Code.asset(path.join(__dirname, 'lambda')),
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler',
description: process.env.DYNAMIC_LAMBDA_PROPERTY_VALUE ?? "description",
environment: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/lambda/nodejs:14
FROM public.ecr.aws/lambda/nodejs:18

# Assumes your function is named "app.js", and there is a package.json file in the app directory
COPY app.js package.json ./
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class OutputsStack extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);

const topic = new sns.Topic(this, 'MyOutput', {
const topic = new sns.Topic(this, 'MyOutput', {
topicName: `${cdk.Stack.of(this).stackName}MyTopic`
});

Expand Down Expand Up @@ -195,7 +195,7 @@ class LambdaStack extends cdk.Stack {

const fn = new lambda.Function(this, 'my-function', {
code: lambda.Code.asset(path.join(__dirname, 'lambda')),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler'
});

Expand Down Expand Up @@ -339,7 +339,7 @@ switch (stackSet) {
if (process.env.ENABLE_VPC_TESTING === 'DEFINE')
new DefineVpcStack(app, `${stackPrefix}-define-vpc`, { env });
if (process.env.ENABLE_VPC_TESTING === 'IMPORT')
new ImportVpcStack(app, `${stackPrefix}-import-vpc`, { env });
new ImportVpcStack(app, `${stackPrefix}-import-vpc`, { env });
}

new ConditionalResourceStack(app, `${stackPrefix}-conditional-resource`)
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk-testing/framework-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@aws-cdk/integ-tests-alpha": "0.0.0",
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
"aws-cdk-lib": "0.0.0",
"aws-sdk": "^2.1442.0",
"aws-sdk": "^2.1447.0",
"aws-sdk-mock": "5.6.0",
"cdk8s": "^2.55.0",
"cdk8s": "^2.64.0",
"cdk8s-plus-24": "2.12.1",
"constructs": "^10.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "29.0.0",
"version": "34.0.0",
"files": {
"3dc8c5549b88fef617feef923524902b3650973ae1159c9489ee8405344dd5a0": {
"32958f9442f31389bed730b768bd21f066c7343a5d0e87b9cad92b365e9d3c37": {
"source": {
"path": "asset.3dc8c5549b88fef617feef923524902b3650973ae1159c9489ee8405344dd5a0.handler",
"path": "asset.32958f9442f31389bed730b768bd21f066c7343a5d0e87b9cad92b365e9d3c37.handler",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "3dc8c5549b88fef617feef923524902b3650973ae1159c9489ee8405344dd5a0.zip",
"objectKey": "32958f9442f31389bed730b768bd21f066c7343a5d0e87b9cad92b365e9d3c37.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"a605b6be7a978439cf7b93d6214f4ce6d30a9163415575fa17ba0a5857238906": {
"2e7d8bf0e8057cc8d78fd4928137f285242b175a548bbcf501299a118037c8d1": {
"source": {
"path": "RequestAuthorizerInteg.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "a605b6be7a978439cf7b93d6214f4ce6d30a9163415575fa17ba0a5857238906.json",
"objectKey": "2e7d8bf0e8057cc8d78fd4928137f285242b175a548bbcf501299a118037c8d1.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Loading

0 comments on commit 1c90db2

Please sign in to comment.