From eee5afa0a1872a5643cfcc6e7dce98c12fed4ee8 Mon Sep 17 00:00:00 2001 From: Justin Ryburn Date: Fri, 6 Dec 2024 09:26:28 -0600 Subject: [PATCH] Revert "ksynth on ec2 instance (#61)" This reverts commit 867d757aa7c0b689b3c32465ab917dee4a2656c6. --- synthetics_AWS/terraform/README.md | 37 ------------------------- synthetics_AWS/terraform/ec2.tf | 40 --------------------------- synthetics_AWS/terraform/main.tf | 12 -------- synthetics_AWS/terraform/variables.tf | 35 ----------------------- 4 files changed, 124 deletions(-) delete mode 100644 synthetics_AWS/terraform/README.md delete mode 100644 synthetics_AWS/terraform/ec2.tf delete mode 100644 synthetics_AWS/terraform/main.tf delete mode 100644 synthetics_AWS/terraform/variables.tf diff --git a/synthetics_AWS/terraform/README.md b/synthetics_AWS/terraform/README.md deleted file mode 100644 index 9b6ccd4..0000000 --- a/synthetics_AWS/terraform/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Synthetics agent deployment on AWS ec2 instance - -The module creates ec2 instance with provided configuration and deploys `ksynth` agent. - -## Requirements - -| Name | Version | -|--------------|---------| -| terraform | ~> 1.0 | -| aws provider | ~> 4.0 | -| AWS CLI | ~> 4.0 | - - -## Inputs - -| Name | Description | Type | Default | Required | -|------------------------|--------------------------------------------------|--------------|---------|----------| -| vpc_security_group_ids | List of security groups IDs | list(string) | | true | -| plan_id | Kentik plan ID | string | | true | -| region | Specifies AWS provider region | string | | false | -| key_name | Key name of the Key Pair to use for the instance | string | | false | -| iam_instance_profile | IAM role ID | string | | false | -| subnet_id | Subnet ID | string | | false | - - -## Usage - - ```bash - terraform init - terraform apply \ - -var='vpc_security_group_ids=[""]' \ - -var='plan_id=' \ - -var='region=' \ - -var='key_name=' \ - -var='iam_instance_profile=' \ - -var='subnet_id=' - ``` \ No newline at end of file diff --git a/synthetics_AWS/terraform/ec2.tf b/synthetics_AWS/terraform/ec2.tf deleted file mode 100644 index 6789fe8..0000000 --- a/synthetics_AWS/terraform/ec2.tf +++ /dev/null @@ -1,40 +0,0 @@ -data "aws_ami" "ubuntu" { - most_recent = true - - filter { - name = "name" - # Make sure that given ami is not deprecated. - values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - owners = ["099720109477"] -} - -resource "aws_instance" "instance" { - ami = data.aws_ami.ubuntu.id - instance_type = "t2.micro" - - iam_instance_profile = var.iam_instance_profile - key_name = var.key_name - vpc_security_group_ids = var.vpc_security_group_ids - subnet_id = var.subnet_id - - user_data = <> /etc/default/ksynth -systemctl start ksynth -# Restart agent after setting variables -systemctl stop ksynth && systemctl start ksynth -EOF - - tags = { - Name = "ksynth_agent" - } -} \ No newline at end of file diff --git a/synthetics_AWS/terraform/main.tf b/synthetics_AWS/terraform/main.tf deleted file mode 100644 index 6e34dbf..0000000 --- a/synthetics_AWS/terraform/main.tf +++ /dev/null @@ -1,12 +0,0 @@ -terraform { - required_version = "~> 1.0" - required_providers { - aws = { - version = "~> 4.0" - } - } -} - -provider "aws" { - region = var.region -} \ No newline at end of file diff --git a/synthetics_AWS/terraform/variables.tf b/synthetics_AWS/terraform/variables.tf deleted file mode 100644 index 8d3bac8..0000000 --- a/synthetics_AWS/terraform/variables.tf +++ /dev/null @@ -1,35 +0,0 @@ -variable "key_name" { - description = "Key name of the Key Pair to use for the instance" - type = string - default = "" -} - -variable "iam_instance_profile" { - description = "IAM role ID" - type = string - default = "" -} - -variable "subnet_id" { - description = "Subnet ID" - type = string - default = "" -} - -variable "vpc_security_group_ids" { - description = "List of security groups IDs" - type = list(string) - default = [""] -} - -variable "plan_id" { - description = "Kentik plan ID" - type = string - default = "" -} - -variable "region" { - description = "Specifies AWS provider region" - type = string - default = "" -} \ No newline at end of file