Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions _stacks_generated/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _stacks_generated/deployment.tfdeploy.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ deployment "dev-workspace" {
access_key = store.varset.tokens.AWS_ACCESS_KEY_ID
secret_key = store.varset.tokens.AWS_SECRET_ACCESS_KEY
session_token = store.varset.tokens.AWS_SESSION_TOKEN
instance_name = "stack-v3-test-dev-instance"
instance_type = "t3.micro"
ami_id = "ami-0dee22c13ea7a9a67"
instance_name = "stack-v3-test-dev-instance"
}
import = true
}
Expand All @@ -30,9 +30,9 @@ deployment "prod-workspace" {
access_key = store.varset.tokens.AWS_ACCESS_KEY_ID
secret_key = store.varset.tokens.AWS_SECRET_ACCESS_KEY
session_token = store.varset.tokens.AWS_SESSION_TOKEN
ami_id = "ami-0dee22c13ea7a9a67"
instance_name = "stack-v3-test-prod-instance"
instance_type = "t3.micro"
ami_id = "ami-0dee22c13ea7a9a67"
}
import = true
}
Expand Down
2 changes: 1 addition & 1 deletion _stacks_generated/providers.tfcomponent.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

provider "aws" "this" {
config {
region = "ap-south-1"
region = "ap-south-1"
access_key = var.access_key
secret_key = var.secret_key
token = var.session_token
Expand Down
1 change: 1 addition & 0 deletions _stacks_generated/variables.tfcomponent.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ variable "session_token" {
sensitive = true
ephemeral = true
}

28 changes: 14 additions & 14 deletions stacks_migration_infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions stacks_migration_infra/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
terraform {
required_providers {
tfe = {
source = "hashicorp/tfe"
version = ">= 0.67.0"
source = "hashicorp/tfe"
version = ">= 0.73.0"
}
tfmigrate = {
source = "hashicorp/tfmigrate"
Expand All @@ -22,15 +22,16 @@ resource "tfe_project" "stack_project" {
}

resource "tfe_stack" "stack" {
name = var.stack_name
project_id = tfe_project.stack_project.id
name = var.stack_name
project_id = tfe_project.stack_project.id
migration = true # Identifies the stack is created for migration purposes
}

resource "tfmigrate_stack_migration" "stack_migration" {
config_file_dir = var.stacks_config_file_dir
organization = var.organization_name
name = tfe_stack.stack.name
project = tfe_project.stack_project.name
terraform_config_dir = var.terraform_config_dir
config_file_dir = var.stacks_config_file_dir
organization = var.organization_name
name = tfe_stack.stack.name
project = tfe_project.stack_project.name
terraform_config_dir = var.terraform_config_dir
workspace_deployment_mapping = var.workspace_deployment_mapping
}
}
13 changes: 0 additions & 13 deletions stacks_migration_infra/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,4 @@ output "project_url" {

output "stack_url" {
value = "https://app.terraform.io/app/${var.organization_name}/projects/${tfe_project.stack_project.id}/stacks/${tfe_stack.stack.id}"
}

locals {
stack_deployment_details = (
tfmigrate_stack_migration.stack_migration.migration_hash != "" ?
provider::tfmigrate::decode_stacks_migration_hash_to_json(
tfmigrate_stack_migration.stack_migration.migration_hash
) : null
)
}

output "stack_deployment_details" {
value = local.stack_deployment_details
}
4 changes: 2 additions & 2 deletions stacks_migration_infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ variable "tfe_hostname" {
}

variable "project_name" {
default = "new-stacks-project"
default = "stack-with-source"
}

variable "stack_name" {
default = "new-stacks-v1"
default = "stack-with-migration-source-v1"
}

variable "stacks_config_file_dir" {
Expand Down