Run Terraform With AWS Profile
export AWS_PROFILE=profile_name
export AWS_PROFILE=profile_name
Summary AWS Codebuild is fully managed build service that compiles source code, run tests, and produces software packages that are ready to reploy. To make it easier, we can create it’s infrastructure using terraform. Setup directory structure Before we begin, we can create our own directory structure for the infrastructure. Why this is important? because … Read more
find . -type d -exec bash -c ‘cd “$0” && terraform fmt’ {} \;
Datadog $ terraform import module.timeboard_system.datadog_timeboard.system 111xxx SQS $ terraform import module.resource-name.aws_sqs_queue.main https://sqs.ap-southeast-1.amazonaws.com/123xxx/xxxx Notes: If you cannot find the resource address, try: $ terraform plan
#!/bin/bash cd prd && ls -d */ declare -a dirs i=1 for d in */ do dirs[i++]=”${d%/}” done echo “There are ${#dirs[@]} dirs in the current path” for((i=1;i<=${#dirs[@]};i++)) do cd “${dirs[i]}” && rm -rf .terraform \ && echo “terraform {” > backend.tf \ && echo “backend \”consul\” {” >> backend.tf \ && echo “}” >> … Read more
provider “aws” { access_key = “” secret_key = “” region = “ap-southeast-1” } resource “aws_instance” “web-1” { vpc_security_group_ids = [“sg-xxxxxxxx”] subnet_id = “subnet-xxxxxxxx” ami = “ami-xxxxxxxx” availability_zone = “ap-southeast-1a” instance_type = “t2.micro” tags { Name = “test-terraform-1” } }