eotk: deploy new module

This commit is contained in:
Iain Learmonth 2022-04-25 12:58:49 +01:00
parent e30733e0cd
commit b742bccbfa

View file

@ -23,39 +23,28 @@ class EotkAutomation(BaseAutomation):
provider "aws" {
access_key = "{{ aws_access_key }}"
secret_key = "{{ aws_secret_key }}"
region = "us-east-1"
region = "us-east-2"
}
provider "aws" {
access_key = "{{ aws_access_key }}"
secret_key = "{{ aws_secret_key }}"
region = "eu-central-1"
alias = "second_region"
}
{% for group in groups %}
module "label_{{ group.id }}" {
source = "cloudposse/label/null"
version = "0.25.0"
module "eotk_{{ group.id }}" {
providers = {
aws = aws,
aws.second_region = aws.second_region
}
source = "sr2c/eotk/aws"
namespace = "{{ global_namespace }}"
tenant = "{{ group.group_name }}"
name = "eotk"
label_order = ["namespace", "tenant", "name", "attributes"]
}
module "bucket_{{ group.id }}" {
source = "cloudposse/s3-bucket/aws"
version = "0.49.0"
acl = "private"
enabled = true
user_enabled = true
versioning_enabled = false
allowed_bucket_actions = [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket",
"s3:GetBucketLocation"
]
context = module.label_{{ group.id }}.context
name = "logs"
attributes = ["eotk"]
}
resource "aws_sns_topic" "alarms_{{ group.id }}" {
name = "${module.label_{{ group.id }}.id}-eotk-alarms"
}
{% endfor %}
"""