fleet/infrastructure/loadtesting/terraform/ecr.tf
Robert Fairburn 1f1ee964ab
Improve APM in Loadtesting (#7061)
* Initial cloudwatch stub for loadtesting/apm

* Fix duplicate policy attachment name

* elastichsearch pull keys from ssh secret

* Set aws region for run-ansible

* Alternate way to specify region in run-ansible

* Fix elasticsearch_ansible ssh file modes

* Cloudwatch agent config elasticsearch

* Fix ansible indents

* Set platform to linux/amd64 for loadtesting docker image

* Use /dev/sdb on elasticsearch/apm

* fixup

* elasticsearch volume mounted

* elasticapm increase shards and size

* Increase elasticapm instance size

* Document how to get the IP for APM ec2 instance
2022-08-10 12:33:49 -05:00

53 lines
1.3 KiB
HCL

resource "aws_kms_key" "main" {
description = "${local.prefix}-${random_pet.db_secret_postfix.id}"
deletion_window_in_days = 10
enable_key_rotation = true
}
resource "aws_ecr_repository" "fleet" {
name = local.prefix
image_tag_mutability = "IMMUTABLE"
image_scanning_configuration {
scan_on_push = true
}
encryption_configuration {
encryption_type = "KMS"
kms_key = aws_kms_key.main.arn
}
}
data "aws_ecr_authorization_token" "token" {}
resource "docker_registry_image" "fleet" {
name = "${aws_ecr_repository.fleet.repository_url}:${var.tag}-${split(":", data.docker_registry_image.dockerhub.sha256_digest)[1]}"
keep_remotely = true
build {
context = "${path.cwd}/docker/"
build_args = {
TAG = var.tag
}
pull_parent = true
}
}
data "docker_registry_image" "dockerhub" {
name = "fleetdm/fleet:${var.tag}"
}
resource "docker_registry_image" "loadtest" {
name = "${aws_ecr_repository.fleet.repository_url}:loadtest-${var.tag}-${split(":", data.docker_registry_image.dockerhub.sha256_digest)[1]}"
keep_remotely = true
build {
context = "${path.cwd}/docker/"
dockerfile = "loadtest.Dockerfile"
platform = "linux/amd64"
build_args = {
TAG = var.tag
}
pull_parent = true
}
}