Skip to content

Commit

Permalink
Merge branch 'master' into fsx-lustre-l2
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored May 4, 2020
2 parents d524edc + a52b3e3 commit 38b4719
Show file tree
Hide file tree
Showing 387 changed files with 2,518 additions and 1,175 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ and let us know if it's not up-to-date (even better, submit a PR with your corr
## Getting Started

For day-to-day development and normal contributions, the following SDKs and tools are required:
- [Node.js 10.12.0](https://nodejs.org/download/release/latest-v10.x/)
- [Node.js 10.13.0](https://nodejs.org/download/release/latest-v10.x/)
- [Yarn >= 1.19.1](https://yarnpkg.com/lang/en/docs/install)
- [Java OpenJDK 8](http://openjdk.java.net/install/)
- [.NET Core SDK 3.0](https://www.microsoft.com/net/download)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ infrastructure definition and share it without worrying about boilerplate logic.

The CDK is available in the following languages:

* JavaScript, TypeScript ([Node.js ≥ 10.12.0](https://nodejs.org/download/release/latest-v10.x/))
* JavaScript, TypeScript ([Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/))
* Python ([Python ≥ 3.6](https://www.python.org/downloads/))
* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi))
* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download))
Expand Down Expand Up @@ -57,7 +57,7 @@ on AWS.

## At a glance

Install or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 10.12.0](https://nodejs.org/download/release/latest-v10.x/)):
Install or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/)):

```bash
$ npm i -g aws-cdk
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"**/jszip/**",
"@aws-cdk/cdk-assets-schema/semver",
"@aws-cdk/cdk-assets-schema/semver/**",
"@aws-cdk/assets/minimatch",
"@aws-cdk/assets/minimatch/**",
"@aws-cdk/core/minimatch",
"@aws-cdk/core/minimatch/**",
"@aws-cdk/aws-codepipeline-actions/case",
"@aws-cdk/aws-codepipeline-actions/case/**",
"@aws-cdk/aws-ecr-assets/minimatch",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/alexa-ask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<!--END STABILITY BANNER-->

```ts
const alexaAsk = require('@aws-cdk/alexa-ask');
import * as alexaAsk from '@aws-cdk/alexa-ask';
```
2 changes: 1 addition & 1 deletion packages/@aws-cdk/alexa-ask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"constructs": "^3.0.2"
},
"engines": {
"node": ">= 10.12.0"
"node": ">= 10.13.0"
},
"stability": "experimental",
"maturity": "experimental",
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/app-delivery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ The example below defines a *CDK App* that contains 3 stacks:
#### `index.ts`

```typescript
import codebuild = require('@aws-cdk/aws-codebuild');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import codepipeline_actions = require('@aws-cdk/aws-codepipeline-actions');
import cdk = require('@aws-cdk/core');
import cicd = require('@aws-cdk/app-delivery');
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions';
import * as cdk from '@aws-cdk/core';
import * as cicd from '@aws-cdk/app-delivery';

const app = new cdk.App();

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"constructs": "^3.0.2"
},
"engines": {
"node": ">= 10.12.0"
"node": ">= 10.13.0"
},
"stability": "experimental",
"maturity": "experimental",
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Resources": {
"ArtifactBucket7410C9EF": {
"Type": "AWS::S3::Bucket",
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Delete"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"CodePipelineRoleB3A660B4": {
"Type": "AWS::IAM::Role",
Expand Down Expand Up @@ -467,4 +467,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@types/jest": "^25.2.1",
"cdk-build-tools": "0.0.0",
"jest": "^25.5.2",
"jest": "^25.5.4",
"pkglint": "0.0.0",
"ts-jest": "^25.4.0"
},
Expand All @@ -44,7 +44,7 @@
},
"peerDependencies": {
"@aws-cdk/core": "0.0.0",
"jest": "^25.5.2",
"jest": "^25.5.4",
"constructs": "^3.0.2"
},
"repository": {
Expand All @@ -58,7 +58,7 @@
],
"homepage": "https://github.com/aws/aws-cdk",
"engines": {
"node": ">= 10.12.0"
"node": ">= 10.13.0"
},
"stability": "experimental",
"maturity": "experimental"
Expand Down
10 changes: 3 additions & 7 deletions packages/@aws-cdk/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
<!--BEGIN STABILITY BANNER-->
---

![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
![Deprecated](https://img.shields.io/badge/deprecated-critical.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
> This API may emit warnings. Backward compatibility is not guaranteed.
---
<!--END STABILITY BANNER-->

This module includes core classes for to CDK assets, used for copying asset
files to a staging area. Most CDK users should not need to use the classes in
this package directly.


All types moved to @aws-cdk/core.
17 changes: 17 additions & 0 deletions packages/@aws-cdk/assets/lib/compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { SymlinkFollowMode } from '@aws-cdk/core';
import { FollowMode } from './fs/follow-mode';

export function toSymlinkFollow(follow?: FollowMode): SymlinkFollowMode | undefined {
if (!follow) {
return undefined;
}

switch (follow) {
case FollowMode.NEVER: return SymlinkFollowMode.NEVER;
case FollowMode.ALWAYS: return SymlinkFollowMode.ALWAYS;
case FollowMode.BLOCK_EXTERNAL: return SymlinkFollowMode.BLOCK_EXTERNAL;
case FollowMode.EXTERNAL: return SymlinkFollowMode.EXTERNAL;
default:
throw new Error(`unknown follow mode: ${follow}`);
}
}
4 changes: 4 additions & 0 deletions packages/@aws-cdk/assets/lib/fs/follow-mode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Symlink follow mode.
* @deprecated see `core.SymlinkFollowMode`
*/
export enum FollowMode {
/**
* Never follow symlinks.
Expand Down
4 changes: 0 additions & 4 deletions packages/@aws-cdk/assets/lib/fs/index.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/@aws-cdk/assets/lib/fs/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { FollowMode } from './follow-mode';

/**
* Obtains applied when copying directories into the staging location.
* @deprecated see `core.CopyOptions`
*/
export interface CopyOptions {
/**
Expand All @@ -21,6 +22,7 @@ export interface CopyOptions {

/**
* Options related to calculating source hash.
* @deprecated see `core.FingerprintOptions`
*/
export interface FingerprintOptions extends CopyOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assets/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './api';
export * from './fs/follow-mode';
export * from './fs/options';
export * from './staging';
export * from './staging';
101 changes: 19 additions & 82 deletions packages/@aws-cdk/assets/lib/staging.ts
Original file line number Diff line number Diff line change
@@ -1,92 +1,29 @@
import { Construct, ISynthesisSession } from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs';
import * as path from 'path';
import { copyDirectory, fingerprint, FingerprintOptions } from './fs';
import { AssetStaging, Construct } from '@aws-cdk/core';
import { toSymlinkFollow } from './compat';
import { FingerprintOptions } from './fs/options';

/**
* Deprecated
* @deprecated use `core.AssetStagingProps`
*/
export interface StagingProps extends FingerprintOptions {
/**
* Local file or directory to stage.
*/
readonly sourcePath: string;
}

/**
* Stages a file or directory from a location on the file system into a staging
* directory.
*
* This is controlled by the context key 'aws:cdk:asset-staging' and enabled
* by the CLI by default in order to ensure that when the CDK app exists, all
* assets are available for deployment. Otherwise, if an app references assets
* in temporary locations, those will not be available when it exists (see
* https://github.com/aws/aws-cdk/issues/1716).
*
* The `stagedPath` property is a stringified token that represents the location
* of the file or directory after staging. It will be resolved only during the
* "prepare" stage and may be either the original path or the staged path
* depending on the context setting.
*
* The file/directory are staged based on their content hash (fingerprint). This
* means that only if content was changed, copy will happen.
* Deprecated
* @deprecated use `core.AssetStaging`
*/
export class Staging extends Construct {

/**
* The path to the asset (stringinfied token).
*
* If asset staging is disabled, this will just be the original path.
* If asset staging is enabled it will be the staged path.
*/
public readonly stagedPath: string;

/**
* The path of the asset as it was referenced by the user.
*/
public readonly sourcePath: string;

/**
* A cryptographic hash of the source document(s).
*/
public readonly sourceHash: string;

private readonly fingerprintOptions: FingerprintOptions;

private readonly relativePath?: string;

export class Staging extends AssetStaging {
constructor(scope: Construct, id: string, props: StagingProps) {
super(scope, id);

this.sourcePath = props.sourcePath;
this.fingerprintOptions = props;
this.sourceHash = fingerprint(this.sourcePath, props);

const stagingDisabled = this.node.tryGetContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT);
if (stagingDisabled) {
this.stagedPath = this.sourcePath;
} else {
this.relativePath = 'asset.' + this.sourceHash + path.extname(this.sourcePath);
this.stagedPath = this.relativePath; // always relative to outdir
}
}

protected synthesize(session: ISynthesisSession) {
if (!this.relativePath) {
return;
}

const targetPath = path.join(session.assembly.outdir, this.relativePath);

// asset already staged
if (fs.existsSync(targetPath)) {
return;
}

// copy file/directory to staging directory
const stat = fs.statSync(this.sourcePath);
if (stat.isFile()) {
fs.copyFileSync(this.sourcePath, targetPath);
} else if (stat.isDirectory()) {
fs.mkdirSync(targetPath);
copyDirectory(this.sourcePath, targetPath, this.fingerprintOptions);
} else {
throw new Error(`Unknown file type: ${this.sourcePath}`);
}
super(scope, id, {
sourcePath: props.sourcePath,
exclude: props.exclude,
extraHash: props.extraHash,
follow: toSymlinkFollow(props.follow),
});
}
}
20 changes: 4 additions & 16 deletions packages/@aws-cdk/assets/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aws-cdk/assets",
"version": "0.0.0",
"description": "Integration of CDK apps with local assets",
"description": "This module is deprecated. All types are now available under the core module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"jsii": {
Expand Down Expand Up @@ -64,7 +64,6 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assert": "0.0.0",
"@types/minimatch": "^3.0.3",
"@types/nodeunit": "^0.0.30",
"@types/sinon": "^9.0.0",
"aws-cdk": "0.0.0",
Expand All @@ -78,7 +77,6 @@
"dependencies": {
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"minimatch": "^3.0.4",
"constructs": "^3.0.2"
},
"homepage": "https://github.com/aws/aws-cdk",
Expand All @@ -88,20 +86,10 @@
"constructs": "^3.0.2"
},
"engines": {
"node": ">= 10.12.0"
},
"bundledDependencies": [
"minimatch"
],
"stability": "experimental",
"maturity": "experimental",
"awslint": {
"exclude": [
"docs-public-apis:@aws-cdk/assets.StagingProps",
"docs-public-apis:@aws-cdk/assets.StagingProps.sourcePath",
"docs-public-apis:@aws-cdk/assets.FollowMode"
]
"node": ">= 10.13.0"
},
"stability": "deprecated",
"maturity": "deprecated",
"awscdkio": {
"announce": false
}
Expand Down
15 changes: 15 additions & 0 deletions packages/@aws-cdk/assets/test/test.compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { SymlinkFollowMode } from '@aws-cdk/core';
import { Test } from 'nodeunit';
import { FollowMode } from '../lib';
import { toSymlinkFollow } from '../lib/compat';

export = {
'FollowMode compatibility'(test: Test) {
test.equal(toSymlinkFollow(undefined), null);
test.equal(toSymlinkFollow(FollowMode.ALWAYS), SymlinkFollowMode.ALWAYS);
test.equal(toSymlinkFollow(FollowMode.BLOCK_EXTERNAL), SymlinkFollowMode.BLOCK_EXTERNAL);
test.equal(toSymlinkFollow(FollowMode.EXTERNAL), SymlinkFollowMode.EXTERNAL);
test.equal(toSymlinkFollow(FollowMode.NEVER), SymlinkFollowMode.NEVER);
test.done();
},
};
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-accessanalyzer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

```ts
import accessanalyzer = require('@aws-cdk/aws-accessanalyzer');
import * as accessanalyzer from '@aws-cdk/aws-accessanalyzer';
```
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-accessanalyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"constructs": "^3.0.2"
},
"engines": {
"node": ">= 10.12.0"
"node": ">= 10.13.0"
},
"stability": "experimental",
"maturity": "cfn-only",
Expand Down
Loading

0 comments on commit 38b4719

Please sign in to comment.