Skip to content

Conversation

@Paramadon
Copy link
Contributor

Description of the issue

CloudWatch Agent was ignoring the -m onPremise flag on restart and falling back to EC2 mode, which breaks scenarios like Amazon WorkSpaces where IMDS is reachable but the agent should run in onPremise mode.

Description of changes

This change ensures the agent remembers the mode selected during configuration. The agent now writes the chosen mode to env-config.json using a new CWAGENT_MODE constant and restores that value during startup through the translator context. As a result, the agent no longer defaults to EC2 mode if env var CWAGENT_MODE is onPremise.

Tests

Unit tests

@Paramadon Paramadon requested a review from a team as a code owner November 14, 2025 17:00
@Paramadon Paramadon added the ready for testing Indicates this PR is ready for integration tests to run label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for testing Indicates this PR is ready for integration tests to run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant