Skip to content

Commit e196294

Browse files
committed
dynamic'ize our info-event.json to point at autzen
1 parent c2439a6 commit e196294

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"s3SchemaVersion": "1.0",
2121
"configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1",
2222
"bucket": {
23-
"name": "pdal",
23+
"name": "${bucket}",
2424
"ownerIdentity": {
2525
"principalId": "A3I5XTEXAMAI3E"
2626
},
2727
"arn": "arn:aws:s3:::lambda-artifacts-deafc19498e3f2df"
2828
},
2929
"object": {
30-
"key": "test.laz",
30+
"key": "autzen-classified.copc.laz",
3131
"size": 1305107,
3232
"eTag": "b21b84d653bb07b05b1e6b33684dc11b",
3333
"sequencer": "0C0F6F405D6ED209E1"

handlers/python/ecr/info.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ def handler(event, context):
2727
command = f'pdal info --debug {path.as_uri()}'
2828
env = os.environ.copy()
2929

30-
# FIXME This hardcodes our s3 region to east to read our test file
31-
env['AWS_REGION'] = "us-east-1"
3230
# env['VERBOSE'] = "1"
3331

3432
response = util.run(command, env = env)

terraform/resources/roles.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ data "aws_iam_policy_document" "iam_for_lambda_policy_document" {
4242
sid = "ReadS3"
4343
}
4444

45-
46-
47-
4845
}
4946

5047
resource "aws_iam_policy" "lambda_logging_policy" {

terraform/resources/storage.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ resource "null_resource" "upload_autzen" {
66
provisioner "local-exec" {
77
command = "aws s3 cp ${path.root}/../data/autzen-classified.copc.laz s3://${aws_s3_bucket.storage.bucket}/autzen-classified.copc.laz"
88
}
9+
10+
911
depends_on = [
1012
aws_s3_bucket.storage,
1113
]
@@ -30,3 +32,28 @@ output "bucket" {
3032
description = "bucket"
3133
value = aws_s3_bucket.storage.bucket
3234
}
35+
36+
37+
locals {
38+
our_rendered_content = templatefile("${path.root}/../docker/info-event.tftpl", {bucket = aws_s3_bucket.storage.bucket})
39+
}
40+
41+
resource "null_resource" "local" {
42+
triggers = {
43+
template = local.our_rendered_content
44+
}
45+
46+
depends_on = [
47+
aws_s3_bucket.storage,
48+
]
49+
50+
# Render to local file on machine
51+
# https://github.com/hashicorp/terraform/issues/8090#issuecomment-291823613
52+
provisioner "local-exec" {
53+
command = format(
54+
"cat <<\"EOF\" > \"%s\"\n%s\nEOF",
55+
"${path.root}/../docker/info-event.json",
56+
local.our_rendered_content
57+
)
58+
}
59+
}

0 commit comments

Comments
 (0)