looking to move application specific infra to thei...
# general
f
looking to move application specific infra to their respective repos but need to maintain environment separation in all cases
m
Even if you're not using k8s, it gives an example of a layered infrastructure with each layer represented as a stack
Can you go into more detail on what you mean by "environment separation"?
f
a lot of times, there are some differences between what gets deployed in staging vs prod just because of the nature of things (i.e. no staging kinesis streams at the moment)
is a stack per env the de-facto approach?
so
Pulumi.<env>.yaml
would contain flags, etc to say what to create?
and what if i wanted to deploy staging to a new AWS region - do I need to create a new stack?
i think i'm just going to have to play around with it for a while to see how things fit - thanks for the quick initial reply
m
np--sorry for falling off immediately afterwards.
given what you've described, it sounds like you do want a stack per environment
internally, we do this for our own infrastructure: our testing, staging, and prod environments each have their own stack
what is created and where is managed by the stack's configuration
👍 1
f
thanks! need to spend some time converting from TF and organizing
will let you guys know if i have more questions at that point
g
Depending on how much Terraform you're converting, https://github.com/pulumi/tf2pulumi can be really helpful - in case you weren't aware of it.
f
ya i did use that, but it's proving difficult as it doesn't support a lot of the variable syntaxes
so i've only been able to convert a small subset of code
g
So not supporting some terraform functions? Or something different from that?
f
like path variables
some of the null resources i could just delete
g
Gotcha.
f
i'm also getting panics every other time i run it if there's an error where the error is not actually printed
Copy code
whobbs:~/projects/infra-convert/staging/convert$ tf2pulumi > ~/projects/infra-pulumi-ts/staging-uw2.ts
2019/01/11 13:40:15 [TRACE] module source: "../../modules/api_gateway"
2019/01/11 13:40:15 [TRACE] module source: "../../modules/efs"
2019/01/11 13:40:15 [TRACE] module source: "../../modules/sqs"
2019/01/11 13:40:15 [TRACE] module source: "../../modules/s3-static-site"
2019/01/11 13:40:15 [TRACE] module source: "../../modules/s3-static-site"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1caed1f]
running it again shows the problem:
Copy code
importing Terraform project graphs: aws_iam_policy.site_deployer_policy.policy: could not find plugin terraform-template for provider template;
g
The
-allow-missing-plugins
flag will allow it to continue past that, if you wanted to try that.
@microscopic-florist-22719 any thoughts on the panic?
f
ok cool - it's really these ones that are a bit ambiguous:
Copy code
error: importing Terraform project graphs: aws_iam_user_policy.user-iam-policy.name: NYI: terraform variables
from that i can deduce what resource it's coming from but don't know which variable is causing the issue
somewhat minor usability issue
m
ah, it looks like you're using
terraform.
variables
not sure about the panic... @fancy-magazine-29876, do you have a more complete stack trace?
f
welp, can't do snippets in a slack thread i guess...
https://pastebin.com/ukTT1WyV @microscopic-florist-22719
m
Ah, I see what's happening here.
It looks like you have locals that refer to other locals
f
very likely
terraform forces a lot of hacks
m
this is definitely a bug in
tf2pulumi
. I'll write up an issue
👍 1