Skip to content

Commit 31c3468

Browse files
committed
[NDR-222] delete dry run
1 parent 3af7b2f commit 31c3468

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

scripts/list_workspace_resource.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
TERRAFORM_WORKSPACE=""
44
do_delete=false
5-
dry_run=false
65

76
function _list_tagged_resources() {
87
local workspace=$1
@@ -119,9 +118,7 @@ function _delete_log_groups() {
119118
# Loop through each log group and delete it
120119
for log_group in $log_groups; do
121120
echo "Deleting CloudWatch Logs log group: $log_group"
122-
if ! $dry_run; then
123-
aws logs delete-log-group --log-group-name "$log_group"
124-
fi
121+
aws logs delete-log-group --log-group-name "$log_group"
125122
done
126123
}
127124

@@ -680,9 +677,7 @@ function _delete_cloudwatch_alarms() {
680677
for alarm in $alarms; do
681678
echo "$alarm"
682679
done
683-
if ! $dry_run; then
684-
aws cloudwatch delete-alarms --alarm-names $alarms
685-
fi
680+
aws cloudwatch delete-alarms --alarm-names $alarms
686681
}
687682

688683
function _list_appconfig() {
@@ -780,9 +775,7 @@ function _delete_cloudwatch_dashboards() {
780775
for dashboard in $dashboards; do
781776
echo "$dashboard"
782777
done
783-
if ! $dry_run; then
784-
aws cloudwatch delete-dashboards --dashboard-names $dashboards
785-
fi
778+
aws cloudwatch delete-dashboards --dashboard-names $dashboards
786779
}
787780

788781
function _list_iam_instance_profiles() {
@@ -1044,10 +1037,6 @@ for arg in "$@"; do
10441037
do_delete=true
10451038
shift
10461039
;;
1047-
--dry-run)
1048-
dry_run=true
1049-
shift
1050-
;;
10511040
*)
10521041
TERRAFORM_WORKSPACE="$arg"
10531042
shift

0 commit comments

Comments
 (0)