Skip to content

Commit

Permalink
Merge branch 'master' into docdb_autominor_version
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 9, 2020
2 parents f8f44cb + 9ff55ae commit a236eb8
Show file tree
Hide file tree
Showing 31 changed files with 993 additions and 286 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.57.0](https://github.com/aws/aws-cdk/compare/v1.56.0...v1.57.0) (2020-08-07)


### ⚠ BREAKING CHANGES

* **apigatewayv2:** The parameter for the method `bind()` on
`IHttpRouteIntegration` has changed to accept one of type
`HttpRouteIntegrationBindOptions`. The previous parameter
`IHttpRoute` is now a property inside the new parameter under
the key `route`.
* **eks:** The experimental `eks.Cluster` construct no longer supports setting `kubectlEnabled: false`. A temporary drop-in alternative is `eks.LegacyCluster`, but we have plans to completely remove support for it in an upcoming release since `eks.Cluster` has matured and should provide all the needed capabilities. Please comment on https://github.com/aws/aws-cdk/issues/9332 if there are use cases that are not supported by `eks.Cluster`.
* **eks:** endpoint access is configured to private and public by default instead of just public
* `lambda.Version` and `apigateway.Deployment` resources with auto-generated IDs will be replaced as we fixed a bug which ignored resource dependencies when generating these logical IDs.
* **core:** in unit tests, the `node.path` of constructs within stacks created the root of the tree via `new Stack()` will now have a prefix `Default/` which represents an implicit `App` root.

Related: https://github.com/aws/aws-cdk-rfcs/issues/192
* **cloudfront:** the property OriginBase.originId has been removed

### Features

* **apigateway:** additionalProperties in RestApi Model supports JsonSchema type ([#8848](https://github.com/aws/aws-cdk/issues/8848)) ([5e087e5](https://github.com/aws/aws-cdk/commit/5e087e5f3d59f931ceabebb290536a93b170522c)), closes [#8069](https://github.com/aws/aws-cdk/issues/8069)
* **apigateway:** configure endpoint types on SpecRestApi ([#9068](https://github.com/aws/aws-cdk/issues/9068)) ([7673e48](https://github.com/aws/aws-cdk/commit/7673e487e6358d1b345a138f016ac38b33315e4b)), closes [#9060](https://github.com/aws/aws-cdk/issues/9060)
* **apigateway:** import API keys ([#9155](https://github.com/aws/aws-cdk/issues/9155)) ([e3f6ae3](https://github.com/aws/aws-cdk/commit/e3f6ae3078799d3ff1c3a2f4a4ec19a82652b3e2)), closes [#8367](https://github.com/aws/aws-cdk/issues/8367)
* **appsync:** add x-ray parameter to AppSync ([#9389](https://github.com/aws/aws-cdk/issues/9389)) ([51921ad](https://github.com/aws/aws-cdk/commit/51921ade45840737f554dad066abfbbfc3b822b6))
* **cloudfront:** add support for Origin Groups ([#9360](https://github.com/aws/aws-cdk/issues/9360)) ([11e146c](https://github.com/aws/aws-cdk/commit/11e146cb330ae036920c5cc1ab74225c0775a695)), closes [#9109](https://github.com/aws/aws-cdk/issues/9109)
* **cloudfront:** Behaviors support cached methods, compression, viewer protocol, and smooth streaming ([#9411](https://github.com/aws/aws-cdk/issues/9411)) ([2451fa9](https://github.com/aws/aws-cdk/commit/2451fa96f6a623b0634ba249bf6cc2a38da1dbbf)), closes [#7086](https://github.com/aws/aws-cdk/issues/7086) [#9107](https://github.com/aws/aws-cdk/issues/9107)
* **core:** implicit app for root stacks ([#9342](https://github.com/aws/aws-cdk/issues/9342)) ([1d85a9f](https://github.com/aws/aws-cdk/commit/1d85a9f16c87f51440ffbddd854aa5410b69fac7))
* **core:** warn if an aspect was added via another aspect ([#8639](https://github.com/aws/aws-cdk/issues/8639)) ([9d7bef7](https://github.com/aws/aws-cdk/commit/9d7bef797f296c3e9f6f5dac6a4edf3139c2dfe2))
* **eks:** default masters role ([#9464](https://github.com/aws/aws-cdk/issues/9464)) ([b80c271](https://github.com/aws/aws-cdk/commit/b80c2718055a19a72955e457397d6e812a21e53e)), closes [#9463](https://github.com/aws/aws-cdk/issues/9463)
* **eks:** deprecate "kubectlEnabled: false" ([#9454](https://github.com/aws/aws-cdk/issues/9454)) ([2791017](https://github.com/aws/aws-cdk/commit/27910175560f4e354aebab86e338b6a9190db4a5)), closes [#9332](https://github.com/aws/aws-cdk/issues/9332)
* **eks:** endpoint access customization ([#9095](https://github.com/aws/aws-cdk/issues/9095)) ([692864c](https://github.com/aws/aws-cdk/commit/692864cf4659ba84fdec9d8a298c185679076d38)), closes [#5220](https://github.com/aws/aws-cdk/issues/5220) [/github.com/aws/aws-cdk/pull/9095#issuecomment-665621701](https://github.com/aws//github.com/aws/aws-cdk/pull/9095/issues/issuecomment-665621701)
* **s3:** Introduce S3 Inventory ([#9102](https://github.com/aws/aws-cdk/issues/9102)) ([b0f359e](https://github.com/aws/aws-cdk/commit/b0f359eee99c100e6d33e00388c1a4bffe7baa6c))


### Bug Fixes

* **apigatewayv2:** cyclic dependency between HttpApi and the lambda function ([#9100](https://github.com/aws/aws-cdk/issues/9100)) ([7b29774](https://github.com/aws/aws-cdk/commit/7b297749bbe5d75f29f1aeb2652d095e3f2630e1)), closes [#9075](https://github.com/aws/aws-cdk/issues/9075)
* **athena:** WorkGroup tags corruption ([#9085](https://github.com/aws/aws-cdk/issues/9085)) ([b688913](https://github.com/aws/aws-cdk/commit/b688913b7534867c4cb584e491bf6e89437b48d9)), closes [#6936](https://github.com/aws/aws-cdk/issues/6936)
* **aws-lambda-python:** use cp instead of rsync ([#9355](https://github.com/aws/aws-cdk/issues/9355)) ([056bcaf](https://github.com/aws/aws-cdk/commit/056bcafa99aa4b741bf1e1d075fe8ab188c99c34)), closes [#9349](https://github.com/aws/aws-cdk/issues/9349)
* **cfn-include:** fails to load SAM resources ([#9442](https://github.com/aws/aws-cdk/issues/9442)) ([1de9dc8](https://github.com/aws/aws-cdk/commit/1de9dc86a7990e8bd7c026bde59a02ecf0582616))
* **cfn-include:** no longer concatenate elements of Fn::Join without tokens ([#9476](https://github.com/aws/aws-cdk/issues/9476)) ([d038b61](https://github.com/aws/aws-cdk/commit/d038b61cd9b015b231911d4aaac131080b8b7b7c))
* **core:** can't have multiple CfnRules in a Stack ([#9500](https://github.com/aws/aws-cdk/issues/9500)) ([76a7bfd](https://github.com/aws/aws-cdk/commit/76a7bfdf95c48a8d924d9363da2913240a5326f9)), closes [#8251](https://github.com/aws/aws-cdk/issues/8251) [#9485](https://github.com/aws/aws-cdk/issues/9485)
* **core:** docs for CfnMapping are not clear ([#9451](https://github.com/aws/aws-cdk/issues/9451)) ([c1e3c57](https://github.com/aws/aws-cdk/commit/c1e3c575ba67c0bf6d9fbea443fb1c80bcce7d67)), closes [#9432](https://github.com/aws/aws-cdk/issues/9432)
* **dynamodb:** allow using PhysicalName.GENERATE_IF_NEEDED as the Table name ([#9377](https://github.com/aws/aws-cdk/issues/9377)) ([8ab7b10](https://github.com/aws/aws-cdk/commit/8ab7b1062416adce1f2423c558bd3bfd714c5590)), closes [#9374](https://github.com/aws/aws-cdk/issues/9374)
* **ecs:** Scope-down IAM permissions for ECS drain ([#9502](https://github.com/aws/aws-cdk/issues/9502)) ([9fbeec3](https://github.com/aws/aws-cdk/commit/9fbeec3d7fe73ec870fe2de0e122b7714165f70e))
* **ecs:** Scope-down IAM permissions on Cluster ASG ([#9493](https://github.com/aws/aws-cdk/issues/9493)) ([1670289](https://github.com/aws/aws-cdk/commit/16702898feacfe4f8c5ec323205362d6a0e36a97))
* **ecs-patterns:** Adds missing option to secure ingress of ALB in Ap… ([#9434](https://github.com/aws/aws-cdk/issues/9434)) ([ba1427f](https://github.com/aws/aws-cdk/commit/ba1427f8510bc5c123012f6cfa1ca55d456efba7))
* **lambda:** bundling docker image does not exist for Go runtime ([#9465](https://github.com/aws/aws-cdk/issues/9465)) ([7666d9b](https://github.com/aws/aws-cdk/commit/7666d9ba6b9a1212796636840fb7a1dffe41e4f3)), closes [#9435](https://github.com/aws/aws-cdk/issues/9435)


* **cloudfront:** remove the originId property from OriginBase ([#9380](https://github.com/aws/aws-cdk/issues/9380)) ([70b9f63](https://github.com/aws/aws-cdk/commit/70b9f63fa979c8c1d74ecdbd1f3c5bd248c5715f))
* do not use "synthesize" and "prepare" in the cdk ([#9410](https://github.com/aws/aws-cdk/issues/9410)) ([e3ae645](https://github.com/aws/aws-cdk/commit/e3ae645f636a9f08566435799b7f55d50f5298bb)), closes [/github.com/aws/aws-cdk/pull/9410#issuecomment-668552361](https://github.com/aws//github.com/aws/aws-cdk/pull/9410/issues/issuecomment-668552361)

## [1.56.0](https://github.com/aws/aws-cdk/compare/v1.55.0...v1.56.0) (2020-07-31)


Expand Down
3 changes: 3 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ removed:@aws-cdk/cdk-assets-schema.FileDestination
removed:@aws-cdk/cdk-assets-schema.FileSource
removed:@aws-cdk/cdk-assets-schema.ManifestFile
removed:@aws-cdk/cdk-assets-schema.FileAssetPackaging

changed-type:@aws-cdk/aws-codedeploy.IServerDeploymentGroup.autoScalingGroups
changed-type:@aws-cdk/aws-codedeploy.ServerDeploymentGroup.autoScalingGroups
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.56.0"
"version": "1.57.0"
}
31 changes: 23 additions & 8 deletions packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou

public abstract autoScalingGroupName: string;
public abstract autoScalingGroupArn: string;
public abstract readonly osType: ec2.OperatingSystemType;
protected albTargetGroup?: elbv2.ApplicationTargetGroup;
public readonly grantPrincipal: iam.IPrincipal = new iam.UnknownPrincipal({ resource: this });

/**
* Send a message to either an SQS queue or SNS topic when instances launch or terminate
Expand Down Expand Up @@ -490,6 +492,10 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou
public scaleOnMetric(id: string, props: BasicStepScalingPolicyProps): StepScalingPolicy {
return new StepScalingPolicy(this, id, { ...props, autoScalingGroup: this });
}

public addUserData(..._commands: string[]): void {
// do nothing
}
}

/**
Expand All @@ -508,8 +514,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
elb.ILoadBalancerTarget,
ec2.IConnectable,
elbv2.IApplicationLoadBalancerTarget,
elbv2.INetworkLoadBalancerTarget,
iam.IGrantable {
elbv2.INetworkLoadBalancerTarget {

public static fromAutoScalingGroupName(scope: Construct, id: string, autoScalingGroupName: string): IAutoScalingGroup {
class Import extends AutoScalingGroupBase {
Expand All @@ -519,6 +524,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
resource: 'autoScalingGroup:*:autoScalingGroupName',
resourceName: this.autoScalingGroupName,
});
public readonly osType = ec2.OperatingSystemType.UNKNOWN;
}

return new Import(scope, id);
Expand Down Expand Up @@ -760,11 +766,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
return { targetType: elbv2.TargetType.INSTANCE };
}

/**
* Add command to the startup script of fleet instances.
* The command must be in the scripting language supported by the fleet's OS (i.e. Linux/Windows).
*/
public addUserData(...commands: string[]) {
public addUserData(...commands: string[]): void {
this.userData.addCommands(...commands);
}

Expand Down Expand Up @@ -1121,7 +1123,7 @@ function validatePercentage(x?: number): number | undefined {
/**
* An AutoScalingGroup
*/
export interface IAutoScalingGroup extends IResource {
export interface IAutoScalingGroup extends IResource, iam.IGrantable {
/**
* The name of the AutoScalingGroup
* @attribute
Expand All @@ -1134,6 +1136,19 @@ export interface IAutoScalingGroup extends IResource {
*/
readonly autoScalingGroupArn: string;

/**
* The operating system family that the instances in this auto-scaling group belong to.
* Is 'UNKNOWN' for imported ASGs.
*/
readonly osType: ec2.OperatingSystemType;

/**
* Add command to the startup script of fleet instances.
* The command must be in the scripting language supported by the fleet's OS (i.e. Linux/Windows).
* Does nothing for imported ASGs.
*/
addUserData(...commands: string[]): void;

/**
* Send a message to either an SQS queue or SNS topic when instances launch or terminate
*/
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface IServerDeploymentGroup extends cdk.IResource {
*/
readonly deploymentGroupArn: string;
readonly deploymentConfig: IServerDeploymentConfig;
readonly autoScalingGroups?: autoscaling.AutoScalingGroup[];
readonly autoScalingGroups?: autoscaling.IAutoScalingGroup[];
}

/**
Expand Down Expand Up @@ -69,7 +69,7 @@ abstract class ServerDeploymentGroupBase extends cdk.Resource implements IServer
public abstract readonly deploymentGroupName: string;
public abstract readonly deploymentGroupArn: string;
public readonly deploymentConfig: IServerDeploymentConfig;
public abstract readonly autoScalingGroups?: autoscaling.AutoScalingGroup[];
public abstract readonly autoScalingGroups?: autoscaling.IAutoScalingGroup[];

constructor(scope: cdk.Construct, id: string, deploymentConfig?: IServerDeploymentConfig, props?: cdk.ResourceProps) {
super(scope, id, props);
Expand Down Expand Up @@ -171,7 +171,7 @@ export interface ServerDeploymentGroupProps {
*
* @default []
*/
readonly autoScalingGroups?: autoscaling.AutoScalingGroup[];
readonly autoScalingGroups?: autoscaling.IAutoScalingGroup[];

/**
* If you've provided any auto-scaling groups with the {@link #autoScalingGroups} property,
Expand Down Expand Up @@ -258,7 +258,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
public readonly deploymentGroupArn: string;
public readonly deploymentGroupName: string;

private readonly _autoScalingGroups: autoscaling.AutoScalingGroup[];
private readonly _autoScalingGroups: autoscaling.IAutoScalingGroup[];
private readonly installAgent: boolean;
private readonly codeDeployBucket: s3.IBucket;
private readonly alarms: cloudwatch.IAlarm[];
Expand Down Expand Up @@ -333,16 +333,16 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
this.alarms.push(alarm);
}

public get autoScalingGroups(): autoscaling.AutoScalingGroup[] | undefined {
public get autoScalingGroups(): autoscaling.IAutoScalingGroup[] | undefined {
return this._autoScalingGroups.slice();
}

private addCodeDeployAgentInstallUserData(asg: autoscaling.AutoScalingGroup): void {
private addCodeDeployAgentInstallUserData(asg: autoscaling.IAutoScalingGroup): void {
if (!this.installAgent) {
return;
}

this.codeDeployBucket.grantRead(asg.role, 'latest/*');
this.codeDeployBucket.grantRead(asg, 'latest/*');

switch (asg.osType) {
case ec2.OperatingSystemType.LINUX:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class CodeDeployServerDeployAction extends Action {

// grant the ASG Role permissions to read from the Pipeline Bucket
for (const asg of this.deploymentGroup.autoScalingGroups || []) {
options.bucket.grantRead(asg.role);
options.bucket.grantRead(asg);
}

// the Action's Role needs to read from the Bucket to get artifacts
Expand Down
Loading

0 comments on commit a236eb8

Please sign in to comment.