Skip to content

Commit

Permalink
chore(release): 2.57.0 (#23474)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 27, 2022
2 parents 9329a73 + a1370a0 commit 85e2735
Show file tree
Hide file tree
Showing 289 changed files with 6,027 additions and 841 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.

## [2.57.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.56.1-alpha.0...v2.57.0-alpha.0) (2022-12-27)


### Bug Fixes

* **aws-redshift:** Columns are not dropped on removal from array ([#23011](https://github.com/aws/aws-cdk/issues/23011)) ([2981313](https://github.com/aws/aws-cdk/commit/298131312b513c0e73865e6fff74c189ee99e328)), closes [#22208](https://github.com/aws/aws-cdk/issues/22208)

## [2.56.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.56.0-alpha.0...v2.56.1-alpha.0) (2022-12-23)

## [2.56.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.55.1-alpha.0...v2.56.0-alpha.0) (2022-12-21)
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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.

## [2.57.0](https://github.com/aws/aws-cdk/compare/v2.56.1...v2.57.0) (2022-12-27)


### Features

* **cfnspec:** cloudformation spec v103.0.0 ([#23452](https://github.com/aws/aws-cdk/issues/23452)) ([e49e57d](https://github.com/aws/aws-cdk/commit/e49e57d3106f62c5d64c428cba73b4107d664cba))
* **lambda:** add support for auto-instrumentation with ADOT Lambda layer ([#23027](https://github.com/aws/aws-cdk/issues/23027)) ([fc70535](https://github.com/aws/aws-cdk/commit/fc70535fe699e72332d5ddb4543308e76a89594a))


### Bug Fixes

* **cfnspec:** v101.0.0 introduced specific types on several types that previously were typed as json ([#23448](https://github.com/aws/aws-cdk/issues/23448)) ([4fbc182](https://github.com/aws/aws-cdk/commit/4fbc1827b8978262da0b5b77b1ee9bc0ecfdcc3e))
* **codedeploy:** referenced Applications are not environment-aware ([#23405](https://github.com/aws/aws-cdk/issues/23405)) ([96242d7](https://github.com/aws/aws-cdk/commit/96242d73c0ae853524a567aece86f8a8a514495c))
* **s3:** buckets with SSE-KMS silently fail to receive logs ([#23385](https://github.com/aws/aws-cdk/issues/23385)) ([1b7a384](https://github.com/aws/aws-cdk/commit/1b7a384c330d168d64c0cd82118e5b5473d08a67))

## [2.56.1](https://github.com/aws/aws-cdk/compare/v2.56.0...v2.56.1) (2022-12-23)


Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigatewayv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
const domainName = 'example.com';

const dn = new apigwv2.DomainName(this, 'DN', {
domainName,
domainName: domainName,
certificate: acm.Certificate.fromCertificateArn(this, 'cert', certArn),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ArnFormat, Resource, Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnDeploymentConfig } from './codedeploy.generated';
import { MinimumHealthyHosts } from './host-health-config';
import { arnForDeploymentConfig, validateName } from './private/utils';
import { TrafficRouting } from './traffic-routing-config';
import { arnForDeploymentConfig, validateName } from './utils';

/**
* The base class for ServerDeploymentConfig, EcsDeploymentConfig,
Expand Down
26 changes: 22 additions & 4 deletions packages/@aws-cdk/aws-codedeploy/lib/ecs/application.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArnFormat, IResource, Resource } from '@aws-cdk/core';
import { ArnFormat, IResource, Resource, Stack, Arn } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnApplication } from '../codedeploy.generated';
import { arnForApplication, validateName } from '../utils';
import { arnForApplication, validateName } from '../private/utils';

/**
* Represents a reference to a CodeDeploy Application deploying to Amazon ECS.
Expand Down Expand Up @@ -42,20 +42,38 @@ export class EcsApplication extends Resource implements IEcsApplication {
/**
* Import an Application defined either outside the CDK, or in a different CDK Stack.
*
* The Application's account and region are assumed to be the same as the stack it is being imported
* into. If not, use `fromEcsApplicationArn`.
*
* @param scope the parent Construct for this new Construct
* @param id the logical ID of this new Construct
* @param ecsApplicationName the name of the application to import
* @returns a Construct representing a reference to an existing Application
*/
public static fromEcsApplicationName(scope: Construct, id: string, ecsApplicationName: string): IEcsApplication {
class Import extends Resource implements IEcsApplication {
public applicationArn = arnForApplication(ecsApplicationName);
public applicationArn = arnForApplication(Stack.of(scope), ecsApplicationName);
public applicationName = ecsApplicationName;
}

return new Import(scope, id);
}

/**
* Import an Application defined either outside the CDK, or in a different CDK Stack, by ARN.
*
* @param scope the parent Construct for this new Construct
* @param id the logical ID of this new Construct
* @param ecsApplicationArn the ARN of the application to import
* @returns a Construct representing a reference to an existing Application
*/
public static fromEcsApplicationArn(scope: Construct, id: string, ecsApplicationArn: string): IEcsApplication {
return new class extends Resource implements IEcsApplication {
public applicationArn = ecsApplicationArn;
public applicationName = Arn.split(ecsApplicationArn, ArnFormat.COLON_RESOURCE_NAME).resourceName ?? '<invalid arn>';
} (scope, id, { environmentFromArn: ecsApplicationArn });
}

public readonly applicationArn: string;
public readonly applicationName: string;

Expand All @@ -70,7 +88,7 @@ export class EcsApplication extends Resource implements IEcsApplication {
});

this.applicationName = this.getResourceNameAttribute(resource.ref);
this.applicationArn = this.getResourceArnAttribute(arnForApplication(resource.ref), {
this.applicationArn = this.getResourceArnAttribute(arnForApplication(Stack.of(scope), resource.ref), {
service: 'codedeploy',
resource: 'application',
resourceName: this.physicalName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Construct } from 'constructs';
import { BaseDeploymentConfig, BaseDeploymentConfigOptions, ComputePlatform, IBaseDeploymentConfig } from '../base-deployment-config';
import { deploymentConfig } from '../private/utils';
import { TrafficRouting } from '../traffic-routing-config';
import { deploymentConfig } from '../utils';

/**
* The Deployment Configuration of an ECS Deployment Group.
Expand Down
44 changes: 18 additions & 26 deletions packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnDeploymentGroup } from '../codedeploy.generated';
import { ImportedDeploymentGroupBase, DeploymentGroupBase } from '../private/base-deployment-group';
import { renderAlarmConfiguration, renderAutoRollbackConfiguration } from '../private/utils';
import { AutoRollbackConfig } from '../rollback-config';
import { arnForDeploymentGroup, renderAlarmConfiguration, renderAutoRollbackConfiguration, validateName } from '../utils';
import { IEcsApplication, EcsApplication } from './application';
import { EcsDeploymentConfig, IEcsDeploymentConfig } from './deployment-config';

Expand Down Expand Up @@ -182,9 +183,11 @@ export interface EcsDeploymentGroupProps {
* A CodeDeploy deployment group that orchestrates ECS blue-green deployments.
* @resource AWS::CodeDeploy::DeploymentGroup
*/
export class EcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentGroup {
export class EcsDeploymentGroup extends DeploymentGroupBase implements IEcsDeploymentGroup {
/**
* Import an ECS Deployment Group defined outside the CDK app.
* Reference an ECS Deployment Group defined outside the CDK app.
*
* Account and region for the DeploymentGroup are taken from the application.
*
* @param scope the parent Construct for this new Construct
* @param id the logical ID of this new Construct
Expand All @@ -199,8 +202,6 @@ export class EcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentGr
}

public readonly application: IEcsApplication;
public readonly deploymentGroupName: string;
public readonly deploymentGroupArn: string;
public readonly deploymentConfig: IEcsDeploymentConfig;
/**
* The service Role of this Deployment Group.
Expand All @@ -211,16 +212,15 @@ export class EcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentGr

constructor(scope: Construct, id: string, props: EcsDeploymentGroupProps) {
super(scope, id, {
physicalName: props.deploymentGroupName,
deploymentGroupName: props.deploymentGroupName,
role: props.role,
roleConstructId: 'ServiceRole',
});
this.role = this._role;

this.application = props.application || new EcsApplication(this, 'Application');
this.alarms = props.alarms || [];

this.role = props.role || new iam.Role(this, 'ServiceRole', {
assumedBy: new iam.ServicePrincipal('codedeploy.amazonaws.com'),
});

this.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AWSCodeDeployRoleForECS'));
this.deploymentConfig = props.deploymentConfig || EcsDeploymentConfig.ALL_AT_ONCE;

Expand Down Expand Up @@ -261,21 +261,13 @@ export class EcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentGr
autoRollbackConfiguration: cdk.Lazy.any({ produce: () => renderAutoRollbackConfiguration(this.alarms, props.autoRollback) }),
});

this.deploymentGroupName = this.getResourceNameAttribute(resource.ref);
this.deploymentGroupArn = this.getResourceArnAttribute(arnForDeploymentGroup(this.application.applicationName, resource.ref), {
service: 'codedeploy',
resource: 'deploymentgroup',
resourceName: `${this.application.applicationName}/${this.physicalName}`,
arnFormat: cdk.ArnFormat.COLON_RESOURCE_NAME,
});
this._setNameAndArn(resource, this.application);

// If the deployment config is a construct, add a dependency to ensure the deployment config
// is created before the deployment group is.
if (Construct.isConstruct(this.deploymentConfig)) {
this.node.addDependency(this.deploymentConfig);
}

this.node.addValidation({ validate: () => validateName('Deployment group', this.physicalName) });
}

/**
Expand Down Expand Up @@ -355,17 +347,17 @@ export interface EcsDeploymentGroupAttributes {
readonly deploymentConfig?: IEcsDeploymentConfig;
}

class ImportedEcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentGroup {
class ImportedEcsDeploymentGroup extends ImportedDeploymentGroupBase implements IEcsDeploymentGroup {
public readonly application: IEcsApplication;
public readonly deploymentGroupName: string;
public readonly deploymentGroupArn: string;
public readonly deploymentConfig: IEcsDeploymentConfig;

constructor(scope:Construct, id: string, props: EcsDeploymentGroupAttributes) {
super(scope, id);
constructor(scope: Construct, id: string, props: EcsDeploymentGroupAttributes) {
super(scope, id, {
application: props.application,
deploymentGroupName: props.deploymentGroupName,
});

this.application = props.application;
this.deploymentGroupName = props.deploymentGroupName;
this.deploymentGroupArn = arnForDeploymentGroup(props.application.applicationName, props.deploymentGroupName);
this.deploymentConfig = props.deploymentConfig || EcsDeploymentConfig.ALL_AT_ONCE;
}
}
26 changes: 22 additions & 4 deletions packages/@aws-cdk/aws-codedeploy/lib/lambda/application.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArnFormat, IResource, Resource } from '@aws-cdk/core';
import { ArnFormat, IResource, Resource, Stack, Arn } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnApplication } from '../codedeploy.generated';
import { arnForApplication, validateName } from '../utils';
import { arnForApplication, validateName } from '../private/utils';

/**
* Represents a reference to a CodeDeploy Application deploying to AWS Lambda.
Expand Down Expand Up @@ -42,20 +42,38 @@ export class LambdaApplication extends Resource implements ILambdaApplication {
/**
* Import an Application defined either outside the CDK, or in a different CDK Stack.
*
* The Application's account and region are assumed to be the same as the stack it is being imported
* into. If not, use `fromLambdaApplicationArn`.
*
* @param scope the parent Construct for this new Construct
* @param id the logical ID of this new Construct
* @param lambdaApplicationName the name of the application to import
* @returns a Construct representing a reference to an existing Application
*/
public static fromLambdaApplicationName(scope: Construct, id: string, lambdaApplicationName: string): ILambdaApplication {
class Import extends Resource implements ILambdaApplication {
public applicationArn = arnForApplication(lambdaApplicationName);
public applicationArn = arnForApplication(Stack.of(scope), lambdaApplicationName);
public applicationName = lambdaApplicationName;
}

return new Import(scope, id);
}

/**
* Import an Application defined either outside the CDK, or in a different CDK Stack, by ARN.
*
* @param scope the parent Construct for this new Construct
* @param id the logical ID of this new Construct
* @param lambdaApplicationArn the ARN of the application to import
* @returns a Construct representing a reference to an existing Application
*/
public static fromLambdaApplicationArn(scope: Construct, id: string, lambdaApplicationArn: string): ILambdaApplication {
return new class extends Resource implements ILambdaApplication {
public applicationArn = lambdaApplicationArn;
public applicationName = Arn.split(lambdaApplicationArn, ArnFormat.COLON_RESOURCE_NAME).resourceName ?? '<invalid arn>';
}(scope, id, { environmentFromArn: lambdaApplicationArn });
}

public readonly applicationArn: string;
public readonly applicationName: string;

Expand All @@ -70,7 +88,7 @@ export class LambdaApplication extends Resource implements ILambdaApplication {
});

this.applicationName = this.getResourceNameAttribute(resource.ref);
this.applicationArn = this.getResourceArnAttribute(arnForApplication(resource.ref), {
this.applicationArn = this.getResourceArnAttribute(arnForApplication(Stack.of(this), resource.ref), {
service: 'codedeploy',
resource: 'application',
resourceName: this.physicalName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Duration, Names, Resource } from '@aws-cdk/core';
import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from '@aws-cdk/custom-resources';
import { Construct } from 'constructs';
import { arnForDeploymentConfig, validateName } from '../utils';
import { arnForDeploymentConfig, validateName } from '../private/utils';
import { ILambdaDeploymentConfig } from './deployment-config';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Construct } from 'constructs';
import { BaseDeploymentConfig, BaseDeploymentConfigOptions, ComputePlatform, IBaseDeploymentConfig } from '../base-deployment-config';
import { deploymentConfig } from '../private/utils';
import { TrafficRouting } from '../traffic-routing-config';
import { deploymentConfig } from '../utils';

/**
* The Deployment Configuration of a Lambda Deployment Group.
Expand Down
Loading

0 comments on commit 85e2735

Please sign in to comment.