π§ AWS EC2 Auto Scaling Group behind ELB doesn't use ELB health check - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
- Located in: π AWS EC2 Auto Scaling Group behind ELB doesn't use ELB health check π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS EC2 Auto Scaling Group | CA10__CaAwsAutoScalingGroup__c | 3 | 1 | 2 |
Usesβ
- π AWS EC2 Auto Scaling Group Tfc.Src.Link - object.extracts.yaml
- π AWS EC2 Auto Scaling Group - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:44:25.610153008Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
π’ | test2 | βοΈ 199 | βοΈ CA10__AWS_EC2_Auto_Scaling_Group_Tfc_Src_Links__r.hasNo(COMPLIANT) | βοΈ null |
π’ | test3 | βοΈ 199 | βοΈ CA10__AWS_EC2_Auto_Scaling_Group_Tfc_Src_Links__r.hasNo(COMPLIANT) | βοΈ null |
π’ | test4 | βοΈ 199 | βοΈ CA10__AWS_EC2_Auto_Scaling_Group_Tfc_Src_Links__r.hasNo(COMPLIANT) | βοΈ null |
π’ | test5 | βοΈ 299 | βοΈ not(extract('CA10__healthCheckType__c').contains('ELB')) | βοΈ null |
π’ | test6 | βοΈ 399 | βοΈ extract('CA10__healthCheckType__c').contains('ELB') | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/policy.yaml | 4C2B53ACF31B1CE0F665F3F5AE50F52B |
Open | /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml | BDFAD3F7A248432F95EFD92026833D66 |
Open | /types/CA10__CaAwsAutoScalingGroupTrafficSourceLink__c/object.extracts.yaml | 5D75919837EC6FE643E714B0EB120E9F |
Open | /types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yaml | DD41D736933C31B7EA43278E6396A5FC |
Open | /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/test-data.json | C079D116AE211EE68A573FA2AE2008B0 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/aws/autoscaling/group-with-elb-without-elb-health-check/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsAutoScalingGroup__c"
importExtracts:
- file: "/types/CA10__CaAwsAutoScalingGroupTrafficSourceLink__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The AGS is not associated with a Load Balancer."
check:
RELATED_LIST_HAS_NO:
relationshipName: "CA10__AWS_EC2_Auto_Scaling_Group_Tfc_Src_Links__r"
status: "COMPLIANT"
- status: "INCOMPLIANT"
currentStateMessage: "The AGS behind ELB does not use ELB health check."
remediationMessage: "Configure Auto Scaling Group to use ELB health check."
check:
NOT:
arg:
CONTAINS:
arg:
EXTRACT: "CA10__healthCheckType__c"
substring:
TEXT: "ELB"
- status: "COMPLIANT"
currentStateMessage: "The ASG uses ELB health check."
check:
CONTAINS:
arg:
EXTRACT: "CA10__healthCheckType__c"
substring:
TEXT: "ELB"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."
relatedLists:
- relationshipName: "CA10__AWS_EC2_Auto_Scaling_Group_Tfc_Src_Links__r"
conditions:
- status: "COMPLIANT"
currentStateMessage: "The ASG traffic source is a Classic Load Balancer."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__trafficSourceType__c"
right:
TEXT: "elb"
- status: "COMPLIANT"
currentStateMessage: "The ASG traffic source is an ELB target group."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__trafficSourceType__c"
right:
TEXT: "elbv2"
otherwise:
status: "INAPPLICABLE"
currentStateMessage: "Unrelated ASG traffic source."