Home > database >  What is the aws-cli command for AWS Macie to create a job?
What is the aws-cli command for AWS Macie to create a job?

Time:07-11

actually I want to create a job in AWS macie using the aws cli. I ran the following command:- aws macie2 create-classification-job --job-type "ONE_TIME" --name "maice-poc" --s3-job-definition bucketDefinitions=[{"accountID"="254378651398", "buckets"=["maice-poc"]}]

but it is giving me an error:- Unknown options: buckets=[maice-poc]}]

Can someone give me a correct command?

CodePudding user response:

The s3-job-definition requires a structure as value.

And in your case, you want to pass in a JSON-formatted structure parameter, so you should wrap the JSON starting with bucketDefinitions in single quotes. Also instead of = use the JSON syntax : for key-value pairs.

The following API call should work:

aws macie2 create-classification-job --job-type "ONE_TIME" --name "macie-poc" --s3-job-definition '{"bucketDefinitions":[{"accountId":"254378651398", "buckets":["maice-poc"]}]}'
  • Related