ADOT (AWS Distro for OpenTelemetry) Implementation for Simple Golang RESTful API Application (Bookstore)
-
Goto
terraform/environment/providers/aws/infra/resources/amp
foldercd terraform/environment/providers/aws/infra/resources/amp
-
Cleanup Cache Terraform
rm -rf .terraform .terraform.lock.hcl terraform.amp.d
terraform init
-
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
-
Save Binary Plan
terraform plan --out tfplan.binary
-
Export to JSON
terraform show -json tfplan.binary > tfplan.json
-
Using:
terrascan
terrascan init terrascan scan -o human
-
Using:
tfsec
tfsec .
-
Using:
checkov
checkov -f tfplan.json
-
Using:
infracost
infracost breakdown --path tfplan.json
terraform apply -auto-approve
-
Cleanup Terraform Cache
rm -rf .terraform .terraform.lock.hcl terraform.amp.d
-
Destroy All Managed Services Prometheus (AMP)
terraform destroy -auto-approve