4
0
Fork 0

updated workflows

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
Mark Bolwell 2022-08-05 11:41:55 +01:00
parent f76919734e
commit 9e9cc7c079
No known key found for this signature in database
GPG key ID: F734FDFC154B83FB
7 changed files with 57 additions and 389 deletions

View file

@ -5,9 +5,6 @@ provider "aws" {
// Create a security group with access to port 22 and port 80 open to serve HTTP traffic
data "aws_vpc" "default" {
default = true
}
resource "random_id" "server" {
keepers = {
@ -19,8 +16,8 @@ resource "random_id" "server" {
}
resource "aws_security_group" "github_actions" {
name = "${var.namespace}-${random_id.server.hex}"
vpc_id = data.aws_vpc.default.id
name = "${var.namespace}-${random_id.server.hex}-SG"
vpc_id = aws_vpc.Main.id
ingress {
from_port = 22
@ -43,7 +40,8 @@ resource "aws_security_group" "github_actions" {
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "${var.namespace}-SG"
Environment = "${var.environment}"
Name = "${var.namespace}-SG"
}
}
@ -56,6 +54,7 @@ resource "aws_instance" "testing_vm" {
instance_type = var.instance_type
tags = var.instance_tags
vpc_security_group_ids = [aws_security_group.github_actions.id]
subnet_id = aws_subnet.Main.id
root_block_device {
delete_on_termination = true
}
@ -80,3 +79,4 @@ resource "local_file" "inventory" {
audit_git_version: devel
EOF
}