UPD: removing unnecessary input variables
This commit is contained in:
parent
d359982fb5
commit
af5909e39b
@ -1,5 +1,4 @@
|
||||
variable "aws-region" {}
|
||||
variable "aws-region-short" {}
|
||||
variable "customer-name" {}
|
||||
variable "project" {}
|
||||
variable "application" {}
|
||||
@ -30,7 +29,12 @@ terraform {
|
||||
}
|
||||
|
||||
locals {
|
||||
resource-prefix = "${var.environment}-${var.aws-region-short}-${var.customer-name}-${var.project}"
|
||||
aws-region-short = lookup(module.aws-region-short.region-map, var.aws-region)
|
||||
resource-prefix = "${var.environment}-${local.aws-region-short}-${var.customer-name}-${var.project}"
|
||||
}
|
||||
|
||||
module aws-region-short {
|
||||
source = "git::https://xpk.headdesk.me/git/xpk/terraform.aws-baseline-infra//modules/util/aws-region-short"
|
||||
}
|
||||
|
||||
module "terraform-state-store" {
|
||||
@ -38,7 +42,6 @@ module "terraform-state-store" {
|
||||
enable-bucket-versioning = true
|
||||
transition-ia-days = 30
|
||||
bucket-acl = "private"
|
||||
resource-prefix = local.resource-prefix
|
||||
ddb-table-name = "${local.resource-prefix}-tflock"
|
||||
bucket-name = "${local.resource-prefix}-tfstate"
|
||||
}
|
@ -85,8 +85,8 @@ resource "aws_s3_bucket_policy" "bucket-policy" {
|
||||
"Action": "s3:*",
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::${var.resource-prefix}-tfstate/*",
|
||||
"arn:aws:s3:::${var.resource-prefix}-tfstate"
|
||||
"arn:aws:s3:::${var.bucket-name}/*",
|
||||
"arn:aws:s3:::${var.bucket-name}-tfstate"
|
||||
],
|
||||
"Principal": {
|
||||
"AWS": [
|
||||
|
@ -13,4 +13,3 @@ variable "enable-bucket-versioning" {
|
||||
default = true
|
||||
}
|
||||
variable "bucket-name" {}
|
||||
variable "resource-prefix" {}
|
Loading…
Reference in New Issue
Block a user