Created
March 4, 2025 18:55
-
-
Save derrickturk/82b15b375c7186e8e88c3b7350fb9b10 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
data "aws_ami" "latest_spotfire" { | |
most_recent = true | |
owners = ["aws-marketplace"] | |
filter { | |
name = "product-code" | |
values = ["2c7dxpxtbfm3wc7iik24lbll2"] | |
} | |
} | |
resource "aws_instance" "spotfire" { | |
ami = data.aws_ami.latest_spotfire.id | |
instance_type = "m5.large" | |
key_name = "Your Key Name Here" # name in AWS of keypair | |
vpc_security_group_ids = ["${aws_security_group.spotfire.id}"] | |
get_password_data = true | |
tags = { | |
Name = "TIBCO Spotfire Instance" | |
} | |
} | |
resource "aws_security_group" "spotfire" { | |
name = "spotfire" | |
description = "Allow RDP and HTTP traffic from home PC" | |
ingress { | |
from_port = 3389 | |
to_port = 3389 | |
protocol = "tcp" | |
cidr_blocks = ["5.5.5.5/32"] # your IP here | |
} | |
ingress { | |
from_port = 80 | |
to_port = 80 | |
protocol = "tcp" | |
cidr_blocks = ["5.5.5.5/32"] # your IP here | |
} | |
ingress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
self = true | |
} | |
egress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
} |
This file contains hidden or 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
output "public_ip" { | |
value = "${aws_instance.spotfire.public_ip}" | |
} | |
output "public_dns" { | |
value = "${aws_instance.spotfire.public_dns}" | |
} | |
output "windows_username" { | |
value = "Administrator" | |
} | |
output "windows_admin_password" { # use actual keypair file corresponding to selected keypair | |
value = "${rsadecrypt(aws_instance.spotfire.password_data, file("/path/to/your/keypair.pem"))}" | |
} | |
output "spotfire_username" { | |
value = "spotfireadmin" | |
} | |
output "spotfire_password" { | |
value = "${aws_instance.spotfire.id}" | |
} |
This file contains hidden or 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
provider "aws" { | |
region = "us-east-1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment