mirror of https://github.com/hashicorp/packer
parent
08fd0a7e33
commit
2016d6baec
@ -0,0 +1,45 @@
|
||||
|
||||
variable "aws_access_key" {
|
||||
type = string
|
||||
default = ""
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "aws_region" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "aws_secondary_region" {
|
||||
type = string
|
||||
default = "${env("AWS_DEFAULT_REGION")}"
|
||||
}
|
||||
|
||||
variable "aws_secret_key" {
|
||||
type = string
|
||||
default = ""
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "secret_account" {
|
||||
type = string
|
||||
default = "🤷"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
data "amazon-secretsmanager" "autogenerated_1" {
|
||||
name = "sample/app/password"
|
||||
}
|
||||
|
||||
data "amazon-secretsmanager" "autogenerated_2" {
|
||||
key = "api_key"
|
||||
name = "sample/app/passwords"
|
||||
}
|
||||
|
||||
local "password" {
|
||||
sensitive = true
|
||||
expression = "${data.amazon-secretsmanager.autogenerated_1.value}"
|
||||
}
|
||||
|
||||
locals {
|
||||
password_key = "MY_KEY_${data.amazon-secretsmanager.autogenerated_2.value}"
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
{
|
||||
"variables": {
|
||||
"secret_account": "🤷",
|
||||
"aws_region": null,
|
||||
"aws_secondary_region": "{{ env `AWS_DEFAULT_REGION` }}",
|
||||
"aws_secret_key": "",
|
||||
"aws_access_key": "",
|
||||
"password": "{{ aws_secretsmanager `sample/app/password` }}",
|
||||
"password_key": "MY_KEY_{{ aws_secretsmanager `sample/app/passwords` `api_key` }}"
|
||||
},
|
||||
"sensitive-variables": [
|
||||
"aws_secret_key",
|
||||
"aws_access_key",
|
||||
"secret_account",
|
||||
"potato",
|
||||
"password"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in new issue