GCP Archives - For all your terraform needs https://terraformarchitect.com/category/gcp/ Automation cannot be an afterthought (TM) Mon, 21 Aug 2023 14:06:43 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Terraform for IAM resource creation https://terraformarchitect.com/gcp/terraform-for-iam-resource-creation/?utm_source=rss&utm_medium=rss&utm_campaign=terraform-for-iam-resource-creation https://terraformarchitect.com/gcp/terraform-for-iam-resource-creation/#respond Mon, 21 Aug 2023 14:06:43 +0000 https://terraformarchitect.com/?p=364 Overview Is terraform a suitable tool for creating and managing cloud IAM resources? The short answer is – no. Especially, if you are going to be dealing with a large […]

The post Terraform for IAM resource creation appeared first on For all your terraform needs.

]]>
Overview

Is terraform a suitable tool for creating and managing cloud IAM resources? The short answer is – no. Especially, if you are going to be dealing with a large number of such creation requests.

Time taken to apply terraform for IAM

Check whether the IAM resource already exists – across all buckets that store state. This could take hours. Can you afford to wait for hours for a simple identity creation or a role assignment?

State drift – Console based roles and assignments

Certain IAM actions performed via the console will cause state drift. The next run of your IAM script will not pick these up – and essentially wipe them out.

Of course, if you have IAM creation etc. locked out for console users, you will not face this particular issue.

Summary

For smaller scoped IAM requests – say you have a dozen or so requests to deal with – terraform for IAM may be a workable solution.

 

 

The post Terraform for IAM resource creation appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/terraform-for-iam-resource-creation/feed/ 0
Error – ‘registry.terraform.io/hashicorp/local: there is no package for registry.terraform.io/hashicorp/local cached in .terraform/providers’ https://terraformarchitect.com/gcp/terraform-apply-fails/?utm_source=rss&utm_medium=rss&utm_campaign=terraform-apply-fails https://terraformarchitect.com/gcp/terraform-apply-fails/#respond Wed, 19 Oct 2022 13:11:20 +0000 https://terraformarchitect.com/?p=276 Terraform init or terraform init -upgrade or terraform apply fails with this error message: The installed provider plugins are not consistent with the packages selected in the dependency lock file: […]

The post Error – ‘registry.terraform.io/hashicorp/local: there is no package for registry.terraform.io/hashicorp/local cached in .terraform/providers’ appeared first on For all your terraform needs.

]]>
Terraform init or terraform init -upgrade or terraform apply fails with this error message:

The installed provider plugins are not consistent with the packages selected in the dependency lock file:
│ – registry.terraform.io/hashicorp/azurerm: the cached package for registry.terraform.io/hashicorp/azurerm x.y.x. (in .terraform\providers) does not match any of the checksums recorded in the dependency lock file
│ – registry.terraform.io/hashicorp/random: there is no package for registry.terraform.io/hashicorp/random 3.4.3 cached in .terraform\providers

Resolution

Step 1 – Look for this lock file (terraform.lock.hcl) in your current module. Delete it.

Step 2 – Re Run terraform init -upgrade

Terraform apply fails

The post Error – ‘registry.terraform.io/hashicorp/local: there is no package for registry.terraform.io/hashicorp/local cached in .terraform/providers’ appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/terraform-apply-fails/feed/ 0
What if there is no Terraform Support for certain GCP Features? https://terraformarchitect.com/gcp/what-if-there-is-no-terraform-support-for-certain-gcp-features/?utm_source=rss&utm_medium=rss&utm_campaign=what-if-there-is-no-terraform-support-for-certain-gcp-features https://terraformarchitect.com/gcp/what-if-there-is-no-terraform-support-for-certain-gcp-features/#respond Sun, 03 Jul 2022 21:56:18 +0000 https://terraformarchitect.com/?p=237 Sometimes, there isn’t Terraform GCP support for a particular feature – e.g. use asset manager  to retrieve all resources,  e.g. upload of a file to a Kubernetes pod) that lacks […]

The post What if there is no Terraform Support for certain GCP Features? appeared first on For all your terraform needs.

]]>
Sometimes, there isn’t Terraform GCP support for a particular feature – e.g. use asset manager  to retrieve all resources,  e.g. upload of a file to a Kubernetes pod) that lacks Terraform support.

terraform-google-gcloud

This module allows you to use gcloud, gsutil, any gcloud component in Terraform.

This module does not create any resources on GCP itself, rather exposes the GCP SDK to you for usage in null resources & external data resources.

What about accomplishing the same thing on azure?

provider "azurerm" {   features {  } } 
resource "azurerm_resource_group" "rg" 
{   name     = "TFRDemo"   
    location = ""   
    provisioner "local-exec" 
     {     
       command = "az account show --output table" 
     } 
}

The post What if there is no Terraform Support for certain GCP Features? appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/what-if-there-is-no-terraform-support-for-certain-gcp-features/feed/ 0
More on Remote State and State Files https://terraformarchitect.com/gcp/more-on-remote-state-and-state-files/?utm_source=rss&utm_medium=rss&utm_campaign=more-on-remote-state-and-state-files https://terraformarchitect.com/gcp/more-on-remote-state-and-state-files/#respond Sun, 03 Jul 2022 21:55:46 +0000 https://terraformarchitect.com/?p=226 State File Locking is something terraform does by default. But what if the actual backend does not support locking (e.g. S3 by itself doesn’t – S3 with DynamoDB does). If […]

The post More on Remote State and State Files appeared first on For all your terraform needs.

]]>
State File Locking is something terraform does by default. But what if the actual backend does not support locking (e.g. S3 by itself doesn’t – S3 with DynamoDB does).

If locking of the state file is not natively supported, you must ensure that you do a terraform state pull each time, before renewing your work. (Also See Managing Terraform State )

Summary

Check hashicorp’s  documentation to determine whether a backend supports locking or not. E.g. S3 doesn’t support locking by default, but with a little effort, you can make S3’s remote state locking capable.

The post More on Remote State and State Files appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/more-on-remote-state-and-state-files/feed/ 0
Terraform SaaS versus Terraform Enterprise (TFE) https://terraformarchitect.com/gcp/terraform-saas-versus-terraform-enterprise-tfe/?utm_source=rss&utm_medium=rss&utm_campaign=terraform-saas-versus-terraform-enterprise-tfe https://terraformarchitect.com/gcp/terraform-saas-versus-terraform-enterprise-tfe/#respond Wed, 19 Jan 2022 05:20:09 +0000 https://terraformarchitect.com/?p=202 This is a work in progress…. How does Terraform Cloud SaaS work? Through IP Range API and Remote Access Licensing TFE licensing is per workspace (state files) License for SaaS […]

The post Terraform SaaS versus Terraform Enterprise (TFE) appeared first on For all your terraform needs.

]]>
This is a work in progress….
How does Terraform Cloud SaaS work?
Through IP Range API and Remote Access
Licensing
TFE licensing is per workspace (state files)

License for SaaS is per user

The post Terraform SaaS versus Terraform Enterprise (TFE) appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/terraform-saas-versus-terraform-enterprise-tfe/feed/ 0
How many Pipelines? https://terraformarchitect.com/cicd-pipelines/how-many-pipelines/?utm_source=rss&utm_medium=rss&utm_campaign=how-many-pipelines https://terraformarchitect.com/cicd-pipelines/how-many-pipelines/#respond Mon, 12 Jul 2021 02:17:01 +0000 https://terraformarchitect.com/?p=149 Also read How many Non Prod Environments should you have? The TWO most commonly implemented ones would be the managed infrastructure services pipeline (or just infra pipeline) and the app […]

The post How many Pipelines? appeared first on For all your terraform needs.

]]>
Also read How many Non Prod Environments should you have?

The TWO most commonly implemented ones would be the managed infrastructure services pipeline (or just infra pipeline) and the app pipeline.

A Foundational Pipeline would include setting up the original organization and folder structure in GCP.

application and infrastructure pipelines GCP
application and infrastructure pipelines GCP




Need an experienced Data Protection Expert?  Anuj has successfully delivered over a dozen deployments on each of the public clouds (AWS/GCP/Azure) including several DevSecOps engagements. Set up a time with Anuj Varma.

 

 

The post How many Pipelines? appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/cicd-pipelines/how-many-pipelines/feed/ 0
Deep Monitoring – Vulnerability Management on GCP VMs https://terraformarchitect.com/gcp/deep-monitoring-vulnerability-management-on-gcp-vms/?utm_source=rss&utm_medium=rss&utm_campaign=deep-monitoring-vulnerability-management-on-gcp-vms https://terraformarchitect.com/gcp/deep-monitoring-vulnerability-management-on-gcp-vms/#respond Fri, 11 Jun 2021 20:12:33 +0000 https://terraformarchitect.com/?p=133 First, let us distinguish between Image Protection and Instance Protection. Instance Protection – Protection of a running instance    GCP Shielded VMs – Vulnerability Management built in Image Protection – […]

The post Deep Monitoring – Vulnerability Management on GCP VMs appeared first on For all your terraform needs.

]]>
First, let us distinguish between Image Protection and Instance Protection.

Instance Protection – Protection of a running instance

   GCP Shielded VMs – Vulnerability Management built in

Image Protection – Protection of images before they become instances (golden images)

Qualys SaaS Portal

  •    Dashboard displaying violations
  •    No Remediation Possible

Prisma SaaS

  •   Remediation of certain violations Possible

Rapid 7

Prisma SaaS versus Qualys

Work in progress



Need an experienced AWS/GCP/Azure/DevSecOps Professional to help out with your Public Cloud Strategy? Set up a time with Anuj Varma.
 

The post Deep Monitoring – Vulnerability Management on GCP VMs appeared first on For all your terraform needs.

]]>
https://terraformarchitect.com/gcp/deep-monitoring-vulnerability-management-on-gcp-vms/feed/ 0