Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform v0.13.0 beta program #25016

Closed
danieldreier opened this issue May 21, 2020 · 8 comments
Closed

Terraform v0.13.0 beta program #25016

danieldreier opened this issue May 21, 2020 · 8 comments

Comments

@danieldreier
Copy link
Contributor

danieldreier commented May 21, 2020

We just launched Terraform 0.13.0 beta 3! We need your help, and want to hear from you. You can download beta 2 on releases.hashicorp.com.

Updated Release Schedule
We found (and fixed) two issues late in the beta 3 cycle, so have postponed RC1 and the GA dates to give people a chance to test RC1 in pre-production environments. Updated release dates below:

RC1 is scheduled to ship Wednesday, July 15
GA is scheduled to ship Wednesday, July 29
RC1 shipped Wednesday, July 22
GA is scheduled to ship Monday, August 10

If we find serious bugs during beta 3 or RC1 that we can't fix in time, or we have such a high rate of bugs reported that we're concerned about additional undiscovered bugs, we may do another beta or RC release as necessary and postpone the GA release by another two weeks.

What's Changing
The headline features we're especially excited about are:

  • provider source: allow automatic installation of providers outside the hashicorp namespace. The blog post describes this improvement in more detail
  • module expansion: modules now support count, for_each, and depends_on. depends_on currently has a known limitation around data sources.

There are a bunch of other great improvements listed in the CHANGELOG, as well as breaking changes you should be aware of.

How to get started

  1. Download and install the appropriate binary from releases.hashicorp.com
  2. Read the draft upgrade guide
  3. run terraform 0.13upgrade
  4. Give feedback!

Documentation
Our documentation web site cannot serve documentation for multiple versions of Terraform at the same time, so we are ad-hoc linking to 0.13 specific documentation here to support the beta. When 0.13 GA is released, we will publish these to the official web site.

Provider source

Module Expansion

Warnings & Known Issues
Please note that this is a beta, and will contain bugs. You probably shouldn't use this with production infrastructure, and if you do, it will upgrade your state file and you won't be able to use it with 0.12 anymore.

We are tracking known issues via GitHub. You can see:

How to give Feedback
Please use the thread I created on the community discussion forum for most discussion, and report bugs via GitHub and link to this issue.

The goal of this beta is to get community input, especially on bugs and edge cases that we didn't catch in our testing. We test extensively, but Terraform is used in such a wide range of use cases that some of them won't be caught by testing.

We're also very interested in people's use cases, experiences getting started and upgrading, what was surprising, examples of cool cases we might put in the docs or blog posts, and so on - please send those to ddreier@hashicorp.com (me, Terraform OSS Engineering Manager) and petros@hashicorp.com (Petros Kolyvas, Terraform OSS Product Manager). Interesting example use cases around the new module expansions are especially interesting here, and we would really like to incorporate community feedback into the documentation and future versions of the upgrade guide.

If you're interested and want a reminder when the beta is released, watch this issue. We'll be posting announcements here. Locking the issue seems to prevents people from watching it, I'm hoping to keep it unlocked. Please use the discussion post for avoid excess noise on here!

@hashicorp hashicorp locked and limited conversation to collaborators May 21, 2020
@danieldreier danieldreier pinned this issue May 21, 2020
@hashicorp hashicorp unlocked this conversation May 30, 2020
@dotenorio
Copy link

dotenorio commented Jun 3, 2020

Hello, we are testing the new depends_on feature for modules, however, we are having problems ... Maybe it does not do what we expect, or it may not be working.

Our case is as follows:

We have a VPC modules and we have a Transit Gateway Attachment module. What happens is that we want to use the output vpc_id, from the VPC module as a variable for the Transit Gateway Attachment module and we have the following error:

Error: Invalid for_each argument

 on .terraform / modules / transit_gateway / main.tf line 89, in resource "aws_ec2_transit_gateway_route_table_association" "inter":
  89: for_each = local.vpc_attachments_without_default_route_table_association

The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.

Line 89 refers to this section:

resource "aws_ec2_transit_gateway_route_table_association" "this" {
  for_each = local.vpc_attachments_without_default_route_table_association
}

And the local variable is this:

locals {
  vpc_attachments_without_default_route_table_association = {
    for k, v in var.vpc_attachments: k => v if lookup (v, "transit_gateway_default_route_table_association", true)! = true
  }

Here is a simplified version of our terraform file:

"vpc" module {
  source = "terraform-aws-modules / vpc / aws"
  name = var.name
  cidr = var.cidr
  azs = var.azs
  private_subnets = var.private_subnets
  public_subnets = var.public_subnets
}
module "transit_gateway" {
  source = "terraform-aws-modules / transit-gateway / aws"
  depends_on = ["module.vpc.vpc_id"]
  vpc_attachments = {
    vpc1 = {
      vpc_id = module.vpc.vpc_id *
      subnet_ids = module.vpc.public_subnets_id
      tgw_id = var.tgw_id
      dns_support = var.dns_support
      ipv6_support = var.ipv6_support
    }
  }
}

* If we put the vpc_id hard coded, the Transit Gateway Atachment module works correctly.

What are we doing wrong, or, how can we make the Transit Gateway Atachment module actually depend on the VPC module being created?

@antonbabenko
Copy link
Contributor

Try replacing depends_on = ["module.vpc.vpc_id"] with depends_on = [module.vpc].

I wrote the Transit Gateway module, you are using but I have been busy last couple hours and didn't try Terraform 0.13 yet, so my proposal may not work.

@danieldreier
Copy link
Contributor Author

@dotenorio @antonbabenko I am thrilled that you're trying out the beta, but this particular GitHub issue is just for announcements. The best place to have discussions about this is on the community discussion forum, or file an issue in this repository if you're fairly confident it's a bug. If people keep posting here, it'll get unmanageable quick because everyone will get updates they aren't interested in. The Terraform community is just too big to have all discussions in one GitHub issue.

If discussion continues in here I will have to lock the thread, to ensure that discussions happen in the right places. I've been reluctant to do that because when it's locked, it seems like people can't add themselves as participants.

@digitalfiz
Copy link

digitalfiz commented Jun 4, 2020

I am trying to use count on modules in a very interesting way and it seems to not like what I am doing.

I was hoping to get some recursive functionality out of this by using counts to control a module calling itself to provide some nested goodness. What I found is that if a module includes it self with a count of even 0 it will infinitely include itself until the file name is too long and then die.

Here is an example:
Imgur

Here is the code I used:

Here is the module:

variable "parent" {
    type = string
}

variable "part" {
  type = string
}

variable "sub_parts" {
  type = list(any)
}


locals {
    this_part = ["${var.parent}/${var.part}"]
}


module "subs" {
    source    = "./"
    count     = length(var.sub_parts)
    parent    = local.this_part
    part      = var.sub_parts[count.index]["part"]
    sub_parts = var.sub_parts[count.index]["sub_parts"]
}


output "paths" {
    value = concat(local.this_part, module.subs.*.paths)
    type = list(string)
}

Here is the code to invoke it:

locals {
    paths = [
        {
            part      = "foo"
            sub_parts = [
                {
                    part      = "Bar"
                    sub_parts = []
                },
                {
                    part      = "Bar 2"
                    sub_parts = []
                },
                {
                    part      = "Bar 3"
                    sub_parts = [
                        {
                            part = "Baz"
                        }
                    ]
                },
                {
                    part      = "Bar 4"
                    sub_parts = []
                }
            ]
        },
        {
            part      = "foo 2"
            sub_parts = []
        },
        {
            part      = "foo 3"
            sub_parts = []
        },
        {
            part      = "foo 4"
            sub_parts = [
                {
                    part      = "Bar 2"
                    sub_parts = []
                }
            ]
        }
    ]
}

module "subs" {
    source    = "./pather"
    count     = local.paths
    parent    = "/"
    part      = local.paths[count.index]["part"]
    sub_parts = local.paths[count.index]["sub_parts"]
}

output "paths" {
    value = flatten(module.subs.*.paths)
}

What I expected to get was an output of paths that is a list of all the paths it made from the local variable.

The use-case for this is obviously not to just create some list for an output (although could be useful maybe?) but we use API gateway a lot and I was hoping to be able to somewhat build out a list of paths and methods we want to use complete with other data api gateway needs and have 1 module to set it all up. This is the only way I can think of to accomplish this type of behavior since loops in terraform are not blocks that can simply just be wrapped around other things.

After getting that error and realize why it is probably happen I am not sure if what I want to do will be possible. I understand that terraform needs to download all the modules it thinks its going to need before it starts doing anything so if that local.paths has anything that gets generated after init it wont work at least currently the way things work where even if a module is the same module it gets duplicated to however many times its called.

Maybe if terraform detects a module is calling itself it could behave slightly differently?

@danieldreier
Copy link
Contributor Author

danieldreier commented Jun 4, 2020

I'm going to lock this thread because of continuing discussion. I want to be clear that we really, really want feedback, want input, and want to hear you experiences trying the beta. That's the whole point of running a beta. This just cannot be the forum, because having hundreds of people talk about multiple issues in one GitHub thread will make it impossible to discuss any of them productively.

If you see an outright bug, please report it via GitHub and link to this issue.

For general discussion, please use the community forum, and include "0.13" in the subject so it's clear it's about the beta.

For people who have already commented on here, please file new issues or move to the community forum. I'm going to remove those comments in the next few days, but wanted to leave the text up so you'd have the opportunity to re-post elsewhere.

@hashicorp hashicorp locked as off-topic and limited conversation to collaborators Jun 4, 2020
@jeffwecan jeffwecan unpinned this issue Jun 17, 2020
@danieldreier danieldreier pinned this issue Jun 17, 2020
@danieldreier
Copy link
Contributor Author

Terraform 0.13.0 beta 2 is now available at https://releases.hashicorp.com/terraform/0.13.0-beta2/. Please give it a try and let us know how it works for you!

@danieldreier
Copy link
Contributor Author

Terraform 0.13.0 RC 1 is now available at https://releases.hashicorp.com/terraform/0.13.0-rc1/. Unless significant bugs are discovered, this will be the last pre-release prior to GA. If you've been holding off on testing, or you tested beta 1 and haven't touched it again, this is the opportunity to test and understand what impact GA will have on your infrastructure. In most cases, I'm expecting this to be a very straightforward update. Where it's not, we would love feedback on the upgrade guide to help explain possible upgrade issues.

@danieldreier
Copy link
Contributor Author

0.13.0 has shipped into GA! Thank you so much to everyone who participated in the beta and RC program and gave feedback. Please try 0.13 and let us know how it goes!

@danieldreier danieldreier unpinned this issue Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants