-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add Windows Start Agent With EC2 Run Command #378
Conversation
targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, | ||
}, | ||
{ | ||
testDir: "../../../test/feature/windows/custom_start/ssm_start", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an exception case where we only need to test starting the agent with ssm commands, I think it is fine to only run on a single os.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a sanity test the agent can start and get metrics.
//runs validator and sets up prometheus java agent | ||
provisioner "remote-exec" { | ||
inline = [ | ||
"set AWS_REGION=${var.region}", | ||
"validator.exe --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", | ||
"powershell.exe \"& \"C:ProgramFiles\\Amazon\\AmazonCloudWatchAgent\\amazon-cloudwatch-agent-ctl.ps1\" -m ec2 -a status\"", | ||
"powershell.exe \"& 'C:ProgramFiles\\Amazon\\AmazonCloudWatchAgent\\amazon-cloudwatch-agent-ctl.ps1' -m ec2 -a status\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not use double quotes here to get status check
provisioner "remote-exec" { | ||
inline = [ | ||
"set AWS_REGION=${var.region}", | ||
"aws ssm send-command --document-name AmazonCloudWatch-ManageAgent --parameters optionalConfigurationLocation=${local.ssm_parameter_name} --targets Key=tag:Name,Values=cwagent-integ-test-ec2-windows-${var.test_name}-${module.common.testing_id}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ssm command to start the agent with the config file uploaded to ssm parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
Description of the issue
There is no test that tests starting the Cloudwatch agent with ssm commands on windows. This could be a problem since on windows it will fail if it logs to standard error on startup.
Description of changes
Add a test for starting the agent on windows with ssm commands.
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
https://github.com/aws/amazon-cloudwatch-agent/actions/runs/6882426811/job/18721347139
Integration tests