Skip to content

Commit 0a49cec

Browse files
lgallardclaude
andcommitted
fix: Correct example configurations to match module variable structure
- Fix selection_by_conditions example to use map instead of list for selections - Fix aws_recommended_audit_framework example to match audit_framework variable structure - Remove unsupported reports configuration from audit framework example 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 546c32c commit 0a49cec

File tree

2 files changed

+26
-86
lines changed
  • examples

2 files changed

+26
-86
lines changed

examples/aws_recommended_audit_framework/main.tf

Lines changed: 23 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -41,115 +41,55 @@ module "aws_backup_example" {
4141
]
4242

4343
# Backup selection configuration
44-
selections = [
45-
{
44+
selections = {
45+
resource_selection = {
4646
name = "resource_selection"
47-
selection_tag = {
48-
type = "STRINGEQUALS"
49-
key = "Environment"
50-
value = "prod"
51-
}
47+
selection_tags = [
48+
{
49+
type = "STRINGEQUALS"
50+
key = "Environment"
51+
value = "prod"
52+
}
53+
]
5254
resources = [
5355
"arn:aws:dynamodb:us-west-2:123456789012:table/my-table",
5456
"arn:aws:ec2:us-west-2:123456789012:volume/vol-12345678"
5557
]
5658
}
57-
]
59+
}
5860

5961
# Enable AWS recommended backup framework
6062
audit_framework = {
6163
create = true
6264
name = "aws_recommended_framework"
6365
description = "AWS Recommended Backup Framework"
64-
control_scope = {
65-
tags = {
66-
Environment = "prod"
67-
}
68-
}
6966
controls = [
7067
{
71-
control_name = "BACKUP_RESOURCES_PROTECTED_BY_BACKUP_PLAN"
72-
name = "backup_resources_protected_by_backup_plan"
73-
input_parameters = [
74-
{
75-
parameter_name = "requiredBackupPlanFrequencyUnit"
76-
parameter_value = "hours"
77-
},
78-
{
79-
parameter_name = "requiredBackupPlanFrequencyValue"
80-
parameter_value = "24"
81-
},
82-
{
83-
parameter_name = "requiredRetentionDays"
84-
parameter_value = "35"
85-
}
86-
]
68+
name = "backup_resources_protected_by_backup_plan"
69+
parameter_name = "requiredRetentionDays"
70+
parameter_value = "35"
8771
},
8872
{
89-
control_name = "BACKUP_PLAN_MIN_FREQUENCY_AND_MIN_RETENTION_CHECK"
90-
name = "backup_plan_min_frequency_and_retention"
91-
input_parameters = [
92-
{
93-
parameter_name = "requiredFrequencyUnit"
94-
parameter_value = "hours"
95-
},
96-
{
97-
parameter_name = "requiredFrequencyValue"
98-
parameter_value = "24"
99-
},
100-
{
101-
parameter_name = "requiredRetentionDays"
102-
parameter_value = "35"
103-
}
104-
]
73+
name = "backup_plan_min_frequency_and_retention"
74+
parameter_name = "requiredRetentionDays"
75+
parameter_value = "35"
10576
},
10677
{
107-
control_name = "BACKUP_RECOVERY_POINT_MINIMUM_RETENTION_CHECK"
108-
name = "backup_recovery_point_min_retention"
109-
input_parameters = [
110-
{
111-
parameter_name = "requiredRetentionDays"
112-
parameter_value = "35"
113-
}
114-
]
78+
name = "backup_recovery_point_min_retention"
79+
parameter_name = "requiredRetentionDays"
80+
parameter_value = "35"
11581
},
11682
{
117-
control_name = "BACKUP_RECOVERY_POINT_ENCRYPTED"
118-
name = "backup_recovery_point_encrypted"
119-
input_parameters = []
83+
name = "backup_recovery_point_encrypted"
12084
},
12185
{
122-
control_name = "BACKUP_RESOURCES_PROTECTED_BY_BACKUP_VAULT_LOCK"
123-
name = "backup_resources_protected_by_vault_lock"
124-
input_parameters = [
125-
{
126-
parameter_name = "maxRetentionDays"
127-
parameter_value = "100"
128-
}
129-
]
86+
name = "backup_resources_protected_by_vault_lock"
87+
parameter_name = "maxRetentionDays"
88+
parameter_value = "100"
13089
}
13190
]
132-
133-
policy_assignment = {
134-
opt_in_preference = true
135-
policy_id = "backup-policy-id"
136-
regions = ["us-west-2"]
137-
organizational_unit_ids = ["ou-1234-12345678"]
138-
}
13991
}
14092

141-
# Configure comprehensive backup reports
142-
reports = [
143-
{
144-
name = "aws_backup_audit_report"
145-
description = "AWS Backup compliance and audit report"
146-
report_template = "BACKUP_JOB_REPORT"
147-
s3_bucket_name = "my-backup-reports-bucket"
148-
s3_key_prefix = "backup_audit"
149-
formats = ["CSV", "JSON"]
150-
framework_arns = ["arn:aws:backup:us-west-2:123456789012:framework/aws_recommended_framework"]
151-
}
152-
]
15393

15494
tags = {
15595
Environment = "prod"

examples/selection_by_conditions/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ module "aws_backup_example" {
3636
]
3737

3838
# Selection configuration using conditions
39-
selections = [
40-
{
39+
selections = {
40+
selection_by_conditions = {
4141
name = "selection_by_conditions"
4242
selection_tags = [
4343
{
@@ -52,7 +52,7 @@ module "aws_backup_example" {
5252
}
5353
]
5454
}
55-
]
55+
}
5656

5757
tags = {
5858
Environment = "prod"

0 commit comments

Comments
 (0)