Comments (8)
Hi Ameya,
Thanks for sending this feedback. I'm going to set up an environment and see if I can repro your issue. But before I do so, would you mind testing one thing for me? Could you change your last parameter in the command from --task-invocation-parameters to --task-parameters "{"Operation":{"Values":["Install"]}}"
Please let me know if that works. Thanks!
from aws-systems-manager-user-guide.
I think that the part of the quotes and escape characters differs depending on the shell you are using and is not valid, for different reasons, neither on Linux/bash nor Windows/CMD.
If you pass '{\"Operation\":{\"Values\":[\"Install\"]}}'
as an argument on CMD, the program receives: '{"Operation":{"Values":["Install"]}}'
(note that there are single quotes, which makes the JSON document invalid)
The result of calling the actual aws ssm command is:
Error parsing parameter '--task-invocation-parameters': Expected: '=', received: ''' for input: '{"Operation":{"Values":["Install"]}}'
If you pass '{\"Operation\":{\"Values\":[\"Install\"]}}'
as an argument on bash, the program receives: {\"Operation\":{\"Values\":[\"Install\"]}}
(this is because the \ inside single quotes in bash is not acting as an escape character)
The result of calling the aws ssm command is:
Error parsing parameter '--task-invocation-parameters': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) JSON received: {\"Operation\":{\"Values\":[\"Install\"]}}
With the proposed modification:
Passing "{\"Operation\":{\"Values\":[\"Install\"]}}"
via CMD, the program receives {"Operation":{"Values":["Install"]}}
. Valid JSON.
The result is:
Parameter validation failed: Unknown parameter in TaskInvocationParameters: "Operation", must be one of: RunCommand, Automation, StepFunctions, Lambda
Passing "{\"Operation\":{\"Values\":[\"Install\"]}}"
via bash, the program receives {"Operation":{"Values":["Install"]}}{"Operation":{"Values":["Install"]}}
. Valid JSON.
Result:
Parameter validation failed: Unknown parameter in TaskInvocationParameters: "Operation", must be one of: RunCommand, Automation, StepFunctions, Lambda
from aws-systems-manager-user-guide.
Thanks everyone. We've created a ticket in our internal system to update the example so I'm going to close this issue. Also, here is an example of --task-invocation-parameters that might be useful: https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-tasks.html
from aws-systems-manager-user-guide.
@JimbroAmazon If I use --task-parameters that still does not work,.
aws ssm register-task-with-maintenance-window --window-id $grpa_maint_window --targets "Key=WindowTargetIds,Values=$reg_grpa_tar_wind_id" --task-arn "AWS-RunPatchBaseline" --service-role-arn "arn:aws:iam::xxxxxxxxxxxxxxxxxxxxxx:role/AmazonSSMRoleForInstancesQuickSetup" --task-type "RUN_COMMAND" --max-concurrency 2 --max-errors 1 --priority 1 --task-parameters '{\"Operation\":{\"Values\":[\"Install\"]}}'
+ aws ssm register-task-with-maintenance-window --window-id mw-086bfbb3f3181ec38 --targets Key=WindowTargetIds,Values=102fcef1-7c14-4a54-823b-cc01a637ddb5 --task-arn AWS-RunPatchBaseline --service-role-arn arn:aws:iam::xxxxxxxxxxxxxxxxxxxxx:role/AmazonSSMRoleForInstancesQuickSetup --task-type RUN_COMMAND --max-concurrency 2 --max-errors 1 --priority 1 --task-parameters '{\"Operation\":{\"Values\":[\"Install\"]}}'
Error parsing parameter '--task-parameters': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
JSON received: {\"Operation\":{\"Values\":[\"Install\"]}}
from aws-systems-manager-user-guide.
@JimbroAmazon The example you have provided is for the task-arn AWS-RunShellScript, do you an example for AWS-RunPatchBaseline? If yes then kindly suggest. Thanks in advance.
from aws-systems-manager-user-guide.
Try this format:
aws ssm register-task-with-maintenance-window --window-id mw-00897dfab9EXAMPLE --targets "Key=WindowTargetIds,Values=ff3ef102-eb72-4b56-ad8f-dcc7cEXAMPLE" --task-arn "AWS-RunPatchBaseline" --task-type "RUN_COMMAND" --max-concurrency 2 --max-errors 1 --priority 1 --task-invocation-parameters "RunCommand={Parameters={Operation=Install}}"
Note that this is using --task-invocation-parameters
, not --task-parameters
. I've also omitted --service-role-arn
because I'm letting the command use the service-linked role, but you can of course specify a different role as you did in your examples.
We're working on getting the walkthrough updated later this week.
from aws-systems-manager-user-guide.
@mark-amzn Thanks for that. The command work and it produces no output. However, I do not see any task associated with the maintenance window though.
from aws-systems-manager-user-guide.
I've verified again that the command format just above with --task-invocation-parameters
works, running from both my Windows and Linux local machines.
Are you using a third-party tool like GitBash to run commands? I noticed this in your earlier example: --window-id $grpa_maint_window
. If so, there may be an issue with your setup there that we can't help with.
If you continue to have issues, you may want to contact AWS Support or post your issue in the Systems Manager Developer Forum.
-Mark
from aws-systems-manager-user-guide.
Related Issues (20)
- Updating Windows2 HOT 4
- AWS-managed document returns unexpected exit code HOT 1
- Automation document list not updated
- AWS-ConfigureDocker document unexpectedly fails HOT 9
- Access to the path is denied HOT 1
- Session-manager plugin version and release are not up to date HOT 2
- No guidance on date formatting for "--expiration-date" flag HOT 3
- ec2windows no longer a valid public parameter HOT 1
- SLES and SLES for SAP - amazon-ssm-agent HOT 2
- ARM links for SLES RPMs not provided HOT 1
- Clarify using customer managed keys HOT 1
- missing examples on cf HOT 2
- document will try to patch an AMI or Volume if it has the same values on tags need to filter,run only on AWS::EC2::Instance HOT 1
- Get-SSMCommandInvocation does not return instance IDs. HOT 2
- Incorrect dependency in Automation Document HOT 3
- Systems Manager Relationship Diagram HOT 3
- Extra period after the below sentence. HOT 1
- Incorrect command to check status/start SSM agent on Amazon Linux 1 HOT 1
- aws:runInstances BlockDeviceMapping option not working HOT 1
- Repeated details about Patch selection on AL2022 and AL2023 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-systems-manager-user-guide.