mirror of
https://github.com/hanzozt/zt.git
synced 2026-11-02 11:38:22 +00:00
- Repo names: ziti-* → zt-* - Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt - Docker images: hanzozt/ziti-* → hanzozt/zt-* - C/Java/JS symbols: ziti_* → zt_* - File and directory names updated
52 lines
1.2 KiB
Terraform
52 lines
1.2 KiB
Terraform
variable "name" {}
|
|
variable "access_key" {}
|
|
variable "secret_key" {}
|
|
variable "environment_tag" { default = "" }
|
|
variable "instance_type" {}
|
|
variable "key_name" {}
|
|
variable "key_path" {}
|
|
variable "region" {}
|
|
variable "security_group_ids" {
|
|
type = list(string)
|
|
}
|
|
variable "ssh_user" { default = "ubuntu" }
|
|
variable "subnet_id" {}
|
|
variable "spot_price" {}
|
|
variable "spot_type" {}
|
|
|
|
output "public_ip" { value = aws_instance.fablab.public_ip }
|
|
output "private_ip" { value = aws_instance.fablab.private_ip }
|
|
|
|
provider "aws" {
|
|
access_key = var.access_key
|
|
secret_key = var.secret_key
|
|
region = var.region
|
|
}
|
|
|
|
data "aws_ami" "ami" {
|
|
most_recent = true
|
|
owners = ["self"]
|
|
|
|
filter {
|
|
name = "name"
|
|
values = ["zt-tests-*"]
|
|
}
|
|
}
|
|
|
|
resource "aws_instance" "fablab" {
|
|
ami = data.aws_ami.ami.id
|
|
instance_type = var.instance_type
|
|
key_name = var.key_name
|
|
vpc_security_group_ids = var.security_group_ids
|
|
subnet_id = var.subnet_id
|
|
associate_public_ip_address = true
|
|
|
|
tags = {
|
|
Name = var.name
|
|
cost_environment = "non-production"
|
|
cost_category = "CICD"
|
|
cost_team_owner = "ADVDEV"
|
|
source = "fablab"
|
|
}
|
|
}
|