awslabs / aws-config-engine-for-compliance-as-code

Manage AWS Config Rules at scale in AWS multi-account and/or multi-region environment; with fully configurable deployment (RuleSets) and analytics.
Apache License 2.0
276 stars 96 forks source link

Create rule template with rulestes TAG #58

Open anoora17 opened 4 years ago

anoora17 commented 4 years ago

ENV: Python 3 installed rdk with python3 -m pip install rdk

sample of config rule { "Version": "1.0", "Parameters": { "RuleName": "access_keys_rotated", "SourceRuntime": null, "CodeKey": null, "InputParameters": "{}", "OptionalParameters": "{\"maxAccessKeyAge\": \"30\"}", "SourcePeriodic": "TwentyFour_Hours", "SourceIdentifier": "ACCESS_KEYS_SOMETHING", "RuleSets": [ "tagOne" ] }, "Tags": [] }

CLI used to generate template: rdk create-rule-template --rulesets tagOne --output-file test.json --rules-only

Output: Generating CloudFormation template! Traceback (most recent call last): File "/usr/local/bin/rdk", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/rdk/cli.py", line 21, in main return_val = my_rdk.process_command() File "/usr/local/lib/python3.6/site-packages/rdk/rdk.py", line 341, in process_command exit_code = method_to_call() File "/usr/local/lib/python3.6/site-packages/rdk/rdk.py", line 1806, in create_rule_template tags_str += "Key={},Value={} ".format(tag['Key'], tag['Value'])]]

Any one have solution to this issue, however if I have one config rule it works but not with multiple one using Rulesets tagging.