Skip to content

Add Generated Terraform Stacks Configuration Files and Update .gitignore#2

Draft
sujaysamanta wants to merge 3 commits intomainfrom
stack-retry-test-v2
Draft

Add Generated Terraform Stacks Configuration Files and Update .gitignore#2
sujaysamanta wants to merge 3 commits intomainfrom
stack-retry-test-v2

Conversation

@sujaysamanta
Copy link
Contributor

@sujaysamanta sujaysamanta commented Jan 5, 2026

This pull request introduces new Terraform stack configuration files and supporting infrastructure for managing EC2 instances using Terraform stacks and modules. The changes add a complete set of generated components, provider, variable, output, and deployment configuration files, along with the necessary lockfiles and infrastructure resources to support stack migration and deployment in Terraform Cloud.

The most important changes are:

Terraform Stack Components and Configuration:

  • Added _stacks_generated/components.tfcomponent.hcl to define an ec2_instance component using the terraform-aws-modules/ec2-instance/aws module, parameterized by variables and configured for the ap-south-1 region.
  • Added _stacks_generated/variables.tfcomponent.hcl to declare input variables for instance name, type, AMI ID, and AWS credentials, including sensitive and ephemeral flags for secrets.
  • Added _stacks_generated/providers.tfcomponent.hcl to configure the AWS provider with required credentials and region, and specify provider version constraints.

Deployment and Output Configuration:

  • Added _stacks_generated/deployment.tfdeploy.hcl to define a deployment for the dev-workspace, including authentication notes, variable sets, and resource import settings.
  • Added _stacks_generated/outputs.tfcomponent.hcl to expose the EC2 instance ID and public IP as outputs from the stack component.

Infrastructure and Lockfiles for Stack Migration:

  • Added stacks_migration_infra/main.tf to provision Terraform Cloud resources (tfe_project, tfe_stack) and configure stack migration using the tfmigrate_stack_migration resource.
  • Added lockfiles (_stacks_generated/.terraform.lock.hcl, stacks_migration_infra/.terraform.lock.hcl) to pin provider versions for both the stack and migration infrastructure. [1] [2]
  • Added supporting variable and output files for the migration infrastructure (stacks_migration_infra/variables.tf, stacks_migration_infra/output.tf). [1] [2]

Version Pinning:

  • Set the Terraform version to 1.13.5 in _stacks_generated/.terraform-version for consistency across the generated stack.

Stack Details
Project URL: https://app.terraform.io/app/sujay-test-01/projects/prj-yD4XuBYiA8iusSJJ
Stack URL: https://app.terraform.io/app/sujay-test-01/projects/prj-rMfnU5SuXnKqA4iJ/stacks/st-BSd8Z4kSiWKFi3Ws

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.

1 participant