Skip to content

Commit 9734b27

Browse files
authored
Merge pull request #6 from zeroae/f/handle-empty-prefix
Handle empty key prefix
2 parents ebc3380 + f684b8f commit 9734b27

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

.github/.github-update-disabled

Whitespace-only changes.

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,32 @@
1717
# Crash log files
1818
crash.log
1919
test.log
20+
21+
### macOS template
22+
# General
23+
.DS_Store
24+
.AppleDouble
25+
.LSOverride
26+
27+
# Icon must end with two \r
28+
Icon
29+
30+
# Thumbnails
31+
._*
32+
33+
# Files that might appear in the root of a volume
34+
.DocumentRevisions-V100
35+
.fseventsd
36+
.Spotlight-V100
37+
.TemporaryItems
38+
.Trashes
39+
.VolumeIcon.icns
40+
.com.apple.timemachine.donotpresent
41+
42+
# Directories potentially created on remote AFP share
43+
.AppleDB
44+
.AppleDesktop
45+
Network Trash Folder
46+
Temporary Items
47+
.apdisk
48+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
271271

272272
## Copyrights
273273

274-
Copyright © 2020-2021 [Zero A.E., LLC](https://zero-ae.com)
274+
Copyright © 2020-2022 [Zero A.E., LLC](https://zero-ae.com)
275275

276276

277277

main.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
locals {
2-
key_prefix = trimsuffix(var.bucket_key_prefix, "/")
2+
key_prefix = join("/", compact([
3+
trimprefix(trimsuffix(var.bucket_key_prefix, "/"), "/"),
4+
module.volume_label.id
5+
]))
36
}
47

58
module "volume_label" {
@@ -10,10 +13,10 @@ module "volume_label" {
1013
}
1114

1215
# TODO: Implement a health check
13-
# TODO: Support multiple volumes
16+
# TODO: Support different user/groups
1417
module "mobius3" {
1518
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.57.0"
16-
container_name = "mobius3"
19+
container_name = "mobius3-${var.volume_name}"
1720
container_image = var.mobius3_image
1821
essential = true
1922

@@ -25,7 +28,7 @@ module "mobius3" {
2528
var.bucket_id,
2629
"https://{}.s3.${var.bucket_region}.amazonaws.com/",
2730
var.bucket_region,
28-
"--prefix", "${local.key_prefix}/${module.volume_label.id}/",
31+
"--prefix", "${local.key_prefix}/",
2932
"--credentials-source", "ecs-container-endpoint",
3033
"--log-level", "INFO"
3134
]

0 commit comments

Comments
 (0)