list: add role to s3 lists

fixes: #12
This commit is contained in:
Iain Learmonth 2022-05-11 16:12:52 +01:00
parent efb74ae413
commit 54a2c457f0
6 changed files with 62 additions and 20 deletions

View file

@ -20,14 +20,21 @@ class ListS3Automation(ListAutomation):
}
}
{% for list in lists %}
provider "aws" {
access_key = "{{ aws_access_key }}"
secret_key = "{{ aws_secret_key }}"
region = "us-east-1"
region = "{{ list.branch }}"
{% if list.role %}
assume_role {
role_arn = "{{ list.role }}"
}
{% endif %}
alias = "list_{{ list.id }}"
}
{% for list in lists %}
resource "aws_s3_object" "object_{{ list.id }}" {
provider = aws.list_{{ list.id }}
bucket = "{{ list.container }}"
key = "{{ list.filename }}"
source = "{{ list.format }}.json"