{"id":21359884,"url":"https://github.com/ujstor/aws-terraform","last_synced_at":"2026-03-19T20:03:10.117Z","repository":{"id":241402645,"uuid":"806256865","full_name":"Ujstor/aws-terraform","owner":"Ujstor","description":"Advanced TF Concepts from the book 'Terraform: Up and Running'","archived":false,"fork":false,"pushed_at":"2024-06-30T01:39:46.000Z","size":145,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T18:51:52.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ujstor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-26T19:55:15.000Z","updated_at":"2024-06-30T01:39:49.000Z","dependencies_parsed_at":"2024-06-21T05:11:41.361Z","dependency_job_id":"a5049a11-91cf-4cc9-b093-6852bd851343","html_url":"https://github.com/Ujstor/aws-terraform","commit_stats":null,"previous_names":["ujstor/aws-asg-tf","ujstor/aws-terraform"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ujstor%2Faws-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ujstor%2Faws-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ujstor%2Faws-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ujstor%2Faws-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ujstor","download_url":"https://codeload.github.com/Ujstor/aws-terraform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835936,"owners_count":20355609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T05:30:27.675Z","updated_at":"2026-01-03T16:03:53.650Z","avatar_url":"https://github.com/Ujstor.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform: Up \u0026 Running Code\n\nThis repo contains my code implementation for the book *[Terraform: Up and Running](http://www.terraformupandrunning.com)* \n\n## Packer\n\nTo build the Amazon Machine Image (AMI):\n\n```bash\npacker build webserver.json\n```\n\n## Local k8s cluster:\n[k3d](https://k3d.io/v5.6.3/usage/configfile/) is a lightweight wrapper to run [k3s](https://k3s.io/) (Rancher Lab’s minimal Kubernetes distribution) in docker.\n\n```bash\nk3d cluster create terraform \\\n  --servers 3 \\\n  --agents 3 \\\n  -p \"80:80@loadbalancer\" \\\n  -p \"443:443@loadbalancer\" \\\n  --k3s-node-label \"type=control@server:0,1,2\" \\\n  --k3s-node-label \"type=worker@agent:0,1,2\"\n```\n\nFor local testing with k3d, comment out the 'loadbalancer' form in the service object.\n\n```terraform\n  spec {\n    # type = \"LoadBalancer\"\n    port {\n      port        = var.ingress_port\n      target_port = var.container_port\n      protocol    = \"TCP\"\n    }\n    selector = local.pod_labels\n  }\n```\n\n## kubectl AWS\n\n```bash\naws eks update-kubeconfig --region \u003cREGION\u003e --name \u003cEKS_CLUSTER_NAME\u003e\n```\n\n## Terratest\n\n```bash\ncd modules/test\ngo test -v -timeout 30m\ngo test -v -timeout 30m -run TestHelloWorldAppExample\ngo test -v -timeout 30m -parallel 2\n```\n\n### Integration tests\n\nFor testing multiple modules in the staging environment, extract the state S3 config into a separate file.\nThis will prevent overwriting the state file and can be used manually:\n\n```bash\nterraform init -backend-config=backend.hcl\n```\n\nRun the integration tests:\n\n```bash\ngo test -v -timeout 30m -run TestHelloWorldAppStage\n```\nIf Stagins is implemented, exclude steps for the Stages:\n\n```bash\nSKIP_teardown_db=true \\\nSKIP_teardown_app=true \\\nSKIP_deploy_db=true \\\nSKIP_deploy_app=true \\\nSKIP_validate_app=true \\\ngo test -v -timeout 30m -run TestHelloWorldAppStage\n```\n### Integration tests in Stages\n\n```bash\nSKIP_teardown_db=true \\\nSKIP_teardown_app=true \\\ngo test -timeout 30m -run TestHelloWorldAppStageWithStages\n```\n\n```bash\nSKIP_teardown_db=true \\\nSKIP_teardown_app=true \\\nSKIP_deploy_db=true \\\ngo test -timeout 30m -run TestHelloWorldAppStageWithStages\n```\n\nclean up\n\n```bash\nSKIP_deploy_db=true \\\nSKIP_deploy_app=true \\\nSKIP_validate_app=true \\\ngo test -timeout 30m -run TestHelloWorldAppStageWithStages\n```\n## License\n\nThis code is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujstor%2Faws-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fujstor%2Faws-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujstor%2Faws-terraform/lists"}