Skip to content

Instantly share code, notes, and snippets.

@hyperius
Created May 30, 2019 13:56
Show Gist options
  • Save hyperius/9d965604fc4d4cf10d822888ba98861a to your computer and use it in GitHub Desktop.
Save hyperius/9d965604fc4d4cf10d822888ba98861a to your computer and use it in GitHub Desktop.
resource "aws_ebs_volume" "ssp_api_docker" {
count = "${aws_instance.ssp_api.count}"
availability_zone = "${element(split(",", lookup(var.availability_zones, var.region)), count.index)}"
size = "${var.ebs_volume_ssp_api_docker_size}"
type = "${var.ebs_volume_ssp_api_docker_type}"
encrypted = true
kms_key_id = "${var.ebs_volume_ssp_api_docker_kms_key_id}"
tags {}
}
resource "consul_key_prefix" "ssp_api" {
count = "${aws_instance.ssp_api.count}"
path_prefix = "..../"
subkeys = {
"ebs/docker/availability_zone" = "${aws_ebs_volume.ssp_api_docker.*.availability_zone[count.index]}"
"ebs/docker/encrypted" = "${aws_ebs_volume.ssp_api_docker.*.encrypted[count.index]}"
"ebs/docker/kms_key_id" = "${aws_ebs_volume.ssp_api_docker.*.kms_key_id[count.index]}"
"ebs/docker/size" = "${aws_ebs_volume.ssp_api_docker.*.size[count.index]}"
"ebs/docker/volume_id" = "${aws_ebs_volume.ssp_api_docker.*.id[count.index]}"
"ebs/docker/volume_type" = "${aws_ebs_volume.ssp_api_docker.*.type[count.index]}"
"ebs/docker/device_name" = "${aws_volume_attachment.ssp_api_docker.*.device_name[count.index]}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment