Skip to content

Make cloud instance sizes configurable#106

Open
SahilGupta2810 wants to merge 4 commits into
learntocloud:mainfrom
SahilGupta2810:issue-95-region-vm-selection
Open

Make cloud instance sizes configurable#106
SahilGupta2810 wants to merge 4 commits into
learntocloud:mainfrom
SahilGupta2810:issue-95-region-vm-selection

Conversation

@SahilGupta2810
Copy link
Copy Markdown

Summary

This PR addresses issue #95 by making the default compute size configurable across all three cloud providers, while preserving the current default behavior.

Changes

  • AWS
    • Added aws_instance_type variable with default t3.micro
    • Updated the EC2 instance resource to use var.aws_instance_type
  • Azure
    • Added azure_vm_size variable with default Standard_B1s
    • Updated the VM resource to use var.azure_vm_size
  • GCP
    • Added gcp_machine_type variable with default e2-micro
    • Updated the compute instance resource to use var.gcp_machine_type

Documentation

  • Added TROUBLESHOOTING.md with beginner-friendly AWS guidance for:
    • region / endpoint / auth errors
    • quota / vCPU limit errors
    • SCP / explicit deny errors
  • Added provider-specific command guides:
    • docs/AWS_COMMANDS.md
    • docs/AZURE_COMMANDS.md
    • docs/GCP_COMMANDS.md
  • Updated provider READMEs to link to troubleshooting and command docs
  • Updated the AWS README to guide users to check enabled regions first, then set aws_region before applying Terraform

Why

Issue #95 points out that fixed defaults for region and VM size can fail depending on account restrictions, quota, or provider availability. This change keeps the existing defaults intact while allowing users to override them without editing Terraform files directly.

Examples:

terraform apply -var="aws_instance_type=t3.small"
terraform apply -var="azure_vm_size=Standard_B2s"
terraform apply -var="gcp_machine_type=e2-small"

@SahilGupta2810 SahilGupta2810 force-pushed the issue-95-region-vm-selection branch from 7080ff1 to acdaf5b Compare June 2, 2026 18:59
@SahilGupta2810
Copy link
Copy Markdown
Author

@madebygps can you please review this ?

@Princeman2
Copy link
Copy Markdown

Hi @SahilGupta2810 and maintainers,

I just finished my first PR (#92). I'm familiar with Azure only.

I'd like to help improve the Azure part of this PR:

  • Improve the Azure README with clearer beginner steps
  • Add more troubleshooting for common Azure errors (quota, region, subscription)
  • Test it on my Azure account

Is that okay? I will only touch Azure files.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #95 by making the default VM/instance size configurable for AWS, Azure, and GCP Terraform deployments (while keeping existing defaults), and adds troubleshooting / command-flow documentation to help users handle common provider/account constraints.

Changes:

  • Add new Terraform variables for compute sizing (aws_instance_type, azure_vm_size, gcp_machine_type) and wire them into the corresponding instance/VM resources.
  • Add root troubleshooting guidance (currently AWS-focused) plus provider-specific “copy/paste” command guides.
  • Update provider READMEs to link to the new docs.
Show a summary per file
File Description
aws/main.tf Adds aws_instance_type variable and uses it for the EC2 instance.
azure/main.tf Adds azure_vm_size variable and uses it for the VM size.
gcp/main.tf Adds gcp_machine_type variable and uses it for the compute instance machine type.
aws/README.md Updates AWS getting-started flow and links to command/troubleshooting docs.
azure/README.md Links to the Azure command flow doc and troubleshooting doc.
gcp/README.md Links to the GCP command flow doc and troubleshooting doc.
TROUBLESHOOTING.md Adds beginner-facing troubleshooting guidance (AWS sections + placeholders for Azure/GCP).
docs/AWS_COMMANDS.md Adds a guided command flow for selecting region/instance type and running Terraform.
docs/AZURE_COMMANDS.md Adds a guided command flow for selecting subscription/region/VM size and running Terraform.
docs/GCP_COMMANDS.md Adds a guided command flow for selecting project/region/zone/machine type and running Terraform.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 2

Comment thread aws/README.md Outdated
Comment on lines +41 to +45
Or pass the exported value directly to Terraform:

```sh
terraform apply -var="aws_region=$AWS_REGION"
```
Comment thread TROUBLESHOOTING.md
Comment on lines +14 to +16
<!-- Placeholder for future screenshots: ![AWS troubleshooting screenshot](docs/images/aws-troubleshooting.png) -->

Before your first AWS deploy, list the regions that are enabled for your account:
@SahilGupta2810
Copy link
Copy Markdown
Author

Addressed the latest review feedback in .

Changes made:

  • removed the early example from the AWS README so only appears after �[0m�[1mTerraform initialized in an empty directory!�[0m

The directory has no Terraform configuration files. You may begin working
with Terraform immediately by creating Terraform configuration files.�[0m

  • added an explicit note in that the AWS Terraform commands assume you are running them from the directory

If there are any other adjustments needed, I can update the branch.

@SahilGupta2810
Copy link
Copy Markdown
Author

SahilGupta2810 commented Jun 4, 2026

@madebygps review changes are commited

Addressed the latest review feedback in commit 5312ec3.

Changes made:

  • removed the early terraform apply example from the AWS README so apply only appears after terraform init
  • added an explicit note in TROUBLESHOOTING.md that the AWS Terraform commands assume you are running them from the aws/ directory

If there are any other adjustments needed, I can update the branch.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 1

Comment thread aws/README.md
Comment on lines 45 to 48
```sh
terraform init
terraform apply
terraform apply -var="aws_region=$AWS_REGION"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants