Category: Programming Language
-
GCP + Kitchen Terraform: Local Development Workflow
INTRODUCTION Here’s a typical workflow for implementing and running Kitchen Terraform tests outside of the GCP environment, for example, from an IDE on a Mac laptop. Enable “gcloud” Access Command: The first step is to ensure we can interact with GCP using the gcloud command using our user credential. This is needed because the tests… Read More…
-
Terragrunt: “plan-all” while Passing Outputs between Modules
PROBLEM Terragrunt has a feature that allows one module to pass outputs to another module. For example, if “project-prod” module wants to consume “subfolders” output from “folder” module, it can be done like this in “project-prod” module’s terragrunt.hcl:- The challenge is when running commands such as plan-all, it will fail with the following error:- SOLUTION… Read More…
-
GCP + Terraform: “google: could not find default credentials” Error
PROBLEM When running any Terraform commands (init, plan, etc) from a different server, the following error is thrown:- SOLUTION One recommended way is to set up a service account by following the instruction from the above link. Another way, for developement purpose, is to install Google Cloud SDK and run the following gcloud command, which… Read More…
-
Terraform: “Error acquiring the state lock” Error
PROBLEM When running terraform plan, the following error is thrown:- SOLUTION One way is to disable locking by passing -lock=false flag. However, if you are sure the lock isn’t properly released, to perform a force unlock, run this command: In this case… Read More…
-
Webpack: Managing Tree Shaking
PROBLEM Sometimes, Webpack’s tree-shaking may accidentally eliminate imported code from import statements. For example, we may have a root JS file that imports a CSS file:- … and for some reason, the CSS file will never appear in the final bundle even if the Webpack config contains proper rules to handle CSS files. SOLUTION To… Read More…
-
Feign + Eureka: UnknownHostException when Attempting to Invoke a Service
PROBLEM When attempting use Feign to invoke a service through Eureka, the following exception occurs:- SOLUTION Go to the donkey-kong-service app and add the following line to the application.properties:- Now, when Feign tries to invoke the service, the IP address will be used instead of the OS’ reported hostname. Read More…