Launch an AWS instance remotely

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.64.0"
}
}
}

provider "aws" {
region = "eu-north-1"

# ToDo use ENV Variables instead
shared_credentials_file = "********"
profile = "testing"
}

resource "aws_instance" "ami-0fe8bec493a81c7da" {
ami = var.ami
instance_type = var.instance_type


# TODO
# network_interface {
# network_interface_id = var.network_interface_id
# device_index = 0
# }

credit_specification {
cpu_credits = "unlimited"
}
}

variable "network_interface_id" {
type = string
default = "vpc-0bb717b517a4bdd39"
}

variable "ami" {
type = string
default = "ami-0fe8bec493a81c7da"
}

variable "instance_type" {
type = string
default = "t3.micro"
}



From bland to brand, get your business online
Website hosting and design by Dedicated to Servers, contact info@dedicatedtoservers.com

Click to send a quick inquiry

All rights Reserved © 2014-2024