value = "Instances: ${aws_instance.web.id}" with count gives me Error running plan: Resource 'aws_instance.live-web' not found for variable 'aws_instance.live-web.id'
but using the splat as the example uses gives me
* output 'address': multi-variable must be in a slice
em-dash has quit
eproxus has quit
dq86 has quit
dq86 joined the channel
eropple joined the channel
eropple has quit
platonic joined the channel
andrewwatson joined the channel
andrewwatson joined the channel
kkvlk has quit
Alysum joined the channel
Alysum
Hello, what values can aws_network_acl resource take for protocol = ALL ? thanks
tphummel has quit
is anyone awake :)
Alysum has quit
moderation joined the channel
mosheroperandi has quit
nickc has quit
kkvlk joined the channel
kkvlk has quit
platonic joined the channel
svij_ joined the channel
ryanuber joined the channel
kkvlk joined the channel
ryanuber joined the channel
rmenn joined the channel
kkvlk has quit
closer has quit
ajw0100 joined the channel
closer joined the channel
ajw0100 has quit
ajw0100 joined the channel
RobertBirnie joined the channel
kkvlk joined the channel
kkvlk has quit
platonic joined the channel
em-dash joined the channel
ajw0100 has quit
ajw0100 joined the channel
RobertBirnie has quit
a_ro joined the channel
em-dash has quit
kkvlk joined the channel
kkvlk has quit
platonic joined the channel
zerokode joined the channel
zerokode
I just started diving into terraform but even now when i look at the frontpage there is something very profound that i can’t understand
it’s the why you write it “infrastructure as code” when all there is is configuration.
my first impression when i came to know terraform was that infrastructure is defined “with” code.
“Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.”
can’t undestand the relationship. anyway i know this is just a “minor detail” but I would appreciate if someone could enlighten me here
call it “high level configuration syntax”, call it “template-based syntax” or whatever. the “creation” of infrastructure doesn’t differ much from say ansible (im still noob here on terraform, no flames intended). it appears to be more powerful for describing infrastructure configuration, but in terms of “what language is used for defining” stuff it doesn’t differ much when i compare both.
platonic joined the channel
ryanuber
zerokode: terraform configs are a form of code, and there are quite a few powerful features in the interpolation syntax that allow the configuration to to reach far beyond simple static configuration files.
__number5__
zerokode: I would suggest you google devops or "infrastrucure as code" for some basic ideas of the devops concepts
zerokode
yes i think i know what you mean, but i wouldn’t call it “code”
it looks to me something that could be defined by a template language (elegancy put appart)
thanks __number5__
__number5__: pardon me my ignorance but, i see chef and puppet as “infrastructure as code” but i can’t see terraform as such
one simple example. i can’t say use a counter that is not 0-based
just to say that i cannot even use simple arithmetic calculations or whatever code to configure my infrastructure
because terraform is using its own configuration language, it will always be more limited than using a real programming language to configure infrastructure “as code"
of course the configuration language is tailored at simplifying “infrustracture configuration”, something that would be more compilcated with a programming language
but still, i don’t find it “as code” maybe im too stupid to nderstand the concept
[d__d] has quit
-- BotBot disconnected, possible missing messages --
configuration can be seen as "declarative language", and provided that it don't need interaction, it can be automated
even you build your tool all by code, e.g. python, you'll need to generate some configs at some point, e.g. for nginx/etc.
zerokode
rmenn: yeah i know this. seriously i dunt know how more powerful is this than a templating engine
you can achieve the exact same thing with a templating engine. call it interpolation or not
platonic has quit
templating is all about that
__number5__: yeah, i think the problem is i never heard “infrastructure as code” before terraform. cuz all i read now says
platonic joined the channel
it is basically about versioning infrastructure configuration as if it were code
testable, blabla
kkvlk joined the channel
i think i took the meaning of “code” too deeply. sorry
ok, all this apart, is there any resource you would recommend for examples on how to properly use terraform and how configuration is generally structured?
platonic has quit
kkvlk has quit
rmenn
try looking this repo, i think its well structured
does anyone know if .backup files should be under version control ?
__number5__
your version control supposed to be your backup, right?
zerokode
erm...
i guess so?
i mean there’s nothing mentioned about it anywhere
the fact that .tfstate needs to be commited is already something
now that a .tfstate.backup also needs to be commited
is an ever greater deal
i suppose it doesn’t need but i dunno that’s why i am asking
rmenn
the tfstate backup is only if your state file gets corrupted, i have seen scenarios where the resource is to be provisioned but fails and it also takes the state file along with it for a toss
kkvlk joined the channel
zerokode
rmenn: does that actually mean the backup file only makes sense during the lifetime of an apply operation?
or, in other words, that it shouldn’t need to be version controlled
rmenn
honestly i dont put it in version control
kkvlk has quit
rmenn joined the channel
kkvlk joined the channel
kkvlk has quit
zerokode
thanks. yeah i confirmed that too here on an internal repo definit it on .gitignore
rmenn: and od you know about tfvars? apparently it is defined in the .gitignore file i found here too
and i happen to have seen another git repo that actually has .tfvars commited
rmenn
i use tfvars to separate out environments, different tfvars for each environment
so when i need to chage something or bring another environment for testing i just change things in the tfvars
zerokode
oh. how do you define “i want to use this environment” or “i want to use this other environment"
how do you switch if they are in the same directory ?
i thought -var-file would be simpler to use
and explicit
rmenn
yes thats what i use
zerokode
i see. thanks!
rmenn
-var-file as per environment, <environment>.tfvars