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

fix(ecs): outdated linux commands for canContainersAccessInstanceRole=false and also deprecate property #32763

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -8,6 +8,8 @@ import * as ecsPatterns from 'aws-cdk-lib/aws-ecs-patterns';
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': true,
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-alb-ec2-cmd-entrypoint');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha';
import { ApplicationLoadBalancedEc2Service } from 'aws-cdk-lib/aws-ecs-patterns';
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-alb');
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const cluster = new Cluster(stack, 'Cluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha';

import { ApplicationMultipleTargetGroupsEc2Service } from 'aws-cdk-lib/aws-ecs-patterns';

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-multiple-alb-healthchecks');
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const cluster = new Cluster(stack, 'Cluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { App, Stack } from 'aws-cdk-lib';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
import { NetworkMultipleTargetGroupsEc2Service } from 'aws-cdk-lib/aws-ecs-patterns';

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-nlb-healthchecks');
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const cluster = new Cluster(stack, 'Cluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': false,
'@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions': false,
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-alb-idle-timeout');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const app = new App({
postCliContext: {
[AUTOSCALING_GENERATE_LAUNCH_TEMPLATE]: false,
[REDUCE_EC2_FARGATE_CLOUDWATCH_PERMISSIONS]: false,
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-multiple-alb');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha';
import { NetworkLoadBalancedEc2Service } from 'aws-cdk-lib/aws-ecs-patterns';
import { IpAddressType } from 'aws-cdk-lib/aws-elasticloadbalancingv2';

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'aws-ecs-integ-nlb');
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const cluster = new Cluster(stack, 'Cluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import * as cdk from 'aws-cdk-lib';
import * as integ from '@aws-cdk/integ-tests-alpha';
import { ScheduledEc2Task } from 'aws-cdk-lib/aws-ecs-patterns';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});

class EventStack extends cdk.Stack {
constructor(scope: cdk.App, id: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import { Certificate } from 'aws-cdk-lib/aws-certificatemanager';
const certArn = process.env.CDK_INTEG_CERT_ARN || process.env.CERT_ARN;
if (!certArn) throw new Error('For this test you must provide your own Certificate as an env var "CERT_ARN". See framework-integ/README.md for details.');

const app = new App();
const app = new App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new Stack(app, 'tls-network-load-balanced-ecs-service');
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 });
const cluster = new Cluster(stack, 'Cluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-appmesh-proxy');

// Create a cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as integ from '@aws-cdk/integ-tests-alpha';
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm': true,
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'integ-ec2-capacity-provider-managed-draining');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'integ-ec2-capacity-provider');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as elb from 'aws-cdk-lib/aws-elasticloadbalancing';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as cloudmap from 'aws-cdk-lib/aws-servicediscovery';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');
const vpc = new ec2.Vpc(stack, 'Vpc', {
restrictDefaultSecurityGroup: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import * as cdk from 'aws-cdk-lib';
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'integ-default-capacity-provider');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import * as cdk from 'aws-cdk-lib';
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'integ-deployment-alarms');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import * as ecs from 'aws-cdk-lib/aws-ecs';
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions': true,
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-enable-execute-command');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');

// S3 bucket to host envfile without public access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-exec-command');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import * as s3_assets from 'aws-cdk-lib/aws-s3-assets';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { Construct } from 'constructs';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});

// WHEN
class EcsStack extends cdk.Stack {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});

class EcsStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as cdk from 'aws-cdk-lib';
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-pseudo-terminal');

// Create a cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib';
import * as ecs from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ-spot');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import * as integ from '@aws-cdk/integ-tests-alpha';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import { LinuxParameters } from 'aws-cdk-lib/aws-ecs';

const app = new cdk.App();
const app = new cdk.App({
postCliContext: {
'@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature': false,
'@aws-cdk/aws-ecs:disableEcsImdsBlocking': false,
},
});
const stack = new cdk.Stack(app, 'aws-ecs-integ');

const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false });
Expand Down
Loading
Loading