terraform refactor - update EC2 key

This commit is contained in:
Grzegorz Huber
2024-06-06 17:28:21 +02:00
parent fd5f5dee93
commit c868c7fbca
5 changed files with 9 additions and 19 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ resource "aws_instance" "streamlit_server" {
vpc_security_group_ids = data.aws_security_groups.security_groups.ids
iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile.name
associate_public_ip_address = false
key_name = "tf-uat-key" # Created using TF and uploaded to S3. Prerequisite
key_name = var.key_name
root_block_device {
volume_size = 30 # Variable
encrypted = true # Mandatory
+2 -13
View File
@@ -69,16 +69,5 @@ variable "acm_arns" {
}
}
#variable "secret_key" {
# type = string
#}
#
## required
#variable "access_key" {
# type = string
#}
#
## required
#variable "token" {
# type = string
#}
variable "key_name" {
}
+2 -1
View File
@@ -1 +1,2 @@
vpc_id = "vpc-0f9d7c913f6522079"
vpc_id = "vpc-0f9d7c913f6522079"
key_name = "tf-test-key"
+2 -1
View File
@@ -1 +1,2 @@
vpc_id = "vpc-0392396d0e7bdd77f"
vpc_id = "vpc-0392396d0e7bdd77f"
key_name = "tf-uat-key"
+1 -2
View File
@@ -54,7 +54,7 @@ locals {
# global prefix
global_prefix = "${var.project_name}-${local.region_short_name}-${local.environment_short_name}-infra"
# Resource prefix
iam_role_prefix = "${local.global_prefix}-rol"
@@ -68,7 +68,6 @@ locals {
}
}
provider "aws" {
# profile = var.aws_profile
default_tags {
tags = local.common_tags