Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
v1.1.2: CDK version update
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Minkevich committed Sep 15, 2022
1 parent e5f24ca commit 12b37de
Show file tree
Hide file tree
Showing 110 changed files with 10,546 additions and 16,704 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [1.1.2] - 2022-09-15
### Added
- Added support for all AWS partitions

### Changed
- Updated to CDK v2.25.0
- Updated dependencies

## [1.1.1] - 2021-11-22
### Added
- Amazon S3 Glacier Re:Freezer detects the size of the object to be copied to the target bucket and adjusts the number of Lambda calls invoking UploadPartCopy S3 API Call.
Expand Down
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%%SOLUTION_NAME%%
Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except
in compliance with the License. A copy of the License is located at http://www.apache.org/licenses/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ To customize and deploy the solution from the source code, follow the steps belo
Install prerequisite software packages:

* [AWS Command Line Interface](https://aws.amazon.com/cli/)
* [AWS Cloud Development Kit (AWS CDK)](https://aws.amazon.com/cdk/)
* [AWS Cloud Development Kit (AWS CDK) v2](https://aws.amazon.com/cdk/)
* [Node package manager](https://www.npmjs.com/)
* Node.js 12.x or later
* Node.js 16.x

> **OBS**: At the time of writing the latest Node.js runtime version supported by AWS Lambda is v14 ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)). Please use Node.js v14 when running and testing the solution.
> **OBS**: At the time of writing the latest Node.js runtime version supported by AWS Lambda is v16 ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)). Please use Node.js v16 when running and testing the solution.
### 1. Download or clone this repo
```
Expand Down Expand Up @@ -234,8 +234,8 @@ BUCKET_NAME=my-glacier-refreezer-ap-southeast-2 # full regional bucket name
SOLUTION_NAME=my-solution-name # custom solution name
VERSION=my-version # custom version number
aws s3 cp ./global-s3-assets/ s3://${BUCKET_NAME}/${SOLUTION_NAME}/${VERSION} --recursive --acl public-read --acl bucket-owner-full-control
aws s3 cp ./regional-s3-assets/ s3://${BUCKET_NAME}/${SOLUTION_NAME}/${VERSION} --recursive --acl public-read --acl bucket-owner-full-control
aws s3 cp ./global-s3-assets/ s3://${BUCKET_NAME}/${SOLUTION_NAME}/${VERSION} --recursive --acl public-read
aws s3 cp ./regional-s3-assets/ s3://${BUCKET_NAME}/${SOLUTION_NAME}/${VERSION} --recursive --acl public-read
echo "https://${BUCKET_NAME}.s3.amazonaws.com/${SOLUTION_NAME}/${VERSION}/${SOLUTION_NAME}.template"
```
Expand All @@ -260,7 +260,7 @@ echo "https://${BUCKET_NAME}.s3.amazonaws.com/${SOLUTION_NAME}/${VERSION}/${SOLU

***

Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
set -e

# Important: CDK global version number
cdk_version=1.119.0
cdk_version=2.25.0

# Check to see if input has been provided:
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
Expand Down
2 changes: 1 addition & 1 deletion deployment/cdk-solution-helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ After:

***

Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 3 additions & 5 deletions deployment/cdk-solution-helper/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
Expand Down Expand Up @@ -33,11 +33,9 @@ fs.readdirSync(global_s3_assets).forEach(file => {
const fn = template.Resources[f];
if (fn.Properties.Code.hasOwnProperty('S3Bucket')) {
// Set the S3 key reference
let artifactHash = Object.assign(fn.Properties.Code.S3Bucket.Ref);
artifactHash = artifactHash.replace('AssetParameters', '');
artifactHash = artifactHash.substring(0, artifactHash.indexOf('S3Bucket'));
let artifactHash = fn.Properties.Code.S3Key;
const assetPath = `asset${artifactHash}`;
fn.Properties.Code.S3Key = `%%SOLUTION_NAME%%/%%VERSION%%/${assetPath}.zip`;
fn.Properties.Code.S3Key = `%%SOLUTION_NAME%%/%%VERSION%%/${assetPath}`;

// Set the S3 bucket reference
fn.Properties.Code.S3Bucket = {
Expand Down
8 changes: 6 additions & 2 deletions source/bin/amazon-s3-glacier-refreezer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import * as cdk from 'aws-cdk-lib';
import { AmazonS3GlacierRefreezerStack } from '../lib/amazon-s3-glacier-refreezer-stack';

const app = new cdk.App();
Expand All @@ -11,6 +11,10 @@ new AmazonS3GlacierRefreezerStack(
{
solutionId: 'SO0140',
solutionName: 'amazon-s3-glacier-refreezer',
description: '(SO0140) - Amazon S3 Glacier Re:Freezer copies Amazon S3 Glacier Vault archives to Amazon S3 Bucket. Version %%VERSION%%'
description: '(SO0140) - Amazon S3 Glacier Re:Freezer copies Amazon S3 Glacier Vault archives to Amazon S3 Bucket. Version %%VERSION%%',
// avoid adding CDK Bootstrap version rule check
synthesizer: new cdk.DefaultStackSynthesizer({
generateBootstrapVersionRule: false
})
}
);
30 changes: 26 additions & 4 deletions source/cdk.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
{
"app": "npx ts-node bin/amazon-s3-glacier-refreezer.ts",
"app": "npx ts-node --prefer-ts-exts bin/amazon-s3-glacier-refreezer.ts",
"watch": {
"include": [
"**"
],
"exclude": [
"README.md",
"cdk*.json",
"**/*.d.ts",
"**/*.js",
"tsconfig.json",
"package*.json",
"yarn.lock",
"node_modules",
"test"
]
},
"context": {
"@aws-cdk/core:enableStackNameDuplicates": "true",
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true"
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
"@aws-cdk/core:stackRelativeExports": true,
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
"@aws-cdk/aws-lambda:recognizeVersionProps": true,
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
"@aws-cdk/core:checkSecretUsage": true,
"@aws-cdk/aws-iam:minimizePolicies": true
}
}
2 changes: 1 addition & 1 deletion source/install-node-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function package_lambda() {

function_name=${PWD##*/}
msg " ${function_name} from ${PWD}"
npm ci --only=prod
npm ci --omit=dev
}

echo "------------------------------------------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion source/lambda/calculateMetrics/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************************************************************************
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance *
* with the License. A copy of the License is located at *
Expand Down
2 changes: 1 addition & 1 deletion source/lambda/calculateMetrics/lib/dynamo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************************************************************************
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance *
* with the License. A copy of the License is located at *
Expand Down
Loading

0 comments on commit 12b37de

Please sign in to comment.