Skip to content

Commit

Permalink
fully convert to 0.12; update configs to remove to-be deprecated syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Badrak committed Dec 5, 2019
1 parent fbbc6c5 commit e99dc12
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
30 changes: 16 additions & 14 deletions ois-scanner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,32 @@ locals {
}

resource "aws_security_group" "this_security_group" {
name = "${var.name}"
description = "${local.description}"
vpc_id = "${var.vpc_id}"
name = var.name
description = local.description
vpc_id = var.vpc_id

ingress {
description = "ALL: ${local.description}"
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = "${local.ipv4_cidr}"
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = local.ipv4_cidr
}

egress {
description = "ALL: ${local.description}"
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = [ "0.0.0.0/0" ]
from_port = 0
to_port = 0
protocol = -1
cidr_blocks = ["0.0.0.0/0"]
}

tags = "${merge(
map("Name", "sg-${var.name}"),
tags = merge(
{
"Name" = "sg-${var.name}"
},
var.tags,
)}"
)
}

# - site: bcc
Expand Down
5 changes: 3 additions & 2 deletions ois-scanner/output.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
output "this_security_group_id" {
description = "Created security group ID"
value = "${aws_security_group.this_security_group.id}"
value = aws_security_group.this_security_group.id
}

output "this_security_group_arn" {
description = "Created security group ARN"
value = "${aws_security_group.this_security_group.arn}"
value = aws_security_group.this_security_group.arn
}

9 changes: 5 additions & 4 deletions ois-scanner/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ variable "vpc_id" {

variable "name" {
description = "Security group Name"
default = "ois-scanner"
default = "ois-scanner"
}

variable "tags" {
description = "Extra security group tags"

type = "map"
default = {
type = map(string)
default = {
"CostAllocation" = "csvd:infrastructure"
"Environment" = "csvd-infrastructure"
"Environment" = "csvd-infrastructure"
}
}

4 changes: 4 additions & 0 deletions ois-scanner/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
4 changes: 2 additions & 2 deletions rds-mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "aws_security_group" "this_security_group" {
for_each = local.ports
iterator = p
content {
description = "${local.description}"
description = local.description
from_port = p.value[0]
to_port = p.value[1]
protocol = p.value[2]
Expand All @@ -53,5 +53,5 @@ resource "aws_security_group" "this_security_group" {
tags = merge(
map("Name", local.name),
var.tags,
)
)
}
4 changes: 4 additions & 0 deletions rds-mssql/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}

0 comments on commit e99dc12

Please sign in to comment.