HistoryPurge: Clearing 17 old commits
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
resource "aws_instance" "example" {
|
||||
ami = "ami-0157c3cc39a1c5cc0"
|
||||
instance_type = "t4g.large"
|
||||
subnet_id = "subnet-0927ba1b06ccfe6c5"
|
||||
key_name = aws_key_pair.this.key_name
|
||||
|
||||
# IMDSv2 requirement
|
||||
dynamic "metadata_options" {
|
||||
for_each = var.disable_secure_idmsv2 == false ? { set_idmsv2 : true } : {}
|
||||
content {
|
||||
http_endpoint = "enabled"
|
||||
http_tokens = "required"
|
||||
http_put_response_hop_limit = 2
|
||||
}
|
||||
}
|
||||
tags = { Name : var.name }
|
||||
}
|
||||
|
||||
resource "tls_private_key" "this" {
|
||||
algorithm = "ED25519"
|
||||
}
|
||||
|
||||
resource "aws_key_pair" "this" {
|
||||
key_name = "${var.name}-sshkey"
|
||||
public_key = tls_private_key.this.public_key_openssh
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
provider "aws" {
|
||||
region = "ap-east-1"
|
||||
|
||||
default_tags {
|
||||
tags = {
|
||||
ServiceProvider = "RackspaceTechnology"
|
||||
Environment = "Training"
|
||||
Project = "Iac"
|
||||
TerraformMode = "managed"
|
||||
Owner = "ken2026"
|
||||
TerraformDir = "${reverse(split("/", path.cwd))[1]}/${reverse(split("/", path.cwd))[0]}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output "last-updated" {
|
||||
value = timestamp()
|
||||
}
|
||||
|
||||
terraform {
|
||||
required_version = ">= 1.3.0"
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
variable "name" {
|
||||
type = string
|
||||
description = "Name of Ec2 instance"
|
||||
}
|
||||
|
||||
variable "disable_secure_idmsv2" {
|
||||
type = bool
|
||||
default = false
|
||||
description = "Allow use of insecure idmsv1. Default is false."
|
||||
}
|
||||
Reference in New Issue
Block a user