@@ -246,6 +246,7 @@ module "label1" {
246
246
stage = "build"
247
247
name = "Winston Churchroom"
248
248
attributes = ["fire", "water", "earth", "air"]
249
+ delimiter = "-"
249
250
250
251
label_order = ["name", "environment", "stage", "attributes"]
251
252
@@ -256,10 +257,11 @@ module "label1" {
256
257
}
257
258
258
259
module "label2" {
259
- source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=master"
260
- context = "${module.label1.context}"
261
- name = "Charlie"
262
- stage = "test"
260
+ source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=master"
261
+ context = "${module.label1.context}"
262
+ name = "Charlie"
263
+ stage = "test"
264
+ delimiter = "+"
263
265
264
266
tags = {
265
267
"City" = "London"
@@ -268,9 +270,11 @@ module "label2" {
268
270
}
269
271
270
272
module "label3" {
271
- source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=master"
272
- name = "Starfish"
273
- stage = "release"
273
+ source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=master"
274
+ name = "Starfish"
275
+ stage = "release"
276
+ context = "${module.label1.context}"
277
+ delimiter = "."
274
278
275
279
tags = {
276
280
"Eat" = "Carrot"
@@ -283,14 +287,14 @@ This creates label outputs like this:
283
287
284
288
``` hcl
285
289
label1 = {
286
- attributes = fire- water- earth- air
290
+ attributes = [ fire water earth air]
287
291
id = winstonchurchroom-uat-build-fire-water-earth-air
288
292
name = winstonchurchroom
289
293
namespace = cloudposse
290
294
stage = build
291
295
}
292
296
label1_context = {
293
- attributes = [fire- water- earth- air]
297
+ attributes = [fire water earth air]
294
298
delimiter = [-]
295
299
environment = [uat]
296
300
label_order = [name environment stage attributes]
@@ -308,54 +312,55 @@ label1_tags = {
308
312
Stage = build
309
313
}
310
314
label2 = {
311
- attributes = fire- water- earth- air
312
- id = charlie- uat- test- fire- water- earth- air
315
+ attributes = [ fire water earth air]
316
+ id = charlie+ uat+ test+ fire+ water+ earth+ air
313
317
name = charlie
314
318
namespace = cloudposse
315
319
stage = test
316
320
}
317
321
label2_context = {
318
- attributes = [fire- water- earth- air]
319
- delimiter = [- ]
322
+ attributes = [fire water earth air]
323
+ delimiter = [+ ]
320
324
environment = [uat]
321
325
label_order = [name environment stage attributes]
322
326
name = [charlie]
323
327
namespace = [cloudposse]
324
328
stage = [test]
325
329
tags_keys = [City Environment Name Namespace Stage]
326
- tags_values = [London Public charlie- uat- test- fire- water- earth- air cloudposse test]
330
+ tags_values = [London Public charlie+ uat+ test+ fire+ water+ earth+ air cloudposse test]
327
331
}
328
332
label2_tags = {
329
333
City = London
330
334
Environment = Public
331
- Name = charlie- uat- test- fire- water- earth- air
335
+ Name = charlie+ uat+ test+ fire+ water+ earth+ air
332
336
Namespace = cloudposse
333
337
Stage = test
334
338
}
335
339
label3 = {
336
- attributes =
337
- id = release- starfish
340
+ attributes = [fire water earth air]
341
+ id = starfish.uat.release.fire.water.earth.air
338
342
name = starfish
339
- namespace =
343
+ namespace = cloudposse
340
344
stage = release
341
345
}
342
346
label3_context = {
343
- attributes = []
344
- delimiter = [- ]
345
- environment = []
346
- label_order = [namespace environment stage name attributes]
347
+ attributes = [fire water earth air ]
348
+ delimiter = [. ]
349
+ environment = [uat ]
350
+ label_order = [name environment stage attributes]
347
351
name = [starfish]
348
- namespace = []
352
+ namespace = [cloudposse ]
349
353
stage = [release]
350
- tags_keys = [Animal Eat Environment Name Namespace Stage]
351
- tags_values = [Rabbit Carrot release- starfish release]
354
+ tags_keys = [Animal City Eat Environment Name Namespace Stage]
355
+ tags_values = [Rabbit Dublin Carrot uat starfish.uat.release.fire.water.earth.air cloudposse release]
352
356
}
353
357
label3_tags = {
354
358
Animal = Rabbit
359
+ City = Dublin
355
360
Eat = Carrot
356
- Environment =
357
- Name = release- starfish
358
- Namespace =
361
+ Environment = uat
362
+ Name = starfish.uat.release.fire.water.earth.air
363
+ Namespace = cloudposse
359
364
Stage = release
360
365
}
361
366
```
@@ -383,12 +388,12 @@ Available targets:
383
388
| additional_tag_map | Additional tags for appending to each tag map | map | ` <map> ` | no |
384
389
| attributes | Additional attributes (e.g. ` 1 ` ) | list | ` <list> ` | no |
385
390
| context | Default context to use for passing state between label invocations | map | ` <map> ` | no |
386
- | delimiter | Delimiter to be used between ` name ` , ` namespace ` , ` stage ` , etc. | string | ` - ` | no |
391
+ | delimiter | Delimiter to be used between ` namespace ` , ` environment ` , ` stage ` , ` name ` and ` attributes ` | string | ` - ` | no |
387
392
| enabled | Set to false to prevent the module from creating any resources | string | ` true ` | no |
388
393
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
389
394
| label_order | The naming order of the id output and Name tag | list | ` <list> ` | no |
390
395
| name | Solution name, e.g. 'app' or 'jenkins' | string | `` | no |
391
- | namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | string | `` | no |
396
+ | namespace | Namespace, which could be your organization name or abbreviation , e.g. 'eg' or 'cp' | string | `` | no |
392
397
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
393
398
| tags | Additional tags (e.g. ` map('BusinessUnit','XYZ') ` | map | ` <map> ` | no |
394
399
0 commit comments