How to use start_config_rules_evaluation method in localstack

Best Python code snippet using localstack_python

test_config_citizen_version.py

Source:test_config_citizen_version.py Github

copy

Full Screen

...20def start_rule_invoke(b3_config,config_rule):21 try:22 previous_rule_invoc_time = b3_config.describe_config_rule_evaluation_status(23 ConfigRuleNames=config_rule)[u'ConfigRulesEvaluationStatus'][0][u'LastSuccessfulInvocationTime']24 b3_config.start_config_rules_evaluation(25 ConfigRuleNames=config_rule )26 except ClientError as e: # Handle LimitExceededException. Exception thrown if an evaluation is in progress or if StartConfigRulesEvaluation API is triggered more than once per minute.27 if e.response['Error']['Code'] == 'LimitExceededException':28 print "Previous evaluation is in progress, Wait for 60sec"29 time.sleep(60) # Wait for 60sec before triggering evaluation30 b3_config.start_config_rules_evaluation(31 ConfigRuleNames=config_rule)32 else:33 print "Unexpected error: %s" % e34 return previous_rule_invoc_time35def check_rule_invoke_success(b3_config,config_rule, previous_rule_invoc_time):36 current_rule_invoc_time = previous_rule_invoc_time37 exit_loop_timer = time.time() + 180 # Exit if invocation doesn't start before 3mins38 break_loop = False39 while not (break_loop or current_rule_invoc_time > previous_rule_invoc_time):40 print "Invocation not started..."41 current_rule_invoc_time = b3_config.describe_config_rule_evaluation_status(42 ConfigRuleNames=config_rule)[u'ConfigRulesEvaluationStatus'][0][u'LastSuccessfulInvocationTime']43 if time.time() >= exit_loop_timer:44 print "Invocation Timeout: Invocation did not complete within 3mins..."...

Full Screen

Full Screen

aws_trigger_test.py

Source:aws_trigger_test.py Github

copy

Full Screen

1import boto32client = boto3.client("config")3response = client.start_config_rules_evaluation(4 ConfigRuleNames=["ec2-stopped-instance"]5)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful