Skip to content

Commit d704c6e

Browse files
authored
feat: Added repository_name as output (#37)
* feat: Added repository_name as output * Updated docs
1 parent 44b41d4 commit d704c6e

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ No modules.
278278
| Name | Description |
279279
|------|-------------|
280280
| <a name="output_repository_arn"></a> [repository\_arn](#output\_repository\_arn) | Full ARN of the repository |
281+
| <a name="output_repository_name"></a> [repository\_name](#output\_repository\_name) | Name of the repository |
281282
| <a name="output_repository_registry_id"></a> [repository\_registry\_id](#output\_repository\_registry\_id) | The registry ID where the repository was created |
282283
| <a name="output_repository_url"></a> [repository\_url](#output\_repository\_url) | The URL of the repository |
283284
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ No inputs.
6262
| Name | Description |
6363
|------|-------------|
6464
| <a name="output_public_repository_arn"></a> [public\_repository\_arn](#output\_public\_repository\_arn) | Full ARN of the repository |
65+
| <a name="output_public_repository_name"></a> [public\_repository\_name](#output\_public\_repository\_name) | Name of the repository |
6566
| <a name="output_public_repository_registry_id"></a> [public\_repository\_registry\_id](#output\_public\_repository\_registry\_id) | The registry ID where the repository was created |
6667
| <a name="output_public_repository_url"></a> [public\_repository\_url](#output\_public\_repository\_url) | The URL of the repository (in the form `aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName`) |
6768
| <a name="output_repository_arn"></a> [repository\_arn](#output\_repository\_arn) | Full ARN of the repository |
69+
| <a name="output_repository_name"></a> [repository\_name](#output\_repository\_name) | Name of the repository |
6870
| <a name="output_repository_registry_id"></a> [repository\_registry\_id](#output\_repository\_registry\_id) | The registry ID where the repository was created |
6971
| <a name="output_repository_url"></a> [repository\_url](#output\_repository\_url) | The URL of the repository (in the form `aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName`) |
7072
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# Private Repository
33
################################################################################
44

5+
output "repository_name" {
6+
description = "Name of the repository"
7+
value = module.ecr.repository_name
8+
}
9+
510
output "repository_arn" {
611
description = "Full ARN of the repository"
712
value = module.ecr.repository_arn
@@ -21,6 +26,11 @@ output "repository_url" {
2126
# Public Repository
2227
################################################################################
2328

29+
output "public_repository_name" {
30+
description = "Name of the repository"
31+
value = module.public_ecr.repository_name
32+
}
33+
2434
output "public_repository_arn" {
2535
description = "Full ARN of the repository"
2636
value = module.public_ecr.repository_arn

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# Repository (Public and Private)
33
################################################################################
44

5+
output "repository_name" {
6+
description = "Name of the repository"
7+
value = try(aws_ecr_repository.this[0].name, aws_ecrpublic_repository.this[0].id, null)
8+
}
9+
510
output "repository_arn" {
611
description = "Full ARN of the repository"
712
value = try(aws_ecr_repository.this[0].arn, aws_ecrpublic_repository.this[0].arn, null)

0 commit comments

Comments
 (0)