{"id":15698716,"url":"https://github.com/onlydole/iac-in-action","last_synced_at":"2025-04-30T08:43:02.457Z","repository":{"id":89714101,"uuid":"287164034","full_name":"onlydole/iac-in-action","owner":"onlydole","description":"A great workshop to start your infrastructure as code journey!","archived":false,"fork":false,"pushed_at":"2020-08-13T02:41:36.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-26T09:51:55.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onlydole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security-group.tf","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-13T02:40:59.000Z","updated_at":"2022-08-15T12:41:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"b435819e-b188-4903-9f02-d0bb4aae2473","html_url":"https://github.com/onlydole/iac-in-action","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlydole%2Fiac-in-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlydole%2Fiac-in-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlydole%2Fiac-in-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlydole%2Fiac-in-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onlydole","download_url":"https://codeload.github.com/onlydole/iac-in-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251670414,"owners_count":21625037,"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-10-03T19:32:42.049Z","updated_at":"2025-04-30T08:43:02.429Z","avatar_url":"https://github.com/onlydole.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IaC in Action\n\n\u003e Reading material and code examples\n\n## Table of Contents\n\n- [IaC in Action](#code-all-the-things-terraform-x-aws)\n  - [Table of Contents](#table-of-contents)\n  - [Prerequisites](#prerequisites)\n  - [Reading material](#reading-material)\n    - [HashiCorp Configuration Language](#hashicorp-configuration-language)\n  - [First Steps](#first-steps)\n    - [Providers for Terraform](#providers-for-terraform)\n    - [AWS-specific Terraform Resources](#aws-specific-terraform-resources)\n    - [Other Terraform Resources](#other-terraform-resources)\n    - [Outputs](#outputs)\n  - [Next Steps](#next-steps)\n    - [Code Quality](#code-quality)\n    - [Modules](#modules)\n  - [Author Information](#author-information)\n  - [License](#license)\n\n## Prerequisites\n\nAs part of this workshop, you will be using [HashiCorp Terraform](https://www.terraform.io) and [Amazon Web Services](https://aws.amazon.com).\n\nFor instructions on how to install Terraform. please see our [Learn Guide](https://learn.hashicorp.com/terraform/getting-started/install.html).\n\nOn that page, you will find instructions for macOS (using `brew`), Windows (using `choco`) as well as a manual installation path.\n\n## Reading material\n\nThis section is a collection of links that will help you make the most of today's session.\n\n### HashiCorp Configuration Language\n\n- repository: [hashicorp/hcl](https://github.com/hashicorp/hcl/tree/hcl2)\n- intermediate HCL: [Configuration Languages in HCL2](https://www.hashicorp.com/resources/intermediate-hcl-configuration-languages-in-hcl2/)\n\n## First Steps\n\n- CLI commands [terraform.io/docs/commands/index.html](https://www.terraform.io/docs/commands/index.html)\n- variables and type constraints: [terraform.io/docs/configuration/variables.html](https://www.terraform.io/docs/configuration/variables.html#type-constraints)\n- variable definition files: [terraform.io/docs/configuration/variables.html](https://www.terraform.io/docs/configuration/variables.html#variable-definitions-tfvars-files)\n- information about Terraform State: [terraform.io/docs/state/index.html](https://www.terraform.io/docs/state/index.html)\n\n### Providers for Terraform\n\nWe used the following Providers for this workshop:\n\n- `tls` Provider: [terraform.io/docs/providers/tls](https://www.terraform.io/docs/providers/tls/index.html)\n- `local` Provider: [terraform.io/docs/providers/local](https://www.terraform.io/docs/providers/local/index.html)\n- `http` Provider: [terraform.io/docs/providers/http](https://www.terraform.io/docs/providers/http/index.html)\n- `aws` Provider: [terraform.io/docs/providers/aws](https://www.terraform.io/docs/providers/aws/index.html)\n\n### AWS-specific Terraform Resources\n\nWe used the following AWS-specific Data Sources and Resources for this workshop:\n\n- Data Source `aws_vpc`: [terraform.io/docs/providers/aws/d/vpc.html](https://www.terraform.io/docs/providers/aws/d/vpc.html)\n- Resource `aws_security_group`: [terraform.io/docs/providers/aws/r/security_group.html](https://www.terraform.io/docs/providers/aws/r/security_group.html)\n- Resource `aws_security_group_rule`: [terraform.io/docs/providers/aws/r/security_group_rule.html](https://www.terraform.io/docs/providers/aws/r/security_group_rule.html)\n- Resource `aws_key_pair`: [terraform.io/docs/providers/aws/r/key_pair.html](https://www.terraform.io/docs/providers/aws/r/key_pair.html)\n- Resource `aws_instance`: [terraform.io/docs/providers/aws/r/instance.html](https://www.terraform.io/docs/providers/aws/r/instance.html)\n- Resource `aws_ebs_volume`: [terraform.io/docs/providers/aws/r/ebs_volume.html](https://www.terraform.io/docs/providers/aws/r/ebs_volume.html)\n- Resource `aws_volume_attachment`: [terraform.io/docs/providers/aws/r/volume_attachment.html](https://www.terraform.io/docs/providers/aws/r/volume_attachment.html)\n- Resource `aws_s3_bucket` [terraform.io/docs/providers/aws/r/s3_bucket.html](https://www.terraform.io/docs/providers/aws/r/s3_bucket.html)\n\n### Other Terraform Resources\n\nWe used the following Data Sources and Resources for this workshop:\n\n- Resource `tls_private_key`: [terraform.io/docs/providers/tls/r/private_key.html](https://www.terraform.io/docs/providers/tls/r/private_key.html)\n- Resource `local_file`: [terraform.io/docs/providers/local/r/file.html](https://www.terraform.io/docs/providers/local/r/file.html)\n- Data Source `http`: [terraform.io/docs/providers/http/data_source.html](https://www.terraform.io/docs/providers/http/data_source.html)\n\n### Outputs\n\nAfter running `terraform plan -out=aws.tfplan` and `terraform apply aws.tfplan`, you will have two resources:\n\n- an EC2 Instance (see [AWS Console](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1))\n- an S3 Bucket with Website Hosting (see [AWS Console](https://console.aws.amazon.com/s3/home?region=us-east-1))\n\nFor both of these, we have created [Terraform Outputs](https://www.terraform.io/docs/configuration/outputs.html) that can be retrevied using the [output Command](https://www.terraform.io/docs/commands/output.html):\n\n```sh\n# show all outputs\nterraform output\n\n# show SSH connection string for EC2 Instance\nterraform output ssh_connection_string\n\n# show Website Endpoint for S3 Bucket\nterraform output website_url\n```\n\n- The SSH Connection String can be used to connect to your EC2 Instance. This uses the `ec2-ssh-key.pem` file.\n- The Website Endpoint can be used to view S3-Bucket hosted website files for static websites.=\n\n## Next Steps\n\n- Learn Guide: Build infrastructure [learn.hashicorp.com/terraform/getting-started/build](https://learn.hashicorp.com/terraform/getting-started/build)\n- Build your own AMIs with Packer: [packer.io/docs/builders/amazon/](https://www.packer.io/docs/builders/amazon/)\n\n### Code Quality\n\nBefore `plan` and `apply`, always clean up your code:\n\n- use [terraform fmt](https://www.terraform.io/docs/commands/fmt.html) to rewrite Terraform configuration files to a canonical format and style.\n- use [terraform validate](https://www.terraform.io/docs/commands/validate.html) to validate the configuration syntax and internal consistency\n- use [pre-commit](https://pre-commit.com) to run more checks\n  - community member [@antonbabenko](https://github.com/antonbabenko/) built and maintains [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform)\n\n### Modules\n\n- use modules as building blocks\n- module documentation: [terraform.io/docs/configuration/modules.html](https://www.terraform.io/docs/configuration/modules.html)\n- module registry: [registry.terraform.io](https://registry.terraform.io)\n- Learn Guide: Modules on [learn.hashicorp.com/terraform/modules/modules-overview](https://learn.hashicorp.com/terraform/modules/modules-overview)\n\n## Author Information\n\nThis repository is maintained by [Taylor Dolezal](https://github.com/onlydole) .\n\n## License\n\nLicensed under the Apache License, Version 2.0 (the \"License\").\n\nYou may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _\"AS IS\"_ basis, without WARRANTIES or conditions of any kind, either express or implied.\n\nSee the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlydole%2Fiac-in-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlydole%2Fiac-in-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlydole%2Fiac-in-action/lists"}