Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs_patterns): Enable enableExecutecommand as default #20047

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ export interface ApplicationLoadBalancedEc2ServiceProps extends ApplicationLoadB
* @default - No strategies.
*/
readonly placementStrategies?: PlacementStrategy[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -94,13 +101,19 @@ export class ApplicationLoadBalancedEc2Service extends ApplicationLoadBalancedSe
* The EC2 Task Definition in this construct.
*/
public readonly taskDefinition: Ec2TaskDefinition;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the ApplicationLoadBalancedEc2Service class.
*/
constructor(scope: Construct, id: string, props: ApplicationLoadBalancedEc2ServiceProps = {}) {
super(scope, id, props);

this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify either a taskDefinition or taskImageOptions, not both.');
} else if (props.taskDefinition) {
Expand Down Expand Up @@ -141,6 +154,7 @@ export class ApplicationLoadBalancedEc2Service extends ApplicationLoadBalancedSe
cluster: this.cluster,
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
enableExecuteCommand: this.enableExecuteCommand,
assignPublicIp: false,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ export interface ApplicationMultipleTargetGroupsEc2ServiceProps extends Applicat
* @default - No strategies.
*/
readonly placementStrategies?: PlacementStrategy[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -93,13 +100,19 @@ export class ApplicationMultipleTargetGroupsEc2Service extends ApplicationMultip
* The default target group for the service.
*/
public readonly targetGroup: ApplicationTargetGroup;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the ApplicationMultipleTargetGroupsEc2Service class.
*/
constructor(scope: Construct, id: string, props: ApplicationMultipleTargetGroupsEc2ServiceProps = {}) {
super(scope, id, props);

this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify only one of TaskDefinition or TaskImageOptions.');
} else if (props.taskDefinition) {
Expand Down Expand Up @@ -160,6 +173,7 @@ export class ApplicationMultipleTargetGroupsEc2Service extends ApplicationMultip
cluster: this.cluster,
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
enableExecuteCommand: this.enableExecuteCommand,
assignPublicIp: false,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ export interface NetworkLoadBalancedEc2ServiceProps extends NetworkLoadBalancedS
* @default - No strategies.
*/
readonly placementStrategies?: PlacementStrategy[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -92,13 +99,19 @@ export class NetworkLoadBalancedEc2Service extends NetworkLoadBalancedServiceBas
* The EC2 Task Definition in this construct.
*/
public readonly taskDefinition: Ec2TaskDefinition;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the NetworkLoadBalancedEc2Service class.
*/
constructor(scope: Construct, id: string, props: NetworkLoadBalancedEc2ServiceProps = {}) {
super(scope, id, props);

this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify either a taskDefinition or an image, not both.');
} else if (props.taskDefinition) {
Expand Down Expand Up @@ -139,6 +152,7 @@ export class NetworkLoadBalancedEc2Service extends NetworkLoadBalancedServiceBas
cluster: this.cluster,
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
enableExecuteCommand: this.enableExecuteCommand,
assignPublicIp: false,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ export interface NetworkMultipleTargetGroupsEc2ServiceProps extends NetworkMulti
* @default - No strategies.
*/
readonly placementStrategies?: PlacementStrategy[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -92,13 +99,19 @@ export class NetworkMultipleTargetGroupsEc2Service extends NetworkMultipleTarget
* The default target group for the service.
*/
public readonly targetGroup: NetworkTargetGroup;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the NetworkMultipleTargetGroupsEc2Service class.
*/
constructor(scope: Construct, id: string, props: NetworkMultipleTargetGroupsEc2ServiceProps = {}) {
super(scope, id, props);

this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify only one of TaskDefinition or TaskImageOptions.');
} else if (props.taskDefinition) {
Expand Down Expand Up @@ -160,6 +173,7 @@ export class NetworkMultipleTargetGroupsEc2Service extends NetworkMultipleTarget
cluster: this.cluster,
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
enableExecuteCommand: this.enableExecuteCommand,
assignPublicIp: false,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ export interface QueueProcessingEc2ServiceProps extends QueueProcessingServiceBa
* @default - No strategies.
*/
readonly placementStrategies?: PlacementStrategy[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -98,6 +105,10 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase {
* The EC2 task definition in this construct
*/
public readonly taskDefinition: Ec2TaskDefinition;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the QueueProcessingEc2Service class.
Expand All @@ -106,6 +117,7 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase {
super(scope, id, props);

const containerName = props.containerName ?? 'QueueProcessingContainer';
this.enableExecuteCommand = props.enableExecuteCommand ?? true;

// Create a Task Definition for the container to start
this.taskDefinition = new Ec2TaskDefinition(this, 'QueueProcessingTaskDef', {
Expand All @@ -132,6 +144,7 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase {
cluster: this.cluster,
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
enableExecuteCommand: this.enableExecuteCommand,
serviceName: props.serviceName,
minHealthyPercent: props.minHealthyPercent,
maxHealthyPercent: props.maxHealthyPercent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export interface ApplicationLoadBalancedFargateServiceProps extends ApplicationL
* @default - A new security group is created.
*/
readonly securityGroups?: ISecurityGroup[];

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -111,6 +118,10 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc
* The Fargate task definition in this construct.
*/
public readonly taskDefinition: FargateTaskDefinition;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the ApplicationLoadBalancedFargateService class.
Expand All @@ -119,6 +130,7 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc
super(scope, id, props);

this.assignPublicIp = props.assignPublicIp ?? false;
this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify either a taskDefinition or an image, not both.');
Expand Down Expand Up @@ -162,6 +174,7 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
assignPublicIp: this.assignPublicIp,
enableExecuteCommand: this.enableExecuteCommand,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
minHealthyPercent: props.minHealthyPercent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export interface ApplicationMultipleTargetGroupsFargateServiceProps extends Appl
* @default Latest
*/
readonly platformVersion?: FargatePlatformVersion;

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -107,6 +114,10 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu
* The default target group for the service.
*/
public readonly targetGroup: ApplicationTargetGroup;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the ApplicationMultipleTargetGroupsFargateService class.
Expand All @@ -115,6 +126,7 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu
super(scope, id, props);

this.assignPublicIp = props.assignPublicIp ?? false;
this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify only one of TaskDefinition or TaskImageOptions.');
Expand Down Expand Up @@ -177,6 +189,7 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
assignPublicIp: this.assignPublicIp,
enableExecuteCommand: this.enableExecuteCommand,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
propagateTags: props.propagateTags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ export interface NetworkLoadBalancedFargateServiceProps extends NetworkLoadBalan
* @default Latest
*/
readonly platformVersion?: FargatePlatformVersion;

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand All @@ -100,6 +107,10 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic
* The Fargate task definition in this construct.
*/
public readonly taskDefinition: FargateTaskDefinition;
/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the NetworkLoadBalancedFargateService class.
Expand All @@ -108,6 +119,7 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic
super(scope, id, props);

this.assignPublicIp = props.assignPublicIp ?? false;
this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify either a taskDefinition or an image, not both.');
Expand Down Expand Up @@ -149,6 +161,7 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
assignPublicIp: this.assignPublicIp,
enableExecuteCommand: this.enableExecuteCommand,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
minHealthyPercent: props.minHealthyPercent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export interface NetworkMultipleTargetGroupsFargateServiceProps extends NetworkM
* @default Latest
*/
readonly platformVersion?: FargatePlatformVersion;

/**
* Whether to enable the ability to execute into a container.
*
* @default true
*/
readonly enableExecuteCommand?: boolean;
}

/**
Expand Down Expand Up @@ -108,13 +115,19 @@ export class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTa
*/
public readonly targetGroup: NetworkTargetGroup;

/**
* Whether enableExecuteCommand is enabled.
*/
public readonly enableExecuteCommand: boolean;

/**
* Constructs a new instance of the NetworkMultipleTargetGroupsFargateService class.
*/
constructor(scope: Construct, id: string, props: NetworkMultipleTargetGroupsFargateServiceProps = {}) {
super(scope, id, props);

this.assignPublicIp = props.assignPublicIp ?? false;
this.enableExecuteCommand = props.enableExecuteCommand ?? true;

if (props.taskDefinition && props.taskImageOptions) {
throw new Error('You must specify only one of TaskDefinition or TaskImageOptions.');
Expand Down Expand Up @@ -177,6 +190,7 @@ export class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTa
desiredCount: desiredCount,
taskDefinition: this.taskDefinition,
assignPublicIp: this.assignPublicIp,
enableExecuteCommand: this.enableExecuteCommand,
serviceName: props.serviceName,
healthCheckGracePeriod: props.healthCheckGracePeriod,
propagateTags: props.propagateTags,
Expand Down
Loading