File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed
docs/user_docs/guides/working-with-terraform
examples/terraform/validation
versioned_docs/version-0.9/user_docs/guides/working-with-terraform Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -420,11 +420,18 @@ schema TFPlan:
420
420
schema AcceptableChange:
421
421
# Omit other attributes
422
422
[... str]: any
423
+ $ type : str
424
+ name: str
425
+ change: Change
423
426
check:
424
427
# Reject AWS autoscaling group Resource delete action
425
428
all action in change.actions {
426
429
action not in [" delete" ]
427
430
} if type == " aws_autoscaling_group" , " Disable AWS autoscaling group resource delete action for the resource ${type} ${name} "
431
+
432
+ schema Change:
433
+ [... str]: any
434
+ actions: [str ]
428
435
```
429
436
430
437
This policy file checks that no AWS Auto Scaling groups are being deleted - even if that deletion is part of a delete-and-recreate operation.
@@ -450,11 +457,18 @@ schema TFPlan:
450
457
schema AcceptableChange:
451
458
# Omit other attributes
452
459
[... str]: any
460
+ $ type : str
461
+ name: str
462
+ change: Change
453
463
check:
454
464
# Reject AWS autoscaling group Resource delete action
455
465
all action in change.actions {
456
- action not in [" create" ]
466
+ action not in [" create" ] # Use create to mock a check failure.
457
467
} if type == " aws_autoscaling_group" , " Disable AWS autoscaling group resource create action for the resource ${type} ${name} "
468
+
469
+ schema Change:
470
+ [... str]: any
471
+ actions: [str ]
458
472
```
459
473
460
474
Run the command
Original file line number Diff line number Diff line change @@ -6,8 +6,15 @@ schema TFPlan:
6
6
schema AcceptableChange:
7
7
# Omit other attributes
8
8
[...str]: any
9
+ $type: str
10
+ name: str
11
+ change: Change
9
12
check:
10
13
# Reject AWS autoscaling group Resource delete action
11
14
all action in change.actions {
12
15
action not in ["delete"]
13
16
} if type == "aws_autoscaling_group", "Disable AWS autoscaling group resource delete action for the resource ${type} ${name}"
17
+
18
+ schema Change:
19
+ [...str]: any
20
+ actions: [str]
Original file line number Diff line number Diff line change @@ -6,8 +6,15 @@ schema TFPlan:
6
6
schema AcceptableChange:
7
7
# Omit other attributes
8
8
[...str]: any
9
+ $type: str
10
+ name: str
11
+ change: Change
9
12
check:
10
13
# Reject AWS autoscaling group Resource delete action
11
14
all action in change.actions {
12
15
action not in ["create"] # Use create to mock a check failure.
13
16
} if type == "aws_autoscaling_group", "Disable AWS autoscaling group resource create action for the resource ${type} ${name}"
17
+
18
+ schema Change:
19
+ [...str]: any
20
+ actions: [str]
Original file line number Diff line number Diff line change @@ -420,11 +420,18 @@ schema TFPlan:
420
420
schema AcceptableChange:
421
421
# Omit other attributes
422
422
[... str]: any
423
+ $ type : str
424
+ name: str
425
+ change: Change
423
426
check:
424
427
# Reject AWS autoscaling group Resource delete action
425
428
all action in change.actions {
426
429
action not in [" delete" ]
427
430
} if type == " aws_autoscaling_group" , " Disable AWS autoscaling group resource delete action for the resource ${type} ${name} "
431
+
432
+ schema Change:
433
+ [... str]: any
434
+ actions: [str ]
428
435
```
429
436
430
437
This policy file checks that no AWS Auto Scaling groups are being deleted - even if that deletion is part of a delete-and-recreate operation.
@@ -450,11 +457,18 @@ schema TFPlan:
450
457
schema AcceptableChange:
451
458
# Omit other attributes
452
459
[... str]: any
460
+ $ type : str
461
+ name: str
462
+ change: Change
453
463
check:
454
464
# Reject AWS autoscaling group Resource delete action
455
465
all action in change.actions {
456
- action not in [" create" ]
466
+ action not in [" create" ] # Use create to mock a check failure.
457
467
} if type == " aws_autoscaling_group" , " Disable AWS autoscaling group resource create action for the resource ${type} ${name} "
468
+
469
+ schema Change:
470
+ [... str]: any
471
+ actions: [str ]
458
472
```
459
473
460
474
Run the command
You can’t perform that action at this time.
0 commit comments