Skip to content

Conversation

@leeserpa
Copy link
Contributor

@leeserpa leeserpa commented Sep 5, 2025

Define setting.container_insights.value as an enum.
Resource aws_ecs_cluster

Types of changes

What types of changes does your code introduce to <repo_name>?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md doc.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@amazon-q-developer
Copy link

Code review in progress. Analyzing for code quality issues and best practices. Detailed findings will be posted upon completion.

Using Amazon Q Developer for GitHub

Amazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation.

Slash Commands

Command Description
/q <message> Chat with the agent to ask questions or request revisions
/q review Requests an Amazon Q powered code review
/q help Displays usage information

Features

Agentic Chat
Enables interactive conversation with Amazon Q to ask questions about the pull request or request specific revisions. Use /q <message> in comment threads or the review body to engage with the agent directly.

Code Review
Analyzes pull requests for code quality, potential issues, and security concerns. Provides feedback and suggested fixes. Automatically triggered on new or reopened PRs (can be disabled for AWS registered installations), or manually with /q review slash command in a comment.

Customization

You can create project-specific rules for Amazon Q Developer to follow:

  1. Create a .amazonq/rules folder in your project root.
  2. Add Markdown files in this folder to define rules (e.g., cdk-rules.md).
  3. Write detailed prompts in these files, such as coding standards or best practices.
  4. Amazon Q Developer will automatically use these rules when generating code or providing assistance.

Example rule:

All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
All Amazon DynamoDB Streams tables must have encryption enabled.
All Amazon SNS topics must have encryption enabled and enforce SSL.
All Amazon SNS queues must enforce SSL.

Feedback

To provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository.

For more detailed information, visit the Amazon Q for GitHub documentation.

Footnotes

  1. Amazon Q Developer uses generative AI. You may need to verify generated code before using it in your environment. See the AWS Responsible AI Policy.

Copy link

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a good improvement to the ECS module. The changes make the container insights configuration more robust by:

  1. Converting container_insights to an enum with proper validation
  2. Adding support for the "enhanced" container insights option
  3. Properly handling service connect defaults in the lifecycle block

The suggestions provided would improve documentation and maintainability, but the core changes are solid and ready to be merged after addressing the feedback.

Comment on lines 369 to +371

variable "container_insights" {
type = bool
default = false
type = string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement to the container insights configuration. Using an enum with validation ensures that only valid values are provided and adds support for the "enhanced" option. Consider adding a description of what each value means to help users choose the appropriate setting.

Suggested change
variable "container_insights" {
type = bool
default = false
type = string
variable "container_insights" {
type = string
default = "disabled"
description = <<-EOT
Enables CloudWatch Container Insights for a cluster.
Valid values:
- "enhanced": Enables enhanced container insights with additional metrics
- "enabled": Enables basic container insights
- "disabled": Disables container insights
EOT
validation {
condition = contains(["enhanced", "enabled", "disabled"], var.container_insights)
error_message = "Container Insights must be one of: enhanced, enabled, disabled."
}
}

Comment on lines 15 to 17
lifecycle {
ignore_changes = []
ignore_changes = [service_connect_defaults]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition of service_connect_defaults to ignore_changes. This prevents unwanted updates when service connect configurations are modified outside of Terraform. Consider adding a comment explaining why this change is needed for better maintainability.

Suggested change
lifecycle {
ignore_changes = []
ignore_changes = [service_connect_defaults]
lifecycle {
# Ignore changes to service connect defaults as they may be modified outside of Terraform
ignore_changes = [service_connect_defaults]
}

Copy link
Member

@RaphaelMacedonio RaphaelMacedonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leeserpa leeserpa merged commit 09bdc54 into master Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants