I noticed the state file is versioned in addition to serialized. Can I rely on non-breaking changes in the state files output for a given version, or is that version something different? I know the serial is incremented with each change
zzamboni has quit
zzamboni1 joined the channel
ranmanh
Quick question..... For requests and questions, where is the right place for it?
solarce
ranmanh: depends, requests should probably be filed as github issues, questions can be asked here and/or on the google group
failshell has quit
Boltsky has quit
m_j_h has quit
m_j_h joined the channel
gamename has quit
gamename joined the channel
cvvs has quit
sfeinste has quit
svend joined the channel
lynxman has quit
svend
I am using split() to pass a list to a module, but specifying an empty list by passing an empty string isn't working. Splitting an empty ["${split(",", "")}"] seems to result in [""], instead of [].
lynxman joined the channel
nathanle_ has quit
phinze
solarce: ranmanh: we also are happy to field questions as issues too
Spark: i say sort 'em!
cvvs: terraform does "state migration" on a per-resource basis to facilitate non-breaking changes to the state between versions
iamchrisf: ahh you want interp in names... i can see why you'd want it... might be a little hard to implement given current evaluation order
svend: interesting i seem to recall a conversation about split() where we concluded the behavior should be the opposite - let me look it up
iamchrisf
phinze: yea, but otherwise we are left hard-coding and creating a lot of duplicate code :(
phinze
oh yeah we should definitely make it work - it's just a question of how much effort and when we can put it in. feels like something we probably have an existing issue for - let me see
nathanleiby joined the channel
iamchrisf
phinze: thx
svend
phinze: Thanks for checking
nathanle_ joined the channel
nathanleiby has quit
phinze
svend: ahh yes, because you're already in brackets. split(",", "") yields "", but "" ends up as a member of the list
not quite "wontfix" but "wontfixsoon - use module namespacing in the meantime"
iamchrisf
phinze: ugh yea.. that means I’m going to have to have stg uat prod qa etc env dirs and 20-30 sub-dirs for each piece of my stack. It’s going to be super messy :(
phinze
i see 1 module per env... but why 20-30 sub dirs?
iamchrisf
Each environment has 20-30 separate pieces.
phinze
in each can't you just invoke module "thing_type" { source "../thing_type" }
and if the collection of 20-30 is the same per env each env is just module "collection" { source "../collection", env = "prod" }
iamchrisf
each piece would be its own module and hence it’s own subdir. I don’t want to plan and apply the entire stack. Just a piece at a time. Want to mitigate the risk.
phinze
ah gotchya
so ... 20-30 statefiles per env?
iamchrisf
correct.
I was looking ar writing a wrapper script that would change the remote location based on the environment var.
use the same templated stack, but unfortunately until that interpolation works I’m going to have a full stack for each environment.
phinze
for my money, `terraform plan` already mitigates the risk, so i'd just stitch everything together.
but that doesn't invalidate your plan as a use case
nathanleclaire has quit
"until that interpolation works I’m going to have a full stack for each environment" <-- why is this the case? seems like with everything isolated you wouldn't have name collisions
iamchrisf
plan have some major annoyances for me. especially this
everytime I make security group changes I sweat bullets
phinze
fair point - seems reportable as an issue
also worth noting that we're pulling up security_group_rule into a top-level resource for that reason - managing the whole collection of rules in one shot makes some scenarios impossible (like adding single rules across module boundaries, or dynamically)
iamchrisf
Yea we really need to be able to add single ingress egress rules to existing security groups. I’m having to open ports to the entire damn VPC CIDR .. (no no no no) until that comes around.
iamchrisf: so your wrapper would append the proper `-state=${ENV}.tfstate` arg to the terraform run?
iamchrisf
phinze: it would acctually do a remote config with a new path use1/ENV-web-app
phinze
seems like you could still do that - just invoke the same modules and have separate ENV.tfvars and ENV.tfstate
failshell joined the channel
ah sure
in other words what changes between tf/use1/stg/web-app/main.tf and tf/use1/qa/web-app/main.tf that can't be captured in a parameter
iamchrisf
But I need to layer things. Example: first thing I am working on is security groups. I need to pass the output to other stacks. I can’t use a variable in the output so I’m stuck right off the bat http://pastie.org/pastes/10118981/text
phinze
but why does the TF name of the resource need to be interpolated? it's all namespaced - just call it use "use1_service_sg"
then it's namespaced by module when you reference it - call the output just "id" and reference it by "${module.use1_service_sg_foo.id}"
iamchrisf
phinze: but the resource in aws needs to be “use1_stg_service”
unless I’m missing something
phinze
sure interpolate in the Name tag, but not the TF resource
the TF resource name has no bearing on the remote resource's name
iamchrisf
hrm… good point :0
phinze
if it's all in a module and you don't reference it from outside, heck, call it "sg"
failshell has quit
iamchrisf
gotcha. as long as I’m loading the proper remote state I’m all good.
phinze
yep
iamchrisf
damn. this might be doable. thx phinze
phinze
:D
iamchrisf
should I open an issue for that security group output discrepancy?