Skip to content

Commit c8578da

Browse files
committed
Merge branch 'Issue351' of github.com:awslabs/aws-solutions-constructs into Issue351
Update local.
2 parents 85346df + e984429 commit c8578da

File tree

9 files changed

+504
-19
lines changed

9 files changed

+504
-19
lines changed

deployment/v2/align-version.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ for (const file of process.argv.splice(4)) {
3232
pkg.devDependencies = processDevDependencies(pkg.devDependencies || { }, file);
3333
if (pkg.scripts) {
3434
pkg.scripts["integ-assert"] = "cdk-integ-assert-v2";
35+
pkg.scripts["jsii-pacmak"] = "jsii-pacmak --targets js java python";
3536
}
3637

3738
console.error(`${file} => ${replaceVersion}`);
@@ -43,9 +44,12 @@ function processDependencies(section, file) {
4344
let newdependencies = {};
4445
for (const [ name, version ] of Object.entries(section)) {
4546
// Remove all entries starting with @aws-cdk/* and constructs
46-
if (MODULE_EXEMPTIONS.has(name) || ((!name.startsWith('@aws-cdk/') && !name.startsWith('constructs')))) {
47+
if ((!name.startsWith('@aws-cdk/') && !name.startsWith('constructs'))) {
4748
newdependencies[name] = version.replace(findVersion, replaceVersion);
4849
}
50+
if (MODULE_EXEMPTIONS.has(name)) {
51+
newdependencies[name] = version.replace(findVersion, awsCdkLibVersion);
52+
}
4953
}
5054
return newdependencies;
5155
}
@@ -54,23 +58,30 @@ function processPeerDependencies(section, file) {
5458
let newdependencies = {};
5559
for (const [ name, version ] of Object.entries(section)) {
5660
// Remove all entries starting with @aws-cdk/* and constructs
57-
if (MODULE_EXEMPTIONS.has(name) || ((!name.startsWith('@aws-cdk/') && !name.startsWith('constructs')))) {
61+
if ((!name.startsWith('@aws-cdk/') && !name.startsWith('constructs'))) {
5862
newdependencies[name] = version.replace(findVersion, replaceVersion);
5963
}
64+
if (MODULE_EXEMPTIONS.has(name)) {
65+
newdependencies[name] = version.replace(findVersion, awsCdkLibVersion);
66+
}
6067
}
6168
newdependencies["aws-cdk-lib"] = `^${awsCdkLibVersion}`;
6269
newdependencies["constructs"] = `^${constructsVersion}`;
6370
return newdependencies;
6471
}
6572

6673
function processDevDependencies(section, file) {
67-
let newdependencies = section;
68-
for (const [ name, version ] of Object.entries(newdependencies)) {
74+
let newdependencies = {};
75+
for (const [ name, version ] of Object.entries(section)) {
6976
// Remove all entries starting with @aws-cdk/* and constructs
70-
if (version === findVersion || version === '^' + findVersion) {
77+
if ((!name.startsWith('@aws-cdk/') && !name.startsWith('constructs'))) {
7178
newdependencies[name] = version.replace(findVersion, replaceVersion);
7279
}
80+
if (MODULE_EXEMPTIONS.has(name)) {
81+
newdependencies[name] = version.replace(findVersion, awsCdkLibVersion);
82+
}
7383
}
84+
7485
// note: no ^ to make sure we test against the minimum version
7586
newdependencies["aws-cdk-lib"] = `${awsCdkLibVersion}`;
7687
newdependencies["constructs"] = `^${constructsVersion}`;

deployment/v2/build-cdk-dist.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -euo pipefail
33

44
deployment_dir=$(cd $(dirname $0) && pwd)
5-
source_dir="$deployment_dir/../source"
6-
dist_dir="$deployment_dir/dist"
5+
source_dir="$deployment_dir/../../source"
6+
dist_dir="$deployment_dir/../dist"
77

88
cd $source_dir/
99
export PATH=$(npm bin):$PATH
@@ -73,7 +73,7 @@ cat > ${dist_dir}/build.json <<HERE
7373
HERE
7474

7575
# copy CHANGELOG.md to dist/ for github releases
76-
changelog_file=$deployment_dir/../CHANGELOG.md
76+
changelog_file=$deployment_dir/../../CHANGELOG.v2.md
7777
cp ${changelog_file} ${dist_dir}/CHANGELOG.md
7878

7979
echo "------------------------------------------------------------------------------"

source/patterns/@aws-solutions-constructs/aws-kinesisstreams-gluejob/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
"devDependencies": {
6767
"@aws-cdk/assert": "0.0.0",
6868
"@types/jest": "^26.0.22",
69-
"@types/node": "^10.3.0",
70-
"aws-cdk": "0.0.0"
69+
"@types/node": "^10.3.0"
7170
},
7271
"jest": {
7372
"moduleFileExtensions": [

source/patterns/@aws-solutions-constructs/aws-lambda-s3/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ _Parameters_
5252
| **Name** | **Type** | **Description** |
5353
|:-------------|:----------------|-----------------|
5454
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
55-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
55+
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|Optional user provided props to override the default props for the Lambda function.|
5656
|existingBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Existing instance of S3 Bucket object. If this is provided, then also providing bucketProps is an error. |
57-
|bucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|User provided props to override the default props for the S3 Bucket.|
57+
|bucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Bucket.|
5858
|bucketPermissions?|`string[]`|Optional bucket permissions to grant to the Lambda function. One or more of the following may be specified: `Delete`, `Put`, `Read`, `ReadWrite`, `Write`.|
5959
|existingVpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon SQS. If an existing VPC is provided, the `deployVpc` property cannot be `true`. This uses `ec2.IVpc` to allow clients to supply VPCs that exist outside the stack using the [`ec2.Vpc.fromLookup()`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
60-
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user-provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overrriden. If `deployVpc` is not `true` then this property will be ignored.|
60+
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overrriden. If `deployVpc` is not `true` then this property will be ignored.|
6161
|deployVpc?|`boolean`|Whether to create a new VPC based on `vpcProps` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:<ul><li> One isolated subnet in each Availability Zone used by the CDK program</li><li>`enableDnsHostnames` and `enableDnsSupport` will both be set to true</li></ul>If this property is `true` then `existingVpc` cannot be specified. Defaults to `false`.|
62-
|bucketEnvironmentVariableName?|`string`|Optional Name for the S3 bucket environment variable set for the Lambda function.|
62+
|bucketEnvironmentVariableName?|`string`|Optional name for the S3 bucket environment variable set for the Lambda function.|
63+
|loggingBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Logging Bucket.|
6364

6465
## Pattern Properties
6566

source/patterns/@aws-solutions-constructs/aws-lambda-s3/lib/index.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface LambdaToS3Props {
3030
*/
3131
readonly existingLambdaObj?: lambda.Function;
3232
/**
33-
* User provided props to override the default props for the Lambda function.
33+
* Optional user provided props to override the default props for the Lambda function.
3434
*
3535
* @default - Default properties are used.
3636
*/
@@ -42,7 +42,7 @@ export interface LambdaToS3Props {
4242
*/
4343
readonly existingBucketObj?: s3.IBucket;
4444
/**
45-
* User provided props to override the default props for the S3 Bucket.
45+
* Optional user provided props to override the default props for the S3 Bucket.
4646
*
4747
* @default - Default props are used
4848
*/
@@ -69,11 +69,17 @@ export interface LambdaToS3Props {
6969
*/
7070
readonly deployVpc?: boolean;
7171
/**
72-
* Optional Name for the S3 bucket environment variable set for the Lambda function.
72+
* Optional name for the S3 bucket environment variable set for the Lambda function.
7373
*
7474
* @default - None
7575
*/
7676
readonly bucketEnvironmentVariableName?: string;
77+
/**
78+
* Optional user provided props to override the default props for the S3 Logging Bucket.
79+
*
80+
* @default - Default props are used
81+
*/
82+
readonly loggingBucketProps?: s3.BucketProps
7783
}
7884

7985
/**
@@ -131,7 +137,8 @@ export class LambdaToS3 extends Construct {
131137
// Setup S3 Bucket
132138
if (!props.existingBucketObj) {
133139
[this.s3Bucket, this.s3LoggingBucket] = defaults.buildS3Bucket(this, {
134-
bucketProps: props.bucketProps
140+
bucketProps: props.bucketProps,
141+
loggingBucketProps: props.loggingBucketProps
135142
});
136143
bucket = this.s3Bucket;
137144
} else {

0 commit comments

Comments
 (0)