I have component.tfstack.hcl file
component "vpc" {
for_each = var.regions
source = "./vpc"
inputs = {
environment = var.environment
region = each.value
}
providers = {
aws = provider.aws.configurations[each.value]
}
}
component "first" {
for_each = var.regions
source = "./nodes"
inputs = {
environment = var.environment
region = each.value
version = "v2.1.4"
vpc_id = component.vpc[each.value].vpc.id
public_subnets = component.vpc[each.value].vpc.public_subnets
security_group_id = component.vpc[each.value].security_group_id
}
providers = {
aws = provider.aws.configurations[each.value]
}
}
component "second" {
for_each = var.regions
source = "./nodes"
inputs = {
environment = var.environment
region = each.value
version = "v2.1.4"
vpc_id = component.vpc[each.value].vpc.id
public_subnets = component.vpc[each.value].vpc.public_subnets
security_group_id = component.vpc[each.value].security_group_id
}
providers = {
aws = provider.aws.configurations[each.value]
}
}
and a deployment which deploys for an environment e.g. lets say dev
dev.tfdeploy.hcl
identity_token "aws" {
audience = ["aws.workload.identity"]
}
deployment "dev" {
inputs = {
# the component configuration is deployed across the regions specified below
regions = ["eu-west-1", "us-east-1"]
environment = "dev"
role_arn = "my-arn"
identity_token = identity_token.aws.jwt
}
}
this will create [vpc, first[eu-west-1], first[us-east-1], second[eu-west-1], second[eu-west-2]]
how can I independently update the resource only in [first[eu-west-1], first[us-east-1]] with terraform stack. in typical terraform we could maybe use --target
secondly how do I take information or output from one stack and pass it to another stack e.g. lets say I have a stackA, stackB and stackC and I want to share information from stackA to both stackB and C