question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-ecs): adding cluster config disables container insights

See original GitHub issue

What is the problem?

ECS Cluster container insights gets disabled, even if the cdk stack settings is set to true.

Reproduction Steps

Created a minimal reproducible example at https://github.com/rajyan/cdk-ecs-bug.

First, deploy a cluster with containerInsights: true only.

import * as cdk from '@aws-cdk/core';
import * as ecs from '@aws-cdk/aws-ecs';

export class CdkEcsBugStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new ecs.Cluster(this, 'Cluster', {
      containerInsights: true,
    });
  }
}

Then deploy the cluster adding executeCommandConfiguration, leaving containerInsights: true.

import * as cdk from '@aws-cdk/core';
import * as ecs from '@aws-cdk/aws-ecs';

export class CdkEcsBugStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new ecs.Cluster(this, 'Cluster', {
      containerInsights: true,
      executeCommandConfiguration: {
        logging: ecs.ExecuteCommandLogging.OVERRIDE,
        logConfiguration: {
          cloudWatchLogGroup: new LogGroup(this, 'LogGroup'),
        }
      },
    });
  }
}

What did you expect to happen?

Only executeCommandConfiguration should be added to the cluster, and no changes in containerInsights.

What actually happened?

Container insights got disabled.

CDK CLI Version

1.134.0

Framework Version

No response

Node.js Version

v16.13.0

OS

Both on Linux and maxOS

Language

Typescript

Language Version

TypeScript (3.9.7)

Other information

Also confirmed that deploying these two settings at once won’t disable container insights.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rajyancommented, Nov 30, 2021

@ryparker

The “needs-reproduction” label was just a temporary marker that means we haven’t verified the reproduction.

I’m sorry to hurry you.

Thank you very much for your investigation!

1reaction
ryparkercommented, Nov 30, 2021

Handling this internally. I’ll follow up in this thread when we have updates to share.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up Container Insights on Amazon ECS for cluster
You can enable Container Insights on new and existing Amazon ECS clusters. Container Insights collects metrics at the cluster, task, and service levels....
Read more >
[ecs] Cannot disable containerInsights of a cluster ... - GitHub
I tried disabling containerInsights of an ECS cluster but it failed. It seems CFn doesn't support removing the setting but replacing.
Read more >
Ensure container insights are enabled on ECS cluster
Open the Amazon ECS console. · In the navigation pane, choose Account Settings. · To enable the Container Insights default opt-in, check the...
Read more >
Clean up resources - Amazon ECS Workshop
To disable container insights for the ECS cluster execute following command. ... Your output should look similar to this one below. ... Go...
Read more >
How to enable container insights on already created ECS ...
I unclicked in aws console (in account settings) then i aws cli runned the command " aws ecs update-cluster-settings --cluster myCluster ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found