Skip to content

Latest commit

 

History

History
103 lines (56 loc) · 2.99 KB

reproduce-07-provisioning-resources-amp.md

File metadata and controls

103 lines (56 loc) · 2.99 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 Prometheus (AMP)

Clean Cache

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

    cd terraform/environment/providers/aws/infra/resources/amp
    
  • 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 Prometheus (AMP)

    terraform destroy -auto-approve