Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed May 10, 2024
1 parent 98dd358 commit 1cc31eb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/simple_sa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ module "sa" {
source = "terraform-google-modules/service-accounts/google//modules/simple-sa"
version = "~> 4.0"

project_id = var.project_id
name = "single-account"
project_id = var.project_id
name = "single-account"
project_roles = [
"roles/compute.imageUser",
"roles/compute.networkUser"
]
]
}
2 changes: 1 addition & 1 deletion modules/simple-sa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module "sa" {
| description | Default description of the created service accounts (defaults to no description) | `string` | `""` | no |
| display\_name | Display name of the created service accounts (defaults to 'Terraform-managed service account') | `string` | `"Terraform-managed service account"` | no |
| name | Name of service account | `string` | n/a | yes |
| project\_id | Project id where service account will be created. | `string` | n/a | yes |
| project\_id | Project id where service account will be created | `string` | n/a | yes |
| project\_roles | Roles to grant the SA in specified project | `list(string)` | n/a | yes |

## Outputs
Expand Down
6 changes: 3 additions & 3 deletions modules/simple-sa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "google_service_account" "sa" {

resource "google_project_iam_member" "roles" {
for_each = toset(var.project_roles)
project = var.project_id
role = each.value
member = google_service_account.sa.member
project = var.project_id
role = each.value
member = google_service_account.sa.member
}
14 changes: 14 additions & 0 deletions modules/simple-sa/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: blueprints.cloud.google.com/v1alpha1
kind: BlueprintMetadata
metadata:
Expand Down
2 changes: 1 addition & 1 deletion modules/simple-sa/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ variable "description" {
}

variable "project_roles" {
type = list(string)
type = list(string)
description = "Roles to grant the SA in specified project"
}

0 comments on commit 1cc31eb

Please sign in to comment.