123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- data "aws_ami" "standalone_ami" {
- most_recent = true
- filter {
- name = "name"
- values = ["FTD-Splunk-Standalone"]
- }
- owners = ["${data.aws_caller_identity.current.account_id}"]
- }
- resource "aws_instance" "splunk_standalone" {
- ami = "${data.aws_ami.standalone_ami.id}"
- instance_type = "i3.large"
- key_name = "Fred-IO"
-
- vpc_security_group_ids = ["${aws_security_group.splunk_standalone.id}"]
- subnet_id = "${data.terraform_remote_state.network.outputs.subnet0_id}"
- associate_public_ip_address = true
- iam_instance_profile = "Splunk-EC2-Standalone"
- ebs_optimized = true
- root_block_device {
- volume_type = "gp2"
- volume_size = "10"
- encrypted = true
- kms_key_id = "alias/splunk_standalone_ebs"
- }
- ebs_block_device {
- device_name = "/dev/xvdb"
- volume_type = "gp2"
- volume_size = 20
- delete_on_termination = true
- encrypted = true
- kms_key_id = "alias/splunk_standalone_ebs"
- }
- ebs_block_device {
- device_name = "/dev/xvdc"
- volume_type = "gp2"
- volume_size = 2
- delete_on_termination = true
- encrypted = true
- kms_key_id = "alias/splunk_standalone_ebs"
- }
- tags = {
- Name = "Splunk Standalone"
- }
- }
- resource "aws_security_group" "splunk_standalone" {
- name = "splunk_standalone"
- description = "Basic Splunk Ports"
- vpc_id = "${data.terraform_remote_state.network.outputs.vpc_id}"
- ingress {
- from_port = 22
- to_port = 22
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- description = "SSH from any"
- }
- ingress {
- from_port = 80
- to_port = 80
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- description = "HTTP from any"
- }
- ingress {
- from_port = 443
- to_port = 443
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- description = "HTTPS from any"
- }
- ingress {
- from_port = 8000
- to_port = 8000
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- description = "Splunk from any"
- }
- egress {
- from_port = 0
- to_port = 0
- protocol = -1
- cidr_blocks = ["0.0.0.0/0"]
- description = "To Any"
- }
- }
- output "standalone_public_ip" {
- value = aws_instance.splunk_standalone.public_ip
- }
|