File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
multi-arch-builders/provisioning/aarch64 Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -44,5 +44,5 @@ Make sure your AMI user has access to this policies:
4444 # If you plan to make changes to the code as modules/plugins, go ahead and run it:
4545 tofu init -upgrade
4646 # To destroy it run:
47- tofu destroy -target aws_instance.coreos-multiarch -builder-aarch64
47+ tofu destroy -target aws_instance.coreos-aarch64 -builder
4848```
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ provider "aws" {}
1919provider "ct" {}
2020provider "http" {}
2121
22+ variable "project" {
23+ type = string
24+ default = " coreos-aarch64-builder"
25+ }
26+
27+
2228# Get ignition created for the multiarch builder
2329resource "null_resource" "butane" {
2430 provisioner "local-exec" {
@@ -41,9 +47,9 @@ locals {
4147 ami = lookup (jsondecode (data. http . stream_metadata . body ). architectures . aarch64 . images . aws . regions , data. aws_region . aws_region . name ). image
4248}
4349
44- resource "aws_instance" "coreos-multiarch -builder-aarch64 " {
50+ resource "aws_instance" "coreos-aarch64 -builder" {
4551 tags = {
46- Name = " coreos-aarch64-builder -${ formatdate (" YYYYMMDD" , timestamp ())} "
52+ Name = " ${ var . project } -${ formatdate (" YYYYMMDD" , timestamp ())} "
4753 }
4854 ami = local. ami
4955 user_data = file (" coreos-aarch64-builder.ign" )
@@ -57,5 +63,5 @@ resource "aws_instance" "coreos-multiarch-builder-aarch64" {
5763}
5864
5965output "instance_ip_addr" {
60- value = aws_instance. coreos-multiarch -builder-aarch64 . private_ip
66+ value = aws_instance. coreos-aarch64 -builder . private_ip
6167}
Original file line number Diff line number Diff line change 11resource "aws_security_group" "sg" {
2- name = " coreos-multiarch-aarch64 -security-group"
2+ name = " ${ var . project } -security-group"
33 description = " Allow SSH inbound traffic only"
44 vpc_id = var. aws_vpc_prod
55
@@ -10,15 +10,15 @@ resource "aws_security_group" "sg" {
1010 protocol = " tcp"
1111 cidr_blocks = [" 0.0.0.0/0" ]
1212 }
13-
13+
1414 egress {
1515 from_port = 0
1616 to_port = 0
1717 protocol = " -1"
1818 cidr_blocks = [" 0.0.0.0/0" ]
1919 }
20-
20+
2121 tags = {
22- Name = " coreos-multiarch-aarch64 -security-group"
22+ Name = " ${ var . project } -security-group"
2323 }
2424}
You can’t perform that action at this time.
0 commit comments