#terraform-0_12

terraform-0_12

Archived
0695

Discuss upgrading to terraform 0.12

Archive: https://archive.sweetops.com/terraform-0_12/

erik
erikover 6 years ago
archived the channel
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
Alright, gonna archive this channel to reduce confusion. When 0.13 is eminent and if it comes with tons of breaking changes like 0.12 (hoping not!) we'll create a new one.
Joe Presley
Joe Presleyover 6 years ago
My magic Google 8-ball comes up empty.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
any eta's on when 0.13 is actual?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
though I think better to start a clean channel with no history for 0.13
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
haha, ya maybe that's the right thing to do
Joe Presley
Joe Presleyover 6 years ago
Can you rename it for v0.13 release? 😉
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
Maybe it's time we archive this channel as terraform 0.12 is more or less the norm now?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
Hrm....
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
Adding @U010XGY9B46 bot
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
@Brandon Wilson wouldn't something like this work?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago(edited)
locals {
  default_branch_mapping = var.service
  branch_mapping = {
    "foobar" = var.service + "-" + var.branch
    "compliance" = var.service + "-" + var.branch
  } 

  my_name = lookup(local.branch_mapping, var.branch, local.default_branch_mapping)
}
Brandon Wilson
Brandon Wilsonover 6 years ago
I think I’ll do that. Thanks @loren 🙂
loren
lorenover 6 years ago(edited)
absolutely, yes, can keep the list in a separate local/var
Brandon Wilson
Brandon Wilsonover 6 years ago
yeah you’ve got the idea
loren
lorenover 6 years ago
not sure i wholly got your branching right, but something like that
Brandon Wilson
Brandon Wilsonover 6 years ago
I could probably clean it up even more keep the list outside of that yeah?
loren
lorenover 6 years ago
contains(["master", "staging", "compliance"], var.branch) ? var.service : "${var.service}-${var.branch}"
Brandon Wilson
Brandon Wilsonover 6 years ago
yeah this would work
Brandon Wilson
Brandon Wilsonover 6 years ago
determines whether a given list or set contains a given single value as one of its elements.
Brandon Wilson
Brandon Wilsonover 6 years ago
Oh I see that now
Brandon Wilson
Brandon Wilsonover 6 years ago
so it would be an exact match?
loren
lorenover 6 years ago
it matchs a value against a list of values and returns true/false
Brandon Wilson
Brandon Wilsonover 6 years ago
well, I hesitate to use contains in case the word in somewhere in the else name
loren
lorenover 6 years ago
contains()?
Brandon Wilson
Brandon Wilsonover 6 years ago
something like var.branch == "master||staging||compliance" ? "${var.service}" ?
Brandon Wilson
Brandon Wilsonover 6 years ago
Anyone know if there’s a cleaner way to do this var.branch == "master" ? "${var.service}" : (var.branch == "staging" ? "${var.service}" : (var.branch == "compliance" ? "${var.service}" : "${var.service}-${var.branch}"))
Matthew King
Matthew Kingover 6 years ago
Error: Creating/Updating CloudWatch Log Metric Filter failed: ResourceNotFoundException: The specified log group does not exist.

  on alarms.tf line 76, in resource "aws_cloudwatch_log_metric_filter" "default":
  76: resource "aws_cloudwatch_log_metric_filter" "default" {
Matthew King
Matthew Kingover 6 years ago
I’m trying to implement the aws cloudtrail cloudwatch alarms terraform and when I run it, I receive the following error
btai
btaiover 6 years ago
anyone getting this when deprovisioning an eks cluster:
Error: Cycle: module.eks_cluster.output.endpoint, kubernetes_cluster_role_binding.auditboard_admin_cluster_admin (destroy), kubernetes_service_account.auditboard_admin (destroy), module.eks_cluster.aws_eks_cluster.default (destroy), module.eks_cluster.local.certificate_authority_data_list, module.eks_cluster.local.certificate_authority_data_list_internal, module.eks_cluster.local.certificate_authority_data_map, module.eks_cluster.local.certificate_authority_data, module.eks_cluster.output.certificate_authority_data, provider.kubernetes, kubernetes_config_map.aws_auth (destroy)
Matthew King
Matthew Kingover 6 years ago
I’m looking at combining three different things, one enabling cloud-watch cloud-trail, two creating the aws_kms_key, and three pushing those notifications to slack. Best way would be to just combine them all into seperate modules correct?
joshmyers
joshmyersover 6 years ago
2 lists and zipmap together I guess is another option
joshmyers
joshmyersover 6 years ago
Aye, figured so, thanks!
loren
lorenover 6 years ago
I think you would need to maintain order in a list of key values
joshmyers
joshmyersover 6 years ago
map("year", "string", "month", "string", "day", "string", "hour", "string")
{
  "day" = "string"
  "hour" = "string"
  "month" = "string"
  "year" = "string"
}
joshmyers
joshmyersover 6 years ago
Any ways to keep the ordering of a map?
Matthew King
Matthew Kingover 6 years ago
Can I ask a dumb question? if I have existing terraform code, is there an easy way to convert it to a module so it can be used over and over again?
curious deviant
curious deviantover 6 years ago
Hello,
I have a multi-account setup wherein my domain (myexampledomain.com)is registered in ACCOUNT A and I need to create a subdomain in ACCOUNT B (I have created a HZ for (myexampledomain.com) . and need to add a subdomain say (sub.myexampledomain.com). I am using DNS Validation for AWS cert and figured that DNS validation needs to add an entry in ACCOUNT A. I setup a cross account role in ACCOUNT A and corresponding permissions in ACCOUNTB. However the terraform (0.12) is unable to assume role. I can atleast assume role via aws cli. What am I missing ?
joshmyers
joshmyersover 6 years ago
PePe Amengual
PePe Amengualover 6 years ago
Hi, I’m using this module output : https://github.com/cloudposse/terraform-aws-rds-cluster/blob/master/outputs.tf#L52 to feed into aother cluster SG for replication
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
@UUB28NLDS help keep tabs! 😉
Julio Tain Sueiras
Julio Tain Sueirasover 6 years ago
terraform-lsp
Joe Presley
Joe Presleyover 6 years ago
That’s really cool. What plugin(s) were you using?
Julio Tain Sueiras
Julio Tain Sueirasover 6 years ago
Julio Tain Sueiras
Julio Tain Sueirasover 6 years ago
got this implemented 😃
Gabe
Gabealmost 7 years ago
also using terraform 0.12.18 which is the newest
Gabe
Gabealmost 7 years ago
Does anyone know if it’s possible to use for_each or dynamic values for a provider block? If not, do you have a way to make the same resource across many accounts?
curious deviant
curious deviantalmost 7 years ago
sure..thank you 🙂
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 7 years ago
Kubectl describe pod xxxxxx
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 7 years ago
kubectl cluster-info dump