NEW: ec2 with ssm instance role
This commit is contained in:
parent
c131ed84f0
commit
408efc4403
14
tf-modulised/ec2-ssm/ec2.tf
Normal file
14
tf-modulised/ec2-ssm/ec2.tf
Normal file
@ -0,0 +1,14 @@
|
||||
resource "aws_instance" "web" {
|
||||
ami = "ami-49bbfa38"
|
||||
instance_type = "t3.micro"
|
||||
key_name = "kfong-aws"
|
||||
vpc_security_group_ids = ["sg-053612d40f966eec7"]
|
||||
subnet_id = "subnet-0a4edc273558afaab"
|
||||
associate_public_ip_address = true
|
||||
iam_instance_profile = "AmazonSSMRoleForInstancesQuickSetup"
|
||||
|
||||
tags = {
|
||||
Name = "kf-ssm-test"
|
||||
ssm-enabled = "yes"
|
||||
}
|
||||
}
|
10
tf-modulised/ec2-ssm/provider.tf
Normal file
10
tf-modulised/ec2-ssm/provider.tf
Normal file
@ -0,0 +1,10 @@
|
||||
variable "aws_access_key" {}
|
||||
variable "aws_secret_key" {}
|
||||
variable "aws_region" {}
|
||||
|
||||
provider "aws" {
|
||||
access_key = var.aws_access_key
|
||||
secret_key = var.aws_secret_key
|
||||
region = var.aws_region
|
||||
version = ">= 2.28.1"
|
||||
}
|
Loading…
Reference in New Issue
Block a user