forked from jetbrains-infra/terraform-aws-ecr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
33 lines (32 loc) · 824 Bytes
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
variable "name" {
description = "Name of the repository."
}
variable "tags" {
description = "Tags."
type = map(string)
}
variable "mutable" {
default = true
}
variable "scan" {
default = false
}
variable "share_with_accounts" {
type = list(string)
default = []
}
data "aws_region" "current" {}
locals {
name = var.name
region = data.aws_region.current.name
title = title(replace(replace(local.name, "-", ""), " ", ""))
mutability = var.mutable ? "MUTABLE" : "IMMUTABLE"
scan = var.scan
accounts = formatlist("arn:aws:iam::%s:root", var.share_with_accounts)
tags = merge({
Name = local.name
Module = "ECR Repository"
ModuleVersion = "v0.2.2"
ModuleSource = "https://github.com/jetbrains-infra/terraform-aws-ecr/"
}, var.tags)
}