Update main.tf
This commit is contained in:
parent
fbc90a3b5f
commit
117cfe24e5
83
main.tf
83
main.tf
|
@ -1,10 +1,10 @@
|
|||
data "aws_ami" "mac" {
|
||||
data "aws_ami" "mac_11" {
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
filter {
|
||||
name = "name"
|
||||
values = [
|
||||
"amzn-ec2-macos-10.15.7-*-*"
|
||||
"amzn-ec2-macos-11.7.4-*-*"
|
||||
]
|
||||
}
|
||||
filter {
|
||||
|
@ -14,6 +14,75 @@ data "aws_ami" "mac" {
|
|||
]
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_ami" "mac_12" {
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
filter {
|
||||
name = "name"
|
||||
values = [
|
||||
"amzn-ec2-macos-12.7.3-*-*"
|
||||
]
|
||||
}
|
||||
filter {
|
||||
name = "owner-alias"
|
||||
values = [
|
||||
"amazon",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_ami" "mac_13" {
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
filter {
|
||||
name = "name"
|
||||
values = [
|
||||
"amzn-ec2-macos-13.7-*-*"
|
||||
]
|
||||
}
|
||||
filter {
|
||||
name = "owner-alias"
|
||||
values = [
|
||||
"amazon",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_ami" "mac_14" {
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
filter {
|
||||
name = "name"
|
||||
values = [
|
||||
"amzn-ec2-macos-14.7-*-*"
|
||||
]
|
||||
}
|
||||
filter {
|
||||
name = "owner-alias"
|
||||
values = [
|
||||
"amazon",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_ami" "mac_15" {
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
filter {
|
||||
name = "name"
|
||||
values = [
|
||||
"amzn-ec2-macos-15.0-*-*"
|
||||
]
|
||||
}
|
||||
filter {
|
||||
name = "owner-alias"
|
||||
values = [
|
||||
"amazon",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
module "vpc" {
|
||||
source = "terraform-aws-modules/vpc/aws"
|
||||
version = "2.64.0"
|
||||
|
@ -44,14 +113,16 @@ resource "aws_security_group" "ssh" {
|
|||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "mac_instance_b" {
|
||||
ami = data.aws_ami.mac.image_id
|
||||
# mac2-m2.metal # 4 performance cores, 4 efficiency cores 8vCPUs 24G Mem 10G Network 8G EBS
|
||||
# mac2-m2pro.metal # 8 performance cores, 4 efficiency cores 12vCPUs 32G Mem 10G Network 8G EBS
|
||||
|
||||
resource "aws_instance" "mac_instance" {
|
||||
ami = data.aws_ami.mac_15.image_id
|
||||
instance_type = "mac1.metal"
|
||||
key_name = var.ssh_key_name
|
||||
availability_zone = "eu-west-1b"
|
||||
host_id = "h-002de77f93125e3c2"
|
||||
subnet_id = module.vpc.public_subnets[1]
|
||||
vpc_security_group_ids = [aws_security_group.ssh.id]
|
||||
}
|
||||
|
||||
|
||||
# ssh -i private_key.pem ec2-user@52.53.52.53
|
||||
|
|
Loading…
Reference in New Issue