awslabs / aws-config-rdk

The AWS Config Rules Development Kit helps developers set up, author and test custom Config rules. It contains scripts to enable AWS Config, create a Config rule and test it with sample ConfigurationItems.
https://aws-config-rdk.readthedocs.io
Apache License 2.0
446 stars 170 forks source link

rdk create--resource-types : how to put several resources? #101

Closed jongogogo closed 5 years ago

jongogogo commented 5 years ago

The input validation regected my tries on puting a list or []. No documentation found

michaelborchert commented 5 years ago

It looks like this issue was introduced when better error-handling was added to the argument parser. I've updated it to work with comma-separated lists as per the documentation, emit friendly errors when it can't figure out what resource type you mean, and confirmed that comma-separated resource types show up correctly in Config when the Rule is deployed. I've pushed the fix out to pypi.

jongogogo commented 5 years ago

Still not working. Or am I doing something wrong?

PS: version number is not matching between the _init.py and pip.

C:\Users\jrault\Documents\Mecodical-Rules\1_DEV>python %rdk%\rdk create RESOURCES_CREATED_VIA_CLOUDFORMATION --runtime python3.6 --resource-types AWS::CloudFront::Distribution,AWS::CloudFront::StreamingDistribution,AWS::CloudWatch::Alarm,,AWS::DynamoDB::Table,AWS::SSM::ManagedInstanceInventory,AWS::EC2::Host,AWS::EC2::EIP,AWS::EC2::Instance,AWS::EC2::NetworkInterface,AWS::EC2::SecurityGroup,AWS::EC2::Volume,AWS::Redshift::Cluster,AWS::Redshift::ClusterParameterGroup,AWS::Redshift::ClusterSecurityGroup,AWS::Redshift::ClusterSnapshot,AWS::Redshift::ClusterSubnetGroup,AWS::Redshift::EventSubscription,AWS::RDS::DBInstance,AWS::RDS::DBSecurityGroup,AWS::RDS::DBSnapshot,AWS::RDS::DBSubnetGroup,AWS::RDS::EventSubscription,AWS::S3::Bucket,AWS::EC2::CustomerGateway,AWS::EC2::InternetGateway,AWS::EC2::NetworkAcl,AWS::EC2::RouteTable,AWS::EC2::Subnet,AWS::EC2::VPC,AWS::EC2::VPNConnection,AWS::EC2::VPNGateway,AWS::AutoScaling::AutoScalingGroup,AWS::AutoScaling::LaunchConfiguration,AWS::AutoScaling::ScalingPolicy,AWS::AutoScaling::ScheduledAction,AWS::ACM::Certificate,AWS::CloudFormation::Stack,AWS::CloudTrail::Trail,AWS::CodeBuild::Project,AWS::ElasticBeanstalk::Application,AWS::ElasticBeanstalk::ApplicationVersion,AWS::ElasticBeanstalk::Environment,AWS::IAM::User,AWS::IAM::Group,AWS::IAM::Role,AWS::IAM::Policy,AWS::Lambda::Function,AWS::WAF::RateBasedRule,AWS::WAF::Rule,AWS::WAF::WebACL,AWS::WAF::RuleGroup,AWS::WAFRegional::RateBasedRule,AWS::WAFRegional::Rule,AWS::WAFRegional::WebACL,AWS::WAFRegional::RuleGroup,AWS::XRay::EncryptionConfig,AWS::ElasticLoadBalancingV2::LoadBalancer,AWS::ElasticLoadBalancing::LoadBalancer,AWS::ElasticLoadBalancingV2::LoadBalancer
 not found in list of accepted resource types.

C:\Users\jrault\Documents\Mecodical-Rules\1_DEV>python %rdk%\rdk --version
rdk 0.3.22
michaelborchert commented 5 years ago

You have two commas in a row: "...AWS::CloudWatch::Alarm,,AWS::DynamoDB::Table..." which are being interpreted as an empty string, which is not an allowed resource type.

jongogogo commented 5 years ago

Ha! works, thank you sir!