Skip to content

Commit

Permalink
skip: update CI 68
Browse files Browse the repository at this point in the history
  • Loading branch information
vit-corp committed Jul 5, 2024
1 parent 5aab23c commit fcc75df
Show file tree
Hide file tree
Showing 38 changed files with 112 additions and 169 deletions.
4 changes: 2 additions & 2 deletions auto_policy_testing/green/networkinterface/vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "azurerm_network_interface" "this" {

ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.this.id
subnet_id = data.terraform_remote_state.common.outputs.subnet_id
private_ip_address_allocation = "Dynamic"
}

Expand All @@ -15,7 +15,7 @@ resource "azurerm_network_interface" "this" {
}

resource "azurerm_linux_virtual_machine" "this" {
name = "${module.naming.resource_prefix.vm}nic"
name = "${module.naming.resource_prefix.vm}nicgr"
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
size = "Standard_F2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "azurerm_network_security_group" "this" {
name = "networksecuritygroup-nsg-green"
name = module.naming.resource_prefix.networksecuritygroup
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group

Expand Down
4 changes: 2 additions & 2 deletions auto_policy_testing/green/storage/storage_account.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_storage_account" "this" {
name = "${module.naming.resource_prefix.storage}storage${random_integer.this.result}"
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
account_tier = "Standard"
account_replication_type = "GRS"
allow_nested_items_to_be_public = false
Expand Down
17 changes: 17 additions & 0 deletions auto_policy_testing/red/common_resources/random.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "random_integer" "this" {
min = 1
max = 100
}

resource "random_password" "this" {
length = 13
special = true
number = true
override_special = "_%@"
}

resource "random_string" "this" {
length = 8
numeric = false
special = false
}
4 changes: 0 additions & 4 deletions auto_policy_testing/red/common_resources/random_int.tf

This file was deleted.

13 changes: 4 additions & 9 deletions auto_policy_testing/red/networkinterface/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
data "terraform_remote_state" "common" {
backend = "s3"

config = {
bucket = var.remote_state_bucket
key = var.remote_state_key
region = var.remote_state_region
}
module "naming" {
source = "../../shared_tf_modules/naming"
resource_type = basename(abspath(path.module))
status = title(basename(dirname(abspath(path.module))))
}

7 changes: 0 additions & 7 deletions auto_policy_testing/red/networkinterface/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@ terraform {

provider "azurerm" {
features {}
}

resource "azurerm_resource_group" "this" {
name = "networkinterface-rg-red"
location = var.location

tags = var.tags
}
5 changes: 0 additions & 5 deletions auto_policy_testing/red/networkinterface/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
location = "northeurope"

tags = {
ComplianceStatus = "Red"
}
8 changes: 0 additions & 8 deletions auto_policy_testing/red/networkinterface/vars.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
variable "location" {
type = string
}

variable "tags" {
type = map(string)
}

variable "remote_state_region" {
type = string
description = "Region where resources will be created"
Expand Down
35 changes: 9 additions & 26 deletions auto_policy_testing/red/networkinterface/vm.tf
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
resource "azurerm_virtual_network" "this" {
name = "vnet-networkinterface-red"
address_space = ["10.0.0.0/24"]
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name

tags = var.tags
}

resource "azurerm_subnet" "this" {
name = "snet1-networkinterface-red"
resource_group_name = azurerm_resource_group.this.name
virtual_network_name = azurerm_virtual_network.this.name
address_prefixes = ["10.0.0.0/25"]

}

resource "azurerm_network_interface" "this" {
name = "nic1-networkinterface-red"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
name = module.naming.resource_prefix.networkinterface
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group

ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.this.id
subnet_id = data.terraform_remote_state.common.outputs.subnet_id
private_ip_address_allocation = "Dynamic"
}
enable_ip_forwarding = true

tags = var.tags
tags = module.naming.default_tags
}

resource "azurerm_linux_virtual_machine" "this" {
name = "vm1-networkinterface-red"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
name = "${module.naming.resource_prefix.vm}nicrd"
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
size = "Standard_F2"
admin_username = random_string.this.result
admin_password = random_password.this.result
Expand All @@ -52,5 +35,5 @@ resource "azurerm_linux_virtual_machine" "this" {
version = "latest"
}

tags = var.tags
tags = module.naming.default_tags
}
6 changes: 6 additions & 0 deletions auto_policy_testing/red/networksecuritygroup/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module "naming" {
source = "../../shared_tf_modules/naming"
resource_type = basename(abspath(path.module))
status = title(basename(dirname(abspath(path.module))))
}

data "terraform_remote_state" "common" {
backend = "s3"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_network_security_group" "this" {
name = "networksecuritygroup-nsg-red"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
name = module.naming.resource_prefix.networksecuritygroup
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group

security_rule {
name = "allow_inbound_udp"
Expand Down Expand Up @@ -31,6 +31,6 @@ resource "azurerm_network_security_group" "this" {



tags = var.tags
tags = module.naming.default_tags
}

8 changes: 4 additions & 4 deletions auto_policy_testing/red/networksecuritygroup/nic.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
resource "azurerm_network_interface" "this" {
name = "nic1-networksecuritygroup"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
name = module.naming.resource_prefix.networkinterface
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group

ip_configuration {
name = "internal"
subnet_id = data.terraform_remote_state.common.outputs.subnet_id
private_ip_address_allocation = "Dynamic"
}

tags = var.tags
tags = module.naming.default_tags
}

resource "azurerm_network_interface_security_group_association" "assoc_nic" {
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions auto_policy_testing/red/networksecuritygroup/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
location = "northeurope"

tags = {
ComplianceStatus = "Red"
}
8 changes: 0 additions & 8 deletions auto_policy_testing/red/networksecuritygroup/variables.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
variable "location" {
type = string
}

variable "tags" {
type = map(string)
}

variable "remote_state_region" {
type = string
description = "Region where resources will be created"
Expand Down
6 changes: 6 additions & 0 deletions auto_policy_testing/red/storage/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module "naming" {
source = "../../shared_tf_modules/naming"
resource_type = basename(abspath(path.module))
status = title(basename(dirname(abspath(path.module))))
}

data "terraform_remote_state" "common" {
backend = "s3"

Expand Down
15 changes: 13 additions & 2 deletions auto_policy_testing/red/storage/random.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
resource "random_integer" "this" {
min = 1
max = 100
}

resource "random_password" "this" {
length = 13
special = true
number = true
override_special = "_%@"
}

resource "random_string" "this" {
length = 8
upper = false
number = true
numeric = false
special = false
}
4 changes: 0 additions & 4 deletions auto_policy_testing/red/storage/resource_group.tf

This file was deleted.

8 changes: 4 additions & 4 deletions auto_policy_testing/red/storage/storage_account.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_storage_account" "this" {
name = "${random_string.this.result}sared"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
name = "${module.naming.resource_prefix.storage}storage${random_integer.this.result}"
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = false
Expand All @@ -13,7 +13,7 @@ resource "azurerm_storage_account" "this" {

min_tls_version = "TLS1_0"

tags = var.tags
tags = module.naming.default_tags
}

resource "azurerm_storage_container" "container1" {
Expand Down
4 changes: 0 additions & 4 deletions auto_policy_testing/red/storage/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
location = "eastus"

tags = {
ComplianceStatus = "Red"
}
8 changes: 0 additions & 8 deletions auto_policy_testing/red/storage/variables.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
variable "location" {
type = string
}

variable "tags" {
type = map(string)
}

variable "remote_state_region" {
type = string
description = "Region where resources will be created"
Expand Down
1 change: 1 addition & 0 deletions auto_policy_testing/red/vm/vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ resource "azurerm_windows_virtual_machine" "this" {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
tags = module.naming.default_tags
}
5 changes: 3 additions & 2 deletions auto_policy_testing/red/vm/vm_linux.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_linux_virtual_machine" "this" {
name = "${module.naming.resource_prefix.vm}rdlin"
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
location = data.terraform_remote_state.common.outputs.location
resource_group_name = data.terraform_remote_state.common.outputs.resource_group
size = "Standard_B1s"
disable_password_authentication = false
admin_username = random_string.this.result
Expand All @@ -22,4 +22,5 @@ resource "azurerm_linux_virtual_machine" "this" {
sku = "16.04-LTS"
version = "latest"
}
tags = module.naming.default_tags
}
1 change: 1 addition & 0 deletions auto_policy_testing/red/vm/vm_unmanaged.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ resource "azurerm_virtual_machine" "this" {
os_profile_linux_config {
disable_password_authentication = false
}
tags = module.naming.default_tags
}
1 change: 1 addition & 0 deletions auto_policy_testing/red/vm/vmss.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ resource "azurerm_windows_virtual_machine_scale_set" "this" {
subnet_id = data.terraform_remote_state.common.outputs.subnet_id
}
}
tags = module.naming.default_tags
}
1 change: 1 addition & 0 deletions auto_policy_testing/red/vm/vmss_linux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ resource "azurerm_linux_virtual_machine_scale_set" "this" {
subnet_id = data.terraform_remote_state.common.outputs.subnet_id
}
}
tags = module.naming.default_tags
}

6 changes: 6 additions & 0 deletions auto_policy_testing/red/vnet/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module "naming" {
source = "../../shared_tf_modules/naming"
resource_type = basename(abspath(path.module))
status = title(basename(dirname(abspath(path.module))))
}

data "terraform_remote_state" "common" {
backend = "s3"

Expand Down
4 changes: 0 additions & 4 deletions auto_policy_testing/red/vnet/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
location = "northeurope"

tags = {
ComplianceStatus = "red"
}
8 changes: 0 additions & 8 deletions auto_policy_testing/red/vnet/variables.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
variable "location" {
type = string
}

variable "tags" {
type = map(string)
}

variable "remote_state_region" {
type = string
description = "Region where resources will be created"
Expand Down
Loading

0 comments on commit fcc75df

Please sign in to comment.