Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the created role's name to the module's outputs #41

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Use this URL for the source of the module. See the usage examples below for more details.

```hcl
github.com/pbs/terraform-aws-synthetics-module?ref=2.0.17
github.com/pbs/terraform-aws-synthetics-module?ref=x.y.z
```

### Alternative Installation Methods
Expand All @@ -22,7 +22,7 @@ Integrate this module like so:

```hcl
module "synthetics" {
source = "github.com/pbs/terraform-aws-synthetics-module?ref=2.0.17"
source = "github.com/pbs/terraform-aws-synthetics-module?ref=x.y.z"

zip_file = "path/to/file.zip"

Expand All @@ -48,7 +48,7 @@ The recommended workaround for this is to use something external to Terraform (l

If this repo is added as a subtree, then the version of the module should be close to the version shown here:

`2.0.17`
`x.y.z`

Note, however that subtrees can be altered as desired within repositories.

Expand Down Expand Up @@ -77,7 +77,7 @@ Below is automatically generated documentation on this Terraform module using [t

| Name | Source | Version |
|------|--------|---------|
| <a name="module_role"></a> [role](#module\_role) | github.com/pbs/terraform-aws-iam-role-module | 0.2.2 |
| <a name="module_role"></a> [role](#module\_role) | github.com/pbs/terraform-aws-iam-role-module.git | 0.2.4 |
| <a name="module_s3"></a> [s3](#module\_s3) | github.com/pbs/terraform-aws-s3-module | 4.0.13 |

## Resources
Expand Down Expand Up @@ -122,10 +122,11 @@ Below is automatically generated documentation on this Terraform module using [t

| Name | Description |
|------|-------------|
| <a name="output_arn"></a> [arn](#output\_arn) | ARN of the canary. |
| <a name="output_engine_arn"></a> [engine\_arn](#output\_engine\_arn) | ARN of the Lambda function that is used as your canary's engine. |
| <a name="output_id"></a> [id](#output\_id) | Name of the canary. |
| <a name="output_name"></a> [name](#output\_name) | Name of the canary. |
| <a name="output_source_location_arn"></a> [source\_location\_arn](#output\_source\_location\_arn) | ARN of the Lambda layer where Synthetics stores the canary script code. |
| <a name="output_status"></a> [status](#output\_status) | Status of the canary. |
| <a name="output_timeline"></a> [timeline](#output\_timeline) | Timeline of the canary. |
| <a name="output_arn"></a> [arn](#output\_arn) | ARN of the canary |
| <a name="output_engine_arn"></a> [engine\_arn](#output\_engine\_arn) | ARN of the Lambda function that is used as your canary's engine |
| <a name="output_execution_role_name"></a> [execution\_role\_name](#output\_execution\_role\_name) | Name of the IAM role used to run the canary |
| <a name="output_id"></a> [id](#output\_id) | Name of the canary |
| <a name="output_name"></a> [name](#output\_name) | Name of the canary |
| <a name="output_source_location_arn"></a> [source\_location\_arn](#output\_source\_location\_arn) | ARN of the Lambda layer where Synthetics stores the canary script code |
| <a name="output_status"></a> [status](#output\_status) | Status of the canary |
| <a name="output_timeline"></a> [timeline](#output\_timeline) | Timeline of the canary |
19 changes: 12 additions & 7 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
output "arn" {
description = "ARN of the canary."
description = "ARN of the canary"
value = aws_synthetics_canary.canary.arn
}

output "engine_arn" {
description = "ARN of the Lambda function that is used as your canary's engine."
description = "ARN of the Lambda function that is used as your canary's engine"
value = aws_synthetics_canary.canary.engine_arn
}

output "id" {
description = "Name of the canary."
description = "Name of the canary"
value = aws_synthetics_canary.canary.id
}

output "name" {
description = "Name of the canary."
description = "Name of the canary"
value = aws_synthetics_canary.canary.id
}

output "source_location_arn" {
description = "ARN of the Lambda layer where Synthetics stores the canary script code."
description = "ARN of the Lambda layer where Synthetics stores the canary script code"
value = aws_synthetics_canary.canary.source_location_arn
}

output "status" {
description = "Status of the canary."
description = "Status of the canary"
value = aws_synthetics_canary.canary.status
}

output "timeline" {
description = "Timeline of the canary."
description = "Timeline of the canary"
value = aws_synthetics_canary.canary.timeline
}

output "execution_role_name" {
description = "Name of the IAM role used to run the canary"
value = module.role[0].name
}
2 changes: 1 addition & 1 deletion security.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "role" {
count = var.execution_role_arn == null ? 1 : 0

source = "github.com/pbs/terraform-aws-iam-role-module?ref=0.2.2"
source = "github.com/pbs/terraform-aws-iam-role-module.git?ref=0.2.4"

name = local.execution_role_name

Expand Down