Skip to content

Commit

Permalink
Merge pull request #24 from PaloAltoNetworks/destroy-issue-fix
Browse files Browse the repository at this point in the history
fixed destroy command not working for scenario-1 and scenario-2
  • Loading branch information
anandtiwarics authored Sep 9, 2024
2 parents a5a8b77 + 0a87379 commit 79bd258
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def main(cloud_provider, action, simulation, scenario):
elif action == 'status' and scenario == "scenario-2":
subprocess.call("cd ./scenarios/scenario_2/infra/ && pulumi stack ls", shell=True)
elif action == 'destroy' and scenario == "scenario-1":
subprocess.call("cd ./scenarios/scenario_1/infra && pulumi destroy -s --yes aws-scenario-1 ", shell=True)
subprocess.call("cd ./scenarios/scenario_1/infra && pulumi destroy -s aws-scenario-1 --yes ", shell=True)
elif action == 'destroy' and scenario == "scenario-2":
scenario_2_destroy()
elif action == 'destroy' and scenario == "scenario-3":
Expand Down
2 changes: 1 addition & 1 deletion scenarios/scenario_2/scenario_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def scenario_2_destroy():
subprocess.call("aws iam list-role-policies --role-name "+LAMBDA_ROLE_NAME+" | jq -r '.PolicyNames[]' | xargs -I {} aws iam delete-role-policy --role-name "+LAMBDA_ROLE_NAME+" --policy-name {}", shell=True)
subprocess.call("aws iam detach-role-policy --role-name "+LAMBDA_ROLE_NAME+" --policy-arn arn:aws:iam::aws:policy/AdministratorAccess", shell=True)

subprocess.call("cd ./scenarios/scenario_2/infra/ && pulumi destroy", shell=True)
subprocess.call("cd ./scenarios/scenario_2/infra/ && pulumi destroy -s aws-scenario-2 --yes", shell=True)


def scenario_2_execute():
Expand Down

0 comments on commit 79bd258

Please sign in to comment.