From 8db67cd034d95ca3e2cab6c3b8b1feeeea8b5961 Mon Sep 17 00:00:00 2001 From: Anna Shcherbak Date: Wed, 29 May 2024 21:41:57 +0300 Subject: [PATCH] skip: update autotest for directory --- .../green/account/securityhub.tf | 1 - .../green/directory/directory.tf | 40 +++++++++++++ auto_policy_testing/green/directory/main.tf | 13 +++++ .../green/directory/outputs.tf | 5 ++ .../green/directory/provider.tf | 20 +++++++ .../green/directory/variables.tf | 5 ++ .../red/directory/directory.tf | 58 ------------------- auto_policy_testing/scripts/iam_role_aws.py | 46 ++++++++------- auto_policy_testing/scripts/main.py | 12 ++-- 9 files changed, 113 insertions(+), 87 deletions(-) create mode 100644 auto_policy_testing/green/directory/directory.tf create mode 100644 auto_policy_testing/green/directory/main.tf create mode 100644 auto_policy_testing/green/directory/outputs.tf create mode 100644 auto_policy_testing/green/directory/provider.tf create mode 100644 auto_policy_testing/green/directory/variables.tf diff --git a/auto_policy_testing/green/account/securityhub.tf b/auto_policy_testing/green/account/securityhub.tf index af490fd72..fc41fa2a0 100644 --- a/auto_policy_testing/green/account/securityhub.tf +++ b/auto_policy_testing/green/account/securityhub.tf @@ -8,5 +8,4 @@ resource "null_resource" "this" { when = destroy command = "aws securityhub disable-security-hub" } - } \ No newline at end of file diff --git a/auto_policy_testing/green/directory/directory.tf b/auto_policy_testing/green/directory/directory.tf new file mode 100644 index 000000000..f5e025c7d --- /dev/null +++ b/auto_policy_testing/green/directory/directory.tf @@ -0,0 +1,40 @@ + +resource "aws_directory_service_directory" "this" { + name = "${module.naming.resource_prefix.directory}.com" + password = "#S1ncerely" + size = "Small" + + vpc_settings { + vpc_id = data.terraform_remote_state.common.outputs.vpc_id + subnet_ids = [ + data.terraform_remote_state.common.outputs.vpc_subnet_1_id, + data.terraform_remote_state.common.outputs.vpc_subnet_3_id + ] + } +} + +resource "null_resource" "this" { + depends_on = [ + aws_directory_service_directory.this + ] + triggers = { + sg = aws_directory_service_directory.this.security_group_id + } + provisioner "local-exec" { + interpreter = ["/bin/bash", "-c"] + command = <