{"id":23278772,"url":"https://github.com/yogitabadhe/terraform","last_synced_at":"2026-05-05T23:32:28.257Z","repository":{"id":265675382,"uuid":"896447792","full_name":"YogitaBadhe/Terraform","owner":"YogitaBadhe","description":"This project provides detailed steps to set up Terraform, launch an EC2 instance, and configure AWS CLI for managing infrastructure. ","archived":false,"fork":false,"pushed_at":"2024-11-30T12:27:36.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T12:46:29.295Z","etag":null,"topics":["aws","awscli","ec2-instance","github","s3-bucket","terraform"],"latest_commit_sha":null,"homepage":"https://github.com/YogitaBadhe/Terraform.git","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YogitaBadhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-30T11:46:18.000Z","updated_at":"2024-12-07T15:42:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"16754e73-a6a4-4bd2-9cbb-cf0914afc029","html_url":"https://github.com/YogitaBadhe/Terraform","commit_stats":null,"previous_names":["yogitabadhe/terraform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YogitaBadhe/Terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FTerraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FTerraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FTerraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FTerraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YogitaBadhe","download_url":"https://codeload.github.com/YogitaBadhe/Terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YogitaBadhe%2FTerraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32672623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws","awscli","ec2-instance","github","s3-bucket","terraform"],"created_at":"2024-12-19T22:34:37.814Z","updated_at":"2026-05-05T23:32:28.240Z","avatar_url":"https://github.com/YogitaBadhe.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"Here’s a detailed step-by-step `README.md` file for your Terraform project:\n\n```markdown\n# Terraform EC2 Instance Setup\n\nThis guide provides detailed steps to set up Terraform, launch an EC2 instance, and configure AWS CLI for managing infrastructure. \n\n---\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n1. **Amazon Linux Instance**: An EC2 instance with Amazon Linux OS.\n2. **AWS Account**: Access to your AWS Management Console.\n3. **SSH Key Pair**: A key pair for connecting to the instance (`terraformkey`).\n4. **Internet Access**: To install required packages and tools.\n\n---\n\n## Steps to Set Up and Execute\n\n### 1. Launch an EC2 Instance\n1. Open the AWS Management Console and navigate to **EC2**.\n2. Click **Launch Instance** and configure the following:\n   - **Name**: `Terraform`\n   - **AMI**: Amazon Linux 2\n   - **Instance Type**: `t2.micro`\n   - **Key Pair**: Select or create a key pair named `terraformkey`.\n   - **Security Group**: Allow SSH (port 22) for remote access.\n3. Click **Launch Instance**.\n\nUse your key pair to SSH into the instance:\n```bash\nssh -i terraformkey.pem ec2-user@\u003cEC2_PUBLIC_IP\u003e\n```\n\n---\n\n### 2. Install AWS CLI\nCheck if AWS CLI is installed:\n```bash\naws --version\n```\nIf not installed, follow these steps:\n1. Update the instance:\n   ```bash\n   sudo yum update -y\n   ```\n2. Download and install the AWS CLI:\n   ```bash\n   curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\n   unzip awscliv2.zip\n   sudo ./aws/install\n   ```\n3. Verify the installation:\n   ```bash\n   aws --version\n   ```\n\nFor more details, refer to the [AWS CLI installation guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#cliv2-linux-install).\n\n---\n\n### 3. Install Terraform\n1. Add the HashiCorp repository:\n   ```bash\n   sudo yum install -y yum-utils shadow-utils\n   sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo\n   ```\n2. Install Terraform:\n   ```bash\n   sudo yum -y install terraform\n   ```\n3. Verify the installation:\n   ```bash\n   terraform version\n   ```\n\nFor more details, refer to the [Terraform installation guide](https://developer.hashicorp.com/terraform/install).\n\n---\n\n### 4. Create IAM User and Group\n1. Log in to the **AWS Management Console**.\n2. Navigate to **IAM**.\n\n#### Create a User\n1. Go to **Users** and click **Add Users**.\n2. Enter the username: `Yogita`.\n3. Select **Access Key - Programmatic Access**.\n4. Click **Next**.\n\n#### Create a Group and Attach Policy\n1. Navigate to **User Groups** and click **Create Group**.\n2. Enter a name for the group, e.g., `AdminGroup`.\n3. Attach the **AdministratorAccess** policy to the group.\n4. Add the user `Yogita` to the group.\n5. Save the changes.\n\n#### Create Access Keys\n1. Go to the **User Details** page for `Yogita`.\n2. Under **Security Credentials**, click **Create Access Key**.\n3. Note down the **Access Key ID** and **Secret Access Key**.\n\n---\n\n### 5. Configure AWS CLI\nRun the following command to configure AWS CLI:\n```bash\naws configure\n```\nEnter the following details:\n- **Access Key ID**: [Your Access Key ID]\n- **Secret Access Key**: [Your Secret Access Key]\n- **Region**: `us-east-1`\n- **Output Format**: `json`\n\nVerify the configuration:\n```bash\naws s3 ls\n```\n\n---\n\n### 6. Set Up Terraform Project\n1. Create a project folder:\n   ```bash\n   mkdir project\n   cd project\n   ```\n2. Create a `main.tf` file:\n   ```bash\n   touch main.tf\n   nano main.tf\n   ```\n3. Paste the following code into `main.tf`:\n   ```hcl\n   terraform {\n     required_providers {\n       aws = {\n         source = \"hashicorp/aws\"\n         version = \"5.78.0\"\n       }\n     }\n   }\n   provider \"aws\" {\n     region = \"us-east-1\"\n   }\n   ```\n\n---\n\n### 7. Execute Terraform Commands\n1. Initialize Terraform:\n   ```bash\n   terraform init\n   ```\n2. Preview the execution plan:\n   ```bash\n   terraform plan\n   ```\n3. Apply the changes:\n   ```bash\n   terraform apply\n   ```\n   - Type `yes` when prompted.\n4. To destroy the resources:\n   ```bash\n   terraform destroy\n   ```\n   - Type `yes` when prompted.\n\n---\n\n## Notes\n- **Security**: Ensure your Access Keys are securely stored and not shared.\n- **Cleanup**: Always destroy resources when they are no longer needed to avoid unnecessary charges.\n- **Documentation**: Refer to Terraform [documentation](https://developer.hashicorp.com/terraform/docs) for advanced usage.\n``` \n\nThis detailed README provides clarity on every step required to complete your Terraform EC2 setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogitabadhe%2Fterraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyogitabadhe%2Fterraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogitabadhe%2Fterraform/lists"}