File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 2
2
# # Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
3
3
# ###----------------------------------------------------------------------------------
4
4
provider "aws" {
5
- region = " eu -west-1"
5
+ region = " us -west-1"
6
6
}
7
7
8
8
locals {
@@ -31,7 +31,7 @@ module "public_subnets" {
31
31
name = " public-subnet"
32
32
environment = local. environment
33
33
label_order = local. label_order
34
- availability_zones = [" eu -west-1b" , " eu -west-1c" ]
34
+ availability_zones = [" us -west-1b" , " us -west-1c" ]
35
35
vpc_id = module. vpc . vpc_id
36
36
cidr_block = module. vpc . vpc_cidr_block
37
37
type = " public"
@@ -91,7 +91,7 @@ module "ec2" {
91
91
ssh_allowed_ports = [22 ]
92
92
# Instance
93
93
instance_count = 1
94
- ami = " ami-08d658f84a6d84a80 "
94
+ ami = " ami-0f8e81a3da6e2510a "
95
95
instance_type = " t2.nano"
96
96
97
97
# Keypair
Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ resource "aws_kms_key" "default" {
120
120
tags = module. labels . tags
121
121
}
122
122
123
+ data "aws_caller_identity" "this" {}
124
+
123
125
resource "aws_kms_alias" "default" {
124
126
count = var. enable && var. kms_key_enabled && var. kms_key_id == " " ? 1 : 0
125
127
name = coalesce (var. alias , format (" alias/%v" , module. labels . id ))
@@ -133,12 +135,11 @@ data "aws_iam_policy_document" "kms" {
133
135
effect = " Allow"
134
136
principals {
135
137
type = " AWS"
136
- identifiers = [" * " ]
138
+ identifiers = [format ( " arn:aws:iam::%s:root " , data . aws_caller_identity . this . account_id ) ]
137
139
}
138
140
actions = [" kms:*" ]
139
141
resources = [" *" ]
140
142
}
141
-
142
143
}
143
144
144
145
# #----------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ variable "cpu_core_count" {
234
234
235
235
variable "iam_instance_profile" {
236
236
type = string
237
- default = " "
237
+ default = null
238
238
description = " The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile."
239
239
}
240
240
@@ -495,12 +495,6 @@ variable "public_key" {
495
495
sensitive = true
496
496
}
497
497
498
- variable "key_path" {
499
- type = string
500
- default = " "
501
- description = " Name (e.g. `~/.ssh/id_rsa.pub`)."
502
- }
503
-
504
498
# ##### spot
505
499
variable "spot_instance_enabled" {
506
500
type = bool
You can’t perform that action at this time.
0 commit comments