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 feature #6

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ provider "google" {
zone = "${var.region}-b"
}

resource "google_compute_project_default_network_tier" "default" {
resource "google_copute_project_default_network_tier" "default" {
network_tier = "PREMIUM"
}
Comment on lines +20 to 22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Correct the resource type typo.
The resource type "google_copute_project_default_network_tier" appears to include a typographical error. It should likely be "google_compute_project_default_network_tier" to be recognized by Terraform.

Apply the following diff to fix the typo:

- resource "google_copute_project_default_network_tier" "default" {
+ resource "google_compute_project_default_network_tier" "default" {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
resource "google_copute_project_default_network_tier" "default" {
network_tier = "PREMIUM"
}
resource "google_compute_project_default_network_tier" "default" {
network_tier = "PREMIUM"
}



resource "google_compute_network" "vpc_network" {
name = "gcp-test-network"
}
Expand Down Expand Up @@ -53,6 +54,14 @@ resource "google_storage_bucket_object" "test_image" {
bucket = google_storage_bucket.private_bucket.name
}

resource "google_storage_bucket_object" "test_image" {
name = "test2.jpg"
source = "test/2.jpg"
content_type = "image/jpeg"

bucket = google_storage_bucket.private_bucket.name
}
Comment on lines +57 to +63
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Resolve resource naming conflict for bucket objects.
There are two resources of type "google_storage_bucket_object" both using the name "test_image". In Terraform, resource names must be unique within the module. Rename the new resource (e.g., to "test_image_2") to avoid conflict and ensure proper referencing.

Apply the following diff to rename the new resource:

- resource "google_storage_bucket_object" "test_image" {
-   name = "test2.jpg"
-   source       = "test/2.jpg"
-   content_type = "image/jpeg"
- 
-   bucket = google_storage_bucket.private_bucket.name
- }
+ resource "google_storage_bucket_object" "test_image_2" {
+   name         = "test2.jpg"
+   source       = "test/2.jpg"
+   content_type = "image/jpeg"
+ 
+   bucket       = google_storage_bucket.private_bucket.name
+ }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
resource "google_storage_bucket_object" "test_image" {
name = "test2.jpg"
source = "test/2.jpg"
content_type = "image/jpeg"
bucket = google_storage_bucket.private_bucket.name
}
resource "google_storage_bucket_object" "test_image_2" {
name = "test2.jpg"
source = "test/2.jpg"
content_type = "image/jpeg"
bucket = google_storage_bucket.private_bucket.name
}


resource "google_storage_bucket_iam_member" "default" {
bucket = google_storage_bucket.private_bucket.name
role = "roles/storage.objectViewer"
Expand Down
Binary file added test/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ variable "region" {
description = "The region where the resources will be deployed."
type = string
}

variable "bufi" {
description = "The bufi is a variable."
type = string
}
Loading