Cloudfront blue green (#263)

This commit is contained in:
Robert Fairburn authored and GitHub committed 2026-07-10 02:41:57 -05:00
1 parent f4a67ec750
commit a4813b4242
4 files changed
+156 -19

No files matched your search

@@ -26,14 +26,46 @@ variable "public_key_id" {
}
}
variable "private_key" {
description = "Private key used for signed URLs"
variable "keypairs" {
description = "Map of named keypairs for blue-green key rotation. Each value must contain `public_key` and `private_key`. When set, `public_key` and `private_key` variables are ignored."
type = map(object({
public_key = string
private_key = string
}))
default = null
validation {
condition = var.keypairs != null || (var.public_key != null && var.private_key != null)
error_message = "Either keypairs must be set, or both public_key and private_key must be provided."
}
validation {
condition = var.keypairs == null || var.key_group_id == null
error_message = "keypairs cannot be used with key_group_id. Blue-green key rotation requires the module to manage the CloudFront key group."
}
}
variable "active_keypair_name" {
description = "Name of the keypair in `keypairs` (or `\"current\"` when using legacy inputs) whose keys populate the Secrets Manager secret. All keypairs in the map are added to the CloudFront key group so signed URLs from any retained key remain valid."
type = string
default = "current"
validation {
condition = var.keypairs == null ? true : contains(keys(var.keypairs), var.active_keypair_name)
error_message = "active_keypair_name must be a key present in the keypairs map."
}
}
variable "private_key" {
description = "Private key used for signed URLs. Deprecated: use `keypairs` instead."
type = string
default = null
}
variable "public_key" {
description = "Public key used for signed URLs"
description = "Public key used for signed URLs. Deprecated: use `keypairs` instead."
type = string
default = null
}
variable "s3_bucket" {