Skip to content

Instantly share code, notes, and snippets.

@azolotko
Last active February 1, 2019 17:36
Show Gist options
  • Save azolotko/ffea3a9f9b14fa8d65438bd710c05019 to your computer and use it in GitHub Desktop.
Save azolotko/ffea3a9f9b14fa8d65438bd710c05019 to your computer and use it in GitHub Desktop.
private val vpc = Vpc("demo-vpc", "172.101.0.0/16")
private val subnet = Subnet("demo-subnet", "172.101.0.0/24", vpc)
private val sshPermission = new IpPermission()
.withIpv4Ranges(new IpRange().withCidrIp("0.0.0.0/32"))
.withIpProtocol("tcp")
.withFromPort(22)
.withToPort(22)
private val key = Key("demo-key")
private val securityGroup =
SecurityGroup("demo-instance-sg",
"demo-instance-sg",
vpc,
Seq(sshPermission))
private val debianStretchImageId = "ami-0bd9223868b4778d7"
private val demoHost =
EC2LinuxInstance("demo-instance",
InstanceType.T3Micro,
Regions.US_EAST_1,
debianStretchImageId,
securityGroup,
subnet,
key)
private val h2Cluster = H2Cluster(H2ServerHost("demo-h2-1", demoHost))
private val cassandraCluster = CassandraCluster(
CassandraHost("demo-cassandra-1", demoHost))
private val receiver =
Receiver(ReceiverHost("demo-receiver-1", demoHost),
h2Cluster,
cassandraCluster)
private val webApp =
WebApp(WebAppHost("demo-webapp-1", demoHost), h2Cluster, cassandraCluster)
private val cluster = ObservatoryCluster("demo", receiver, webApp)
deploy(cluster)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment