Skip to content

Commit 33cc68b

Browse files
committed
refactor: EcsDeploymentConfiguration extends Resource and implements IEcsDeploymentConfig
1 parent b3a05a9 commit 33cc68b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/cdk-blue-green-container-deployment/src/ecs-deployment-configuration.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IEcsDeploymentConfig, CfnDeploymentConfig } from '@aws-cdk/aws-codedeploy';
22

3-
import { Aws, Construct, IResolvable } from '@aws-cdk/core';
3+
import { Aws, Construct, IResolvable, Resource } from '@aws-cdk/core';
44

55
export interface EcsDeploymentConfigurationProps {
66
/**
@@ -26,8 +26,9 @@ export interface EcsDeploymentConfigurationProps {
2626
readonly trafficRoutingConfig?: CfnDeploymentConfig.TrafficRoutingConfigProperty | IResolvable;
2727
}
2828

29-
export class EcsDeploymentConfiguration extends Construct {
30-
readonly deploymentConfig: IEcsDeploymentConfig;
29+
export class EcsDeploymentConfiguration extends Resource implements IEcsDeploymentConfig {
30+
readonly deploymentConfigName: string;
31+
readonly deploymentConfigArn: string;
3132

3233
constructor(scope: Construct, id: string, props: EcsDeploymentConfigurationProps) {
3334
super(scope, id);
@@ -39,10 +40,8 @@ export class EcsDeploymentConfiguration extends Construct {
3940

4041
const deployConfigurationName = props.deploymentConfigName ?? cfnDeploymentConfig.ref;
4142

42-
this.deploymentConfig = {
43-
deploymentConfigName: deployConfigurationName,
44-
deploymentConfigArn: this.arnForDeploymentConfig(deployConfigurationName),
45-
};
43+
this.deploymentConfigName = deployConfigurationName;
44+
this.deploymentConfigArn = this.arnForDeploymentConfig(deployConfigurationName);
4645
}
4746

4847
private arnForDeploymentConfig(deploymentConfigurationName: string): string {

0 commit comments

Comments
 (0)