Skip to content

Commit 8ca3519

Browse files
committed
FIxing lint for resources
1 parent aadf7be commit 8ca3519

File tree

3 files changed

+105
-84
lines changed

3 files changed

+105
-84
lines changed

gcbdr/backupplan/main.tf

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,54 @@
1616
# [START backupdr_create_backupvault]
1717

1818
resource "google_backup_dr_backup_vault" "default" {
19-
provider = google-beta
20-
location ="us-central1"
21-
backup_vault_id = "bv-1"
22-
description = "This is a second backup vault built by Terraform."
23-
backup_minimum_enforced_retention_duration = "100000s"
24-
labels = {
25-
foo = "bar1"
26-
bar = "baz1"
27-
}
28-
annotations = {
29-
annotations1 = "bar1"
30-
annotations2 = "baz1"
31-
}
32-
force_update = "true"
33-
force_delete = "true"
34-
allow_missing = "true"
19+
provider = google-beta
20+
location = "us-central1"
21+
backup_vault_id = "bv-1"
22+
description = "This is a second backup vault built by Terraform."
23+
backup_minimum_enforced_retention_duration = "100000s"
24+
25+
labels = {
26+
foo = "bar1"
27+
bar = "baz1"
28+
}
29+
30+
annotations = {
31+
annotations1 = "bar1"
32+
annotations2 = "baz1"
33+
}
34+
35+
force_update = "true"
36+
force_delete = "true"
37+
allow_missing = "true"
3538
}
39+
3640
# [END backupdr_create_backupvault]
3741

3842
# [START backupdr_create_backupplan]
3943

40-
// Before creating a backup plan, you need to create backup vault(google_backup_dr_backup_vault).
44+
# Before creating a backup plan, you need to create backup vault (google_backup_dr_backup_vault).
4145
resource "google_backup_dr_backup_plan" "default" {
42-
provider = google-beta
43-
location = "us-central1"
44-
backup_plan_id = "bp-test"
45-
resource_type= "compute.googleapis.com/Instance"
46-
backup_vault = google_backup_dr_backup_vault.default.name
46+
provider = google-beta
47+
location = "us-central1"
48+
backup_plan_id = "bp-test"
49+
resource_type = "compute.googleapis.com/Instance"
50+
backup_vault = google_backup_dr_backup_vault.default.name
51+
4752
backup_rules {
48-
rule_id = "rule-1"
49-
backup_retention_days = 5
50-
standard_schedule {
51-
recurrence_type = "HOURLY"
52-
hourly_frequency = 6
53-
time_zone = "UTC"
54-
backup_window{
55-
start_hour_of_day = 0
56-
end_hour_of_day = 24
53+
rule_id = "rule-1"
54+
backup_retention_days = 5
55+
56+
standard_schedule {
57+
recurrence_type = "HOURLY"
58+
hourly_frequency = 6
59+
time_zone = "UTC"
60+
61+
backup_window {
62+
start_hour_of_day = 0
63+
end_hour_of_day = 24
5764
}
5865
}
5966
}
6067
}
68+
6169
# [END backupdr_create_backupplan]

gcbdr/backupplanassociation/main.tf

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
*/
1616

1717
resource "google_service_account" "default" {
18-
provider = google-beta
18+
provider = google-beta
1919
account_id = "tf-test-my-custom-1"
2020
display_name = "Custom SA for VM Instance"
2121
}
2222

2323
resource "google_compute_instance" "default" {
24-
provider = google-beta
24+
provider = google-beta
2525
name = "tf-test-compute-instance-1"
2626
machine_type = "n2-standard-2"
2727
zone = "us-central1-a"
28-
tags = ["foo", "bar"]
28+
tags = ["foo", "bar"]
29+
2930
boot_disk {
3031
initialize_params {
3132
image = "debian-cloud/debian-11"
@@ -34,56 +35,63 @@ resource "google_compute_instance" "default" {
3435
}
3536
}
3637
}
38+
3739
// Local SSD disk
3840
scratch_disk {
3941
interface = "NVME"
4042
}
43+
4144
network_interface {
4245
network = "default"
4346
access_config {
4447
// Ephemeral public IP
4548
}
4649
}
50+
4751
service_account {
4852
# Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles.
4953
email = google_service_account.default.email
5054
scopes = ["cloud-platform"]
5155
}
5256
}
57+
5358
resource "google_backup_dr_backup_vault" "default" {
54-
provider = google-beta
55-
location ="us-central1"
56-
backup_vault_id = "tf-test-bv-1"
57-
description = "This is a second backup vault built by Terraform."
58-
backup_minimum_enforced_retention_duration = "100000s"
59-
labels = {
60-
foo = "bar1"
61-
bar = "baz1"
62-
}
63-
annotations = {
64-
annotations1 = "bar1"
65-
annotations2 = "baz1"
66-
}
67-
force_update = "true"
68-
force_delete = "true"
69-
allow_missing = "true"
59+
provider = google-beta
60+
location = "us-central1"
61+
backup_vault_id = "tf-test-bv-1"
62+
description = "This is a second backup vault built by Terraform."
63+
backup_minimum_enforced_retention_duration = "100000s"
64+
65+
labels = {
66+
foo = "bar1"
67+
bar = "baz1"
68+
}
69+
70+
annotations = {
71+
annotations1 = "bar1"
72+
annotations2 = "baz1"
73+
}
74+
75+
force_update = "true"
76+
force_delete = "true"
77+
allow_missing = "true"
7078
}
7179

7280
resource "google_backup_dr_backup_plan" "default" {
73-
provider = google-beta
74-
location = "us-central1"
75-
backup_plan_id = "tf-test-bp-test-1"
76-
resource_type = "compute.googleapis.com/Instance"
77-
backup_vault = google_backup_dr_backup_vault.default.name
81+
provider = google-beta
82+
location = "us-central1"
83+
backup_plan_id = "tf-test-bp-test-1"
84+
resource_type = "compute.googleapis.com/Instance"
85+
backup_vault = google_backup_dr_backup_vault.default.name
7886

7987
backup_rules {
80-
rule_id = "rule-1"
81-
backup_retention_days = 2
88+
rule_id = "rule-1"
89+
backup_retention_days = 2
8290

8391
standard_schedule {
84-
recurrence_type = "HOURLY"
85-
hourly_frequency = 6
86-
time_zone = "UTC"
92+
recurrence_type = "HOURLY"
93+
hourly_frequency = 6
94+
time_zone = "UTC"
8795

8896
backup_window {
8997
start_hour_of_day = 12
@@ -95,14 +103,15 @@ resource "google_backup_dr_backup_plan" "default" {
95103

96104
# [START backupdr_create_backupplanassociation]
97105

98-
// Before creating a backup plan association, you need to create backup plan(google_backup_dr_backup_plan)
99-
// and compute instance (google_compute_instance).
100-
resource "google_backup_dr_backup_plan_association" "default" {
101-
provider = google-beta
102-
location = "us-central1"
106+
# Before creating a backup plan association, you need to create backup plan (google_backup_dr_backup_plan)
107+
# and compute instance (google_compute_instance).
108+
resource "google_backup_dr_backup_plan_association" "default" {
109+
provider = google-beta
110+
location = "us-central1"
103111
backup_plan_association_id = "tf-test-bpa-test"
104-
resource = google_compute_instance.default.id
105-
resource_type= "compute.googleapis.com/Instance"
106-
backup_plan = google_backup_dr_backup_plan.default.name
112+
resource = google_compute_instance.default.id
113+
resource_type = "compute.googleapis.com/Instance"
114+
backup_plan = google_backup_dr_backup_plan.default.name
107115
}
116+
108117
# [END backupdr_create_backupplanassociation]

gcbdr/backupvault/main.tf

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,25 @@
1717
# [START backupdr_create_backupvault]
1818

1919
resource "google_backup_dr_backup_vault" "default" {
20-
provider = google-beta
21-
location ="us-central1"
22-
backup_vault_id = "bv-1"
23-
description = "This is a second backup vault built by Terraform."
24-
backup_minimum_enforced_retention_duration = "100000s"
25-
labels = {
26-
foo = "bar1"
27-
bar = "baz1"
28-
}
29-
annotations = {
30-
annotations1 = "bar1"
31-
annotations2 = "baz1"
32-
}
33-
force_update = "true"
34-
force_delete = "true"
35-
allow_missing = "true"
20+
provider = google-beta
21+
location = "us-central1"
22+
backup_vault_id = "bv-1"
23+
description = "This is a second backup vault built by Terraform."
24+
backup_minimum_enforced_retention_duration = "100000s"
25+
26+
labels = {
27+
foo = "bar1"
28+
bar = "baz1"
29+
}
30+
31+
annotations = {
32+
annotations1 = "bar1"
33+
annotations2 = "baz1"
34+
}
35+
36+
force_update = "true"
37+
force_delete = "true"
38+
allow_missing = "true"
3639
}
40+
3741
# [END backupdr_create_backupvault]

0 commit comments

Comments
 (0)