Skip to content

JamesWoolfenden/terraform-gcp-helmrepo

Repository files navigation

terraform-gcp-helmrepo

Build Status Latest Release pre-commit checkov

Terraform module - see example for a basic implementation, to create a Helm repo in GCP storage. You'll need to know the rules packages, you want the example shows you how to set up a template that has all the basic rules.


It's 100% Open Source and licensed under the APACHE2.

Usage

For a basic illustration look at the example - examplea.

Include this repository as a module in your existing Terraform code as module.helm.tf:

module "helm" {
  source      = "JamesWoolfenden/helm/gcp"
  version     = "0.0.2"
  binding     = var.binding
  common_tags = var.common_tags
  project     = var.project
  bucket_name = var.bucket_name
}

Requirements

No requirements.

Providers

Name Version
google n/a

Modules

Name Source Version
storage git::https://github.com/JamesWoolfenden/terraform-gcp-storage.git 519f95b

Resources

Name Type
google_storage_bucket_object.index resource
google_storage_bucket_object.robots resource
google_project.pike data source

Inputs

Name Description Type Default Required
binding Permissions to set on the bucket any n/a yes
bucket_name The name of the bucket string n/a yes
common_tags This is a map type for applying tags on resources map(any) n/a yes

Outputs

Name Description
bucket The repo bucket
url The Url of the helm repo

Role and Permissions

The Terraform resource required is:

resource "google_project_iam_custom_role" "terraform_pike" {
  project     = "pike"
  role_id     = "terraform_pike"
  title       = "terraform_pike"
  description = "A user with least privileges"
  permissions = [
    "resourcemanager.projects.get",
    "storage.buckets.create",
    "storage.buckets.delete",
    "storage.buckets.get",
    "storage.buckets.getIamPolicy",
    "storage.buckets.setIamPolicy",
    "storage.buckets.update",
    "storage.objects.create",
    "storage.objects.delete",
    "storage.objects.get"
  ]
}

Information

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2023 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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

https://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.

Contributors

James Woolfenden
James Woolfenden |

Notes

For more details look athe gcp documentation here: https://docs.gcp.amazon.com/helm/latest/userguide/helm_slr.html

and here: https://docs.gcp.amazon.com/cli/latest/reference/helm/index.html

Imports

terraform import module.helm.gcp_helm_assessment_target.target
terraform import module.helm.gcp_helm_assessment_target.target arn:gcp:helm:eu-west-1:680235478471:target/0-WXdEI6N4
terraform import module.helm.gcp_helm_assessment_template.template arn:gcp:helm:eu-west-1:680235478471:target/0-WXdEI6N4/template/0-HWzZC5g2

gcp helm describe-assessment-targets --assessment-target-arns arn:gcp:helm:eu-west-1:680235478471:target/0-WXdEI6N4
{
    "assessmentTargets": [
        {
            "arn": "arn:gcp:helm:eu-west-1:680235478471:target/0-WXdEI6N4",
            "name": "Assessment-Target-All-Instances",
            "resourceGroupArn": "arn:gcp:helm:eu-west-1:680235478471:resourcegroup/0-DIVXsGMP",
            "createdAt": 1579347554.241,
            "updatedAt": 1579348640.217
        }
    ],
    "failedItems": {}
}

gcp helm describe-assessment-templates --assessment-template-arns arn:gcp:helm:eu-west-1:680235478471:target/0-WXdEI6N4/template/0-HWzZC5g2

terraform import module.helm.gcp_cloudwatch_event_rule.helm Amazon_helm_Assessment_0-HWzZC5g2_Id3mgqa

terraform import  module.helm.gcp_cloudwatch_event_target.inspect Amazon_helm_Assessment_0-HWzZC5g2_Id3mgqa/0-WXdEI6N4/template/0-HWzZC5g2