Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: app's ssm parameters creation #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,15 @@ variable "redirects" {
description = "Map of path redirects to add to the listener"
default = {}
}

variable "ssm_parameters_secure_strings" {
type = any
default = []
description = "List of app's secure variables to be created in SSM Parameter Store"
}

variable "ssm_parameters_strings" {
type = any
default = {}
description = "List of objects of app's variables to create in SSM Parameter Store"
}
23 changes: 23 additions & 0 deletions ssm.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource "aws_ssm_parameter" "secure_string" {
for_each = toset(var.ssm_parameters_secure_strings)
name = "/ecs/${var.cluster_name}/${var.name}/${each.key}"
description = each.value
type = "SecureString"
value = "PLACEHOLDER"

lifecycle {
ignore_changes = [value]
}
}

resource "aws_ssm_parameter" "string" {
for_each = var.ssm_parameters_strings
name = "/ecs/${var.cluster_name}/${var.name}/${each.key}"
description = each.key
type = "String"
value = each.value

lifecycle {
ignore_changes = [value]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably don't need ignore_changes here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, you're right.

}
}