Skip to content

Latest commit

 

History

History
103 lines (56 loc) · 2.98 KB

reproduce-08-provisioning-resources-amg.md

File metadata and controls

103 lines (56 loc) · 2.98 KB

Golang Bookstore ADOT

ADOT (AWS Distro for OpenTelemetry) Implementation for Simple Golang RESTful API Application (Bookstore)

goreport all contributors tags docker pulls download all view clone issues pull requests forks stars license


Provisioning Managed Services Grafana (AMG)

Clean Cache

  • Goto terraform/environment/providers/aws/infra/resources/amg folder

    cd terraform/environment/providers/aws/infra/resources/amg
    
  • Cleanup Cache Terraform

    rm -rf .terraform .terraform.lock.hcl terraform.amp.d
    

Initialize Terraform

terraform init

Using Terraform Workspace

  • Production Environment

    WORKSPACE_ENV=prod
    terraform workspace select $WORKSPACE_ENV || terraform workspace new $WORKSPACE_ENV
    
  • Staging Environment

    WORKSPACE_ENV=staging
    terraform workspace select $WORKSPACE_ENV || terraform workspace new $WORKSPACE_ENV
    
  • Lab Environment

    WORKSPACE_ENV=lab
    terraform workspace select $WORKSPACE_ENV || terraform workspace new $WORKSPACE_ENV
    

Terraform Plan

  • Save Binary Plan

    terraform plan --out tfplan.binary
    
  • Export to JSON

    terraform show -json tfplan.binary > tfplan.json
    

Terraform Security

  • Using: terrascan

    terrascan init
    terrascan scan -o human
    
  • Using: tfsec

    tfsec .
    
  • Using: checkov

    checkov -f tfplan.json
    

Terraform Cost Review

  • Using: infracost

    infracost breakdown --path tfplan.json
    

Terraform Apply

  terraform apply -auto-approve

CleanUp All

  • Cleanup Terraform Cache

    rm -rf .terraform .terraform.lock.hcl terraform.amp.d
    
  • Destroy All Managed Services Grafana (AMG)

    terraform destroy -auto-approve