Skip to content

Commit

Permalink
(feat) initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
denzuko committed Mar 5, 2021
0 parents commit d451367
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM hashicorp/terraform:light AS runner
MAINTAINER "Dwight Spencer (@denzuko)"

LABEL org.label-schema.schema-version = "1.0"
LABEL org.label-schema.name "workstation"
LABEL org.label-schema.description "Terraform workload contianier for assets/workstation"

LABEL org.label-schema.docker.cmd "docker run --rm -ti denzuko/assets/workstation:latest"
LABEL org.label-schema.docker.cmd.prune "docker run --rm -ti denzuko/assets/workstation:latest destroy"
LABEL org.label-schema.docker.cmd.help "docker run --rm -ti denzuko/assets/workstation:latest --help"
LABEL org.label-schema.docker.cmd.debug "docker run --rm -ti denzuko/assets/workstation:latest show"

WORKDIR /app
COPY main.tf variables.tf /app
RUN terraform init && terraform plan
ENTRYPOINT ["/bin/terraform"]
CMD ["apply"]
39 changes: 39 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$VAGRANT_CONFIG_VERSON = 2
Vagrant.require_plugin "vagrant-aws"
Vagrant.require_plugin "vagrant-winrm-syncedfolders"

Vagrant.configure($VAGRANT_CONFIG_VERSION) do |config|
config.vm.box = "dummy"
config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/blob/master/dummy.box?raw=true"
config.vm.communicator = "winrm"
config.vm.guest = :windows

config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]

aws.ami = "ami-fa05b392"
aws.tags = {
'Name' => ENV["ASSET_NAME"],
'net.matrix.orgunit' => "Matrix NOC",
'net.matrix.organization' => "Private Ops",
'net.matrix.commonname' => "cloud",
'net.matrix.locality' => "Dallas",
'net.matrix.state' => "Texas",
'net.matrix.country' => "USA",
'net.matrix.environment' => "<nonprod|production|staging>",
'net.matrix.application' => "infrastructure",
'net.matrix.role' => "application services",
'net.matrix.owner' => "[email protected]",
'net.matrix.customer' => "PVT-01",
'net.matrix.costcenter' => "INT-01"
}

aws.instance_type = "t3.medium"
aws.region = ENV["AWS_DEFAULT_REGION"]
aws.subnet_id = ENV["AWS_SUBNET"]
aws.security_groups = ENV["AWS_SECURITY_GROUPS"]
override.nfs.functional = false
end
end
9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "ecs-windows" {
source = "jjno91/ecs-windows/aws"
version = "0.1.0"
instance_type = "t3.medium"
tags = vars.aws_labels
min_size = 0
max_size = 1
env = "ustx-dev-lab"
}
24 changes: 24 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "keypair" { default = "${env.AWS_KEYPAIR_NAME}"
variable "instance_type" { default = "t2.micro" }
variable "security_groups" { default = "${env.AWS_SECURITY_GROUPS}" }
variable "monitoring" { default = true }
variable "ami_id" { default = "ami-fa05b392" }
variable "subnet_id" { default = "${env.AWS_SUBNET}" }
variable "region" { default = "${env.AWS_DEFAULT_REGION}" }
variable "aws_labels" {
type = "map"
default = {
"net.matrix.orgunit" = "Matrix NOC"
"net.matrix.organization" = "Private Ops"
"net.matrix.commonname" = "cloud"
"net.matrix.locality" = "Dallas"
"net.matrix.state" = "Texas"
"net.matrix.country" = "USA"
"net.matrix.environment" = "${env.ENVIRONMENT}"
"net.matrix.application" = "infrastructure"
"net.matrix.role" = "application services"
"net.matrix.owner" = "[email protected]"
"net.matrix.customer" = "PVT-01"
"net.matrix.costcenter" = "INT-01"
}
}

0 comments on commit d451367

Please sign in to comment.