-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c152f01
commit df16a71
Showing
12 changed files
with
278 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,7 @@ | |
*__pycache__ | ||
|
||
sessions | ||
.terraform/ | ||
.terraform.lock.hcl | ||
|
||
#tools |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
locals { | ||
block_device_path = "/dev/sdh" | ||
} | ||
|
||
resource "aws_iam_instance_profile" "unity_mmgis_instance_profile" { | ||
name = "unity-mmgis-instance-profile-tf" | ||
|
||
role = var.role | ||
|
||
tags = { | ||
Name = "unity_mmgis_instance_profile" | ||
} | ||
} | ||
|
||
resource "aws_ebs_volume" "persistent" { | ||
availability_zone = aws_instance.unity_mmgis_instance.availability_zone | ||
size = var.persistent_volume_size_gb | ||
} | ||
|
||
resource "aws_volume_attachment" "persistent" { | ||
device_name = local.block_device_path | ||
volume_id = aws_ebs_volume.persistent.id | ||
instance_id = aws_instance.unity_mmgis_instance.id | ||
} | ||
|
||
|
||
resource "aws_instance" "unity_mmgis_instance" { | ||
ami = var.ami | ||
instance_type = var.instance_type | ||
|
||
tags = { | ||
Name = "unity-mmgis-instance-tf" | ||
} | ||
|
||
key_name = var.key_name | ||
|
||
vpc_security_group_ids = [var.sg_id] | ||
|
||
subnet_id = var.subnet_id | ||
|
||
iam_instance_profile = aws_iam_instance_profile.unity_mmgis_instance_profile.name | ||
|
||
user_data = file("./modules/ec2-docker/add-mmgis.sh") | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
data "aws_ssm_parameter" "vpc_id" { | ||
name = "/unity/account/network/vpc_id" | ||
} | ||
|
||
data "aws_ssm_parameter" "subnet_list" { | ||
name = "/unity/account/network/subnet_list" | ||
} | ||
|
||
#data "aws_ssm_parameter" "u-cs-ecs" { | ||
# name = "/unity/account/ecs/execution_role_arn" | ||
#} | ||
|
||
|
||
locals { | ||
subnet_map = jsondecode(data.aws_ssm_parameter.subnet_list.value) | ||
subnet_ids = nonsensitive(local.subnet_map["private"]) | ||
public_subnet_ids = nonsensitive(local.subnet_map["public"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.