Skip to content

Commit f4d990f

Browse files
DEVOPS-1330 Added output for IAM Role name (#14)
* DEVOPS-1330 Added output for IAM Role name * Added documentation
1 parent 92a91c8 commit f4d990f

File tree

15 files changed

+64
-113
lines changed

15 files changed

+64
-113
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: https://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.74.1
21+
rev: v1.76.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
<a name="unreleased"></a>
66
## [Unreleased]
77

8+
- DEVOPS-1330 Added output for IAM Role name
9+
10+
11+
<a name="1.5.0"></a>
12+
## [1.5.0] - 2022-08-18
13+
14+
- Added force destroy feature + new restore policy ([#13](https://github.com/umotif-public/terraform-aws-backup/issues/13))
815

916

1017
<a name="1.4.0"></a>
@@ -56,7 +63,8 @@ All notable changes to this project will be documented in this file.
5663
- Initial commit
5764

5865

59-
[Unreleased]: https://github.com/umotif-public/terraform-aws-backup/compare/1.4.0...HEAD
66+
[Unreleased]: https://github.com/umotif-public/terraform-aws-backup/compare/1.5.0...HEAD
67+
[1.5.0]: https://github.com/umotif-public/terraform-aws-backup/compare/1.4.0...1.5.0
6068
[1.4.0]: https://github.com/umotif-public/terraform-aws-backup/compare/1.3.1...1.4.0
6169
[1.3.1]: https://github.com/umotif-public/terraform-aws-backup/compare/1.3.0...1.3.1
6270
[1.3.0]: https://github.com/umotif-public/terraform-aws-backup/compare/1.2.0...1.3.0

README.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ No modules.
118118
| [aws_iam_policy_document.main_custom_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
119119
| [aws_iam_policy_document.sns_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
120120
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
121-
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
122121

123122
## Inputs
124123

@@ -130,21 +129,9 @@ No modules.
130129
| <a name="input_enable_sns_notifications"></a> [enable\_sns\_notifications](#input\_enable\_sns\_notifications) | Enable Backup Vault Notifications | `bool` | `false` | no |
131130
| <a name="input_iam_role_name"></a> [iam\_role\_name](#input\_iam\_role\_name) | Name of IAM Role to associate to the Backup Plan | `string` | `null` | no |
132131
| <a name="input_plan_name"></a> [plan\_name](#input\_plan\_name) | The display name of a backup plan | `string` | n/a | yes |
133-
| <a name="input_rule_completion_window"></a> [rule\_completion\_window](#input\_rule\_completion\_window) | The amount of time AWS Backup attempts a backup before canceling the job and returning an error | `number` | `null` | no |
134-
| <a name="input_rule_copy_action_destination_vault_arn"></a> [rule\_copy\_action\_destination\_vault\_arn](#input\_rule\_copy\_action\_destination\_vault\_arn) | An Amazon Resource Name (ARN) that uniquely identifies the destination backup vault for the copied backup. | `string` | `null` | no |
135-
| <a name="input_rule_copy_action_lifecycle"></a> [rule\_copy\_action\_lifecycle](#input\_rule\_copy\_action\_lifecycle) | The lifecycle defines when a protected resource is copied over to a backup vault and when it expires. | `map(any)` | `{}` | no |
136-
| <a name="input_rule_lifecycle_cold_storage_after"></a> [rule\_lifecycle\_cold\_storage\_after](#input\_rule\_lifecycle\_cold\_storage\_after) | Specifies the number of days after creation that a recovery point is moved to cold storage | `number` | `null` | no |
137-
| <a name="input_rule_lifecycle_delete_after"></a> [rule\_lifecycle\_delete\_after](#input\_rule\_lifecycle\_delete\_after) | Specifies the number of days after creation that a recovery point is deleted. Must be 90 days greater than `cold_storage_after` | `number` | `null` | no |
138-
| <a name="input_rule_name"></a> [rule\_name](#input\_rule\_name) | An display name for a backup rule | `string` | `null` | no |
139-
| <a name="input_rule_recovery_point_tags"></a> [rule\_recovery\_point\_tags](#input\_rule\_recovery\_point\_tags) | Metadata that you can assign to help organize the resources that you create | `map(string)` | `{}` | no |
140-
| <a name="input_rule_schedule"></a> [rule\_schedule](#input\_rule\_schedule) | A CRON expression specifying when AWS Backup initiates a backup job | `string` | `null` | no |
141-
| <a name="input_rule_start_window"></a> [rule\_start\_window](#input\_rule\_start\_window) | The amount of time in minutes before beginning a backup | `number` | `null` | no |
142132
| <a name="input_rules"></a> [rules](#input\_rules) | A list of rules mapping rule configurations for a backup plan | `any` | `[]` | no |
143133
| <a name="input_selection_name"></a> [selection\_name](#input\_selection\_name) | The display name of a resource selection document | `string` | `null` | no |
144134
| <a name="input_selection_resources"></a> [selection\_resources](#input\_selection\_resources) | A list of strings that either contain Amazon Resource Names (ARNs) or match patterns of resources to assign to a backup plan | `list(string)` | `[]` | no |
145-
| <a name="input_selection_tag_key"></a> [selection\_tag\_key](#input\_selection\_tag\_key) | The key in a key-value pair | `string` | `null` | no |
146-
| <a name="input_selection_tag_type"></a> [selection\_tag\_type](#input\_selection\_tag\_type) | An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection | `string` | `null` | no |
147-
| <a name="input_selection_tag_value"></a> [selection\_tag\_value](#input\_selection\_tag\_value) | The value in a key-value pair | `string` | `null` | no |
148135
| <a name="input_selection_tags"></a> [selection\_tags](#input\_selection\_tags) | A list of selection tags map | `list(any)` | `[]` | no |
149136
| <a name="input_sns_topic_arn"></a> [sns\_topic\_arn](#input\_sns\_topic\_arn) | The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events | `string` | `null` | no |
150137
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no |
@@ -164,6 +151,7 @@ No modules.
164151
| <a name="output_backup_sns_topic_arn"></a> [backup\_sns\_topic\_arn](#output\_backup\_sns\_topic\_arn) | The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events |
165152
| <a name="output_backup_vault_arn"></a> [backup\_vault\_arn](#output\_backup\_vault\_arn) | The Amazon Resource Name (ARN) that identifies the AWS Backup Vault |
166153
| <a name="output_backup_vault_events"></a> [backup\_vault\_events](#output\_backup\_vault\_events) | An array of events that indicate the status of jobs to back up resources to the backup vault. |
154+
| <a name="output_backup_vault_iam_role_name"></a> [backup\_vault\_iam\_role\_name](#output\_backup\_vault\_iam\_role\_name) | The name of the backup IAM role |
167155
| <a name="output_backup_vault_id"></a> [backup\_vault\_id](#output\_backup\_vault\_id) | The name of the AWS Backup Vault |
168156
| <a name="output_backup_vault_recovery_points"></a> [backup\_vault\_recovery\_points](#output\_backup\_vault\_recovery\_points) | The number of recovery points that are stored in a backup vault |
169157
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

data.tf

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
data "aws_region" "current" {}
21
data "aws_partition" "current" {}
32

43
data "aws_iam_policy_document" "sns_policy" {

examples/external-vault/main.tf

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
provider "aws" {
2-
region = "eu-west-1"
3-
}
4-
5-
data "aws_caller_identity" "current" {}
6-
data "aws_region" "current" {}
7-
81
######
92
# KMS
103
######

examples/external-vault/versions.tf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0.11"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.0.0"
8+
}
9+
}
10+
}

examples/multiple-dbs/main.tf

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
provider "aws" {
2-
region = "eu-west-1"
3-
}
4-
5-
data "aws_caller_identity" "current" {}
6-
data "aws_region" "current" {}
7-
81
#####
92
# VPC and subnets
103
#####

examples/multiple-dbs/versions.tf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0.11"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.0.0"
8+
}
9+
}
10+
}

examples/one-db/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
provider "aws" {
2-
region = "eu-west-1"
3-
}
4-
51
#####
62
# VPC and subnets
73
#####

examples/one-db/versions.tf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0.11"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.0.0"
8+
}
9+
}
10+
}

examples/vault/main.tf

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
provider "aws" {
2-
region = "eu-west-1"
3-
}
4-
5-
data "aws_caller_identity" "current" {}
6-
data "aws_region" "current" {}
7-
81
######
92
# KMS
103
######

examples/vault/outputs.tf

+5
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ output "backup_plan_version" {
3131
output "backup_selection_id" {
3232
description = "The identifier of the backup selection"
3333
value = module.backup.backup_selection_id
34+
}
35+
36+
output "backup_vault_iam_role_name" {
37+
description = "The name of the backup IAM role"
38+
value = module.backup.backup_vault_iam_role_name
3439
}

examples/vault/versions.tf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0.11"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.0.0"
8+
}
9+
}
10+
}

outputs.tf

+8
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,12 @@ output "backup_vault_events" {
5555
value = flatten([
5656
for events in aws_backup_vault_notifications.main[*] : events.backup_vault_events
5757
if var.enable_sns_notifications])
58+
}
59+
60+
#####
61+
# AWS Backup IAM role Outputs
62+
####
63+
output "backup_vault_iam_role_name" {
64+
description = "The name of the backup IAM role"
65+
value = aws_iam_role.main.name
5866
}

variables.tf

-72
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,6 @@ variable "plan_name" {
1212
type = string
1313
}
1414

15-
variable "rule_name" {
16-
description = "An display name for a backup rule"
17-
type = string
18-
default = null
19-
}
20-
21-
variable "rule_schedule" {
22-
description = "A CRON expression specifying when AWS Backup initiates a backup job"
23-
type = string
24-
default = null
25-
}
26-
27-
variable "rule_start_window" {
28-
description = "The amount of time in minutes before beginning a backup"
29-
type = number
30-
default = null
31-
}
32-
33-
variable "rule_completion_window" {
34-
description = "The amount of time AWS Backup attempts a backup before canceling the job and returning an error"
35-
type = number
36-
default = null
37-
}
38-
39-
variable "rule_recovery_point_tags" {
40-
description = "Metadata that you can assign to help organize the resources that you create"
41-
type = map(string)
42-
default = {}
43-
}
44-
45-
variable "rule_lifecycle_cold_storage_after" {
46-
description = "Specifies the number of days after creation that a recovery point is moved to cold storage"
47-
type = number
48-
default = null
49-
}
50-
51-
variable "rule_lifecycle_delete_after" {
52-
description = "Specifies the number of days after creation that a recovery point is deleted. Must be 90 days greater than `cold_storage_after`"
53-
type = number
54-
default = null
55-
}
56-
57-
variable "rule_copy_action_lifecycle" {
58-
description = "The lifecycle defines when a protected resource is copied over to a backup vault and when it expires."
59-
type = map(any)
60-
default = {}
61-
}
62-
63-
variable "rule_copy_action_destination_vault_arn" {
64-
description = "An Amazon Resource Name (ARN) that uniquely identifies the destination backup vault for the copied backup."
65-
type = string
66-
default = null
67-
}
68-
6915
variable "rules" {
7016
description = "A list of rules mapping rule configurations for a backup plan"
7117
type = any
@@ -84,24 +30,6 @@ variable "selection_resources" {
8430
default = []
8531
}
8632

87-
variable "selection_tag_type" {
88-
description = "An operation, such as StringEquals, that is applied to a key-value pair used to filter resources in a selection"
89-
type = string
90-
default = null
91-
}
92-
93-
variable "selection_tag_key" {
94-
description = "The key in a key-value pair"
95-
type = string
96-
default = null
97-
}
98-
99-
variable "selection_tag_value" {
100-
description = "The value in a key-value pair"
101-
type = string
102-
default = null
103-
}
104-
10533
variable "selection_tags" {
10634
description = "A list of selection tags map"
10735
type = list(any)

0 commit comments

Comments
 (0)