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