Skip to content

Commit

Permalink
Merge branch 'v2-main' into v2/forward-merge-20210609
Browse files Browse the repository at this point in the history
  • Loading branch information
MrArnoldPalmer authored Jun 14, 2021
2 parents 00c11b5 + 5b00ea4 commit 6dad25a
Show file tree
Hide file tree
Showing 685 changed files with 3,524 additions and 3,176 deletions.
930 changes: 930 additions & 0 deletions CHANGELOG.v2.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"include": "dependencies/node-version"
},
"scripts": {
"pkglint": "lerna --scope pkglint run build && lerna run pkglint",
"pkglint": "lerna run build --scope pkglint --include-dependencies && lerna run pkglint",
"prebuild": "node ./scripts/check-yarn-lock.js",
"build": "./build.sh",
"pack": "./pack.sh",
"compat": "./scripts/check-api-compatibility.sh",
Expand Down Expand Up @@ -53,7 +54,7 @@
"release.json",
"scripts/resolve-version.js",
"scripts/resolve-version-lib.js",
"version.v1.json"
"version.v2.json"
],
"cacheBucket": "nozem-artifacts-eu",
"cacheBucketRegion": "eu-west-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { EnvironmentCapacityType } from './extensions/extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

/**
* Settings for the environment where you want to deploy your services.
*/
Expand Down Expand Up @@ -98,7 +94,7 @@ export class Environment extends Construct implements IEnvironment {
*/
public readonly capacityType: EnvironmentCapacityType;

private readonly scope: cdk.Construct;
private readonly scope: Construct;

constructor(scope: Construct, id: string, props?: EnvironmentProps) {
super(scope, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import * as regionInfo from '@aws-cdk/region-info';
import { Construct } from 'constructs';
import { Service } from '../service';
import { Container } from './container';
import { ServiceExtension, ServiceBuild } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

// The version of the App Mesh envoy sidecar to add to the task.
const APP_MESH_ENVOY_SIDECAR_VERSION = 'v1.15.1.0-prod';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as route53 from '@aws-cdk/aws-route53';
import { Construct } from 'constructs';
import { Service } from '../../service';
import { Container } from '../container';
import { ServiceExtension, ServiceBuild, EnvironmentCapacityType } from '../extension-interfaces';
import { TaskRecordManager } from './task-record-manager';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

export interface AssignPublicIpExtensionOptions {
/**
* Enable publishing task public IPs to a recordset in a Route 53 hosted zone.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import * as route53 from '@aws-cdk/aws-route53';
import * as sqs from '@aws-cdk/aws-sqs';
import * as cdk from '@aws-cdk/core';
import * as customresources from '@aws-cdk/custom-resources';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';
import { Construct } from 'constructs';

export interface TaskRecordManagerProps {
service: ecs.Ec2Service | ecs.FargateService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import { Construct } from 'constructs';
import { Service } from '../service';
import { ServiceExtension } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

const CLOUDWATCH_AGENT_IMAGE = 'amazon/cloudwatch-agent:latest';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as ecs from '@aws-cdk/aws-ecs';
import { Construct } from 'constructs';
import { Service } from '../service';
import { ServiceExtension } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

/**
* Setting for the main application container of a service.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Service } from '../service';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

/**
* The types of capacity that are supported. These capacity types may change the
* behavior of an extension.
Expand Down Expand Up @@ -115,7 +112,7 @@ export abstract class ServiceExtension {
* the extension is told what Service it is now working on.
*/
protected parentService!: Service;
protected scope!: cdk.Construct;
protected scope!: Construct;

// A list of other extensions which want to mutate the
// container definition for this extension.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as awslogs from '@aws-cdk/aws-logs';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Service } from '../service';
import { Container } from './container';
import { ContainerMutatingHook, ServiceExtension } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

/**
* Settings for the hook which mutates the application container
* to route logs through FireLens.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as alb from '@aws-cdk/aws-elasticloadbalancingv2';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Service } from '../service';
import { ServiceExtension, ServiceBuild } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

/**
* This extension add a public facing load balancer for sending traffic
* to one or more replicas of the application container.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { Service } from '../service';
import { ServiceExtension } from './extension-interfaces';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';

const XRAY_DAEMON_IMAGE = 'amazon/aws-xray-daemon:latest';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as ecs from '@aws-cdk/aws-ecs';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { IEnvironment } from './environment';
import { EnvironmentCapacityType, ServiceBuild } from './extensions/extension-interfaces';
import { ServiceDescription } from './service-description';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';
import { Construct } from 'constructs';

/**
* The settings for an ECS Service.
Expand Down Expand Up @@ -86,7 +85,7 @@ export class Service extends Construct {
*/
private urls: Record<string, string> = {};

private readonly scope: cdk.Construct;
private readonly scope: Construct;

constructor(scope: Construct, id: string, props: ServiceProps) {
super(scope, id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@aws-cdk-containers/ecs-service-extensions",
"version": "0.0.0",
"private": true,
"description": "The CDK Construct Library that helps you build ECS services using simple extensions",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -66,7 +67,7 @@
"@aws-cdk/core": "0.0.0",
"@aws-cdk/custom-resources": "0.0.0",
"@aws-cdk/region-info": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"homepage": "https://github.com/aws/aws-cdk",
"peerDependencies": {
Expand All @@ -91,7 +92,7 @@
"@aws-cdk/core": "0.0.0",
"@aws-cdk/custom-resources": "0.0.0",
"@aws-cdk/region-info": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/@aws-cdk/alexa-ask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@aws-cdk/alexa-ask",
"version": "0.0.0",
"private": true,
"description": "The CDK Construct Library for Alexa::ASK",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -80,11 +81,11 @@
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import * as events from '@aws-cdk/aws-events';
import * as iam from '@aws-cdk/aws-iam';
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cdk from '@aws-cdk/core';

// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
// eslint-disable-next-line no-duplicate-imports, import/order
import { Construct } from '@aws-cdk/core';
import { Construct } from 'constructs';

export interface PipelineDeployStackActionProps {
/**
Expand Down
5 changes: 3 additions & 2 deletions packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@aws-cdk/app-delivery",
"description": "Continuous Integration / Continuous Delivery for CDK Applications",
"deprecated": "Use the @aws-cdk/pipelines module instead",
"private": true,
"version": "0.0.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -55,7 +56,7 @@
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"devDependencies": {
"@aws-cdk/aws-s3": "0.0.0",
Expand Down Expand Up @@ -93,7 +94,7 @@
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
Expand Down
29 changes: 23 additions & 6 deletions packages/@aws-cdk/assert-internal/lib/synth-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ export class SynthUtils {
/**
* Returns the cloud assembly template artifact for a stack.
*/
public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact {
public static synthesize(stack: core.Stack, options: core.StageSynthesisOptions = { }): cxapi.CloudFormationStackArtifact {
// always synthesize against the root (be it an App or whatever) so all artifacts will be included
const assembly = synthesizeApp(stack, options);
return assembly.getStackArtifact(stack.artifactId);
return stripNewStyleSynthCfnElements(assembly.getStackArtifact(stack.artifactId));
}

/**
* Synthesizes the stack and returns the resulting CloudFormation template.
*/
public static toCloudFormation(stack: core.Stack, options: core.SynthesisOptions = { }): any {
public static toCloudFormation(stack: core.Stack, options: core.StageSynthesisOptions = { }): any {
const synth = this._synthesizeWithNested(stack, options);
if (isStackArtifact(synth)) {
return synth.template;
Expand Down Expand Up @@ -48,7 +48,7 @@ export class SynthUtils {
* @return CloudFormationStackArtifact for normal stacks or the actual template for nested stacks
* @internal
*/
public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object {
public static _synthesizeWithNested(stack: core.Stack, options: core.StageSynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object {
// always synthesize against the root (be it an App or whatever) so all artifacts will be included
const assembly = synthesizeApp(stack, options);

Expand All @@ -57,14 +57,14 @@ export class SynthUtils {
return JSON.parse(fs.readFileSync(path.join(assembly.directory, stack.templateFile)).toString('utf-8'));
}

return assembly.getStackArtifact(stack.artifactId);
return stripNewStyleSynthCfnElements(assembly.getStackArtifact(stack.artifactId));
}
}

/**
* Synthesizes the app in which a stack resides and returns the cloud assembly object.
*/
function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) {
function synthesizeApp(stack: core.Stack, options: core.StageSynthesisOptions): cxapi.CloudAssembly {
const root = stack.node.root;
if (!core.Stage.isStage(root)) {
throw new Error('unexpected: all stacks must be part of a Stage or an App');
Expand All @@ -79,6 +79,23 @@ function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) {
});
}

function stripNewStyleSynthCfnElements(stackArtifact: cxapi.CloudFormationStackArtifact): cxapi.CloudFormationStackArtifact {
const synthesizedTemplate = stackArtifact.template;

// if new-style synthesis is not explicitly set, remove the extra generated Rule and Parameter from the synthesized template,
// to avoid changing many tests that rely on the template being exactly what it is
delete synthesizedTemplate?.Rules?.CheckBootstrapVersion;
if (Object.keys(synthesizedTemplate?.Rules ?? {}).length === 0) {
delete synthesizedTemplate?.Rules;
}
delete synthesizedTemplate?.Parameters?.BootstrapVersion;
if (Object.keys(synthesizedTemplate?.Parameters ?? {}).length === 0) {
delete synthesizedTemplate?.Parameters;
}

return stackArtifact;
}

export interface SubsetOptions {
/**
* Match all resources of the given type
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assert-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"@aws-cdk/cloudformation-diff": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"constructs": "^3.3.69"
"constructs": "^10.0.0"
},
"peerDependencies": {
"@aws-cdk/core": "0.0.0",
"constructs": "^3.3.69",
"constructs": "^10.0.0",
"jest": "^26.6.3"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert-internal/test/assertions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function failingExample(title: string, cb: () => void) {
}

function synthesizedStack(fn: (stack: cdk.Stack) => void): cx.CloudFormationStackArtifact {
const app = new cdk.App();
const app = new cdk.App({ context: { [cx.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: false } });
const stack = new cdk.Stack(app, 'TestStack');
fn(stack);

Expand Down
Loading

0 comments on commit 6dad25a

Please sign in to comment.