diff --git a/.travis.yml b/.travis.yml index 5051bab0e..3cd5f7ea9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,3 +32,5 @@ deploy: on: tags: true +after_deploy: + - curl -X POST -F token="$GITLAB_PIPELINE_TOKEN" -F ref=master "$GITLAB_PIPELINE_URL" diff --git a/api/backend/ecs/environment_manager.go b/api/backend/ecs/environment_manager.go index 24d419dec..7e5b1a01c 100644 --- a/api/backend/ecs/environment_manager.go +++ b/api/backend/ecs/environment_manager.go @@ -201,9 +201,9 @@ func (e *ECSEnvironmentManager) CreateEnvironment( ecsRole := config.AWSECSInstanceProfile() keyPair := config.AWSKeyPair() launchConfigurationName := ecsEnvironmentID.LaunchConfigurationName() - volSizes := map[string]int{} - if operatingSystem == "linux" { - volSizes["/dev/xvda"] = 8 + volSizes := make(map[string]int) + if operatingSystem == "linux" { + volSizes["/dev/xvda"] = 30; } else { volSizes["/dev/sda1"] = 200 } diff --git a/api/backend/ecs/environment_manager_test.go b/api/backend/ecs/environment_manager_test.go index e690141aa..7a15ee989 100644 --- a/api/backend/ecs/environment_manager_test.go +++ b/api/backend/ecs/environment_manager_test.go @@ -381,7 +381,7 @@ func TestCreateEnvironment(t *testing.T) { reporter.AssertEqualf("m3.medium", *instanceType, "Instance Type") reporter.AssertEqualf(config.TEST_AWS_KEY_PAIR, *keyName, "KeyPair") reporter.AssertEqualf(securityGroupID, *securityGroups[0], "SecurityGroupID 0") - reporter.AssertEqualf(volSizes, map[string]int{"/dev/xvda": 8}, "Volume Sizes") + reporter.AssertEqualf(volSizes, map[string]int{"/dev/xvda": 30}, "Volume Sizes") return nil } diff --git a/setup/module/api/core.tf b/setup/module/api/core.tf index 584972000..abdd44c55 100644 --- a/setup/module/api/core.tf +++ b/setup/module/api/core.tf @@ -112,7 +112,17 @@ data "aws_ami" "linux" { filter { name = "name" - values = ["amzn-ami-2018.03.20201130-amazon-ecs-optimized"] + values = ["amzn2-ami-ecs-hvm-*"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] } } diff --git a/setup/module/api/environment.tf b/setup/module/api/environment.tf index eee254793..0cd4ad196 100644 --- a/setup/module/api/environment.tf +++ b/setup/module/api/environment.tf @@ -35,11 +35,18 @@ data "template_file" "user_data" { resource "aws_launch_configuration" "api" { name_prefix = "l0-${var.name}-api-" image_id = "${data.aws_ami.linux.id}" - instance_type = "t2.medium" + instance_type = "t3.medium" security_groups = ["${aws_security_group.api_env.id}"] iam_instance_profile = "${aws_iam_instance_profile.ecs.id}" user_data = "${data.template_file.user_data.rendered}" key_name = "${var.ssh_key_pair}" + ebs_optimized = true + + root_block_device { + delete_on_termination = true + volume_type = "gp2" + volume_size = "30" + } lifecycle { create_before_destroy = true