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

update to tf 0.13 #22

Merged
merged 8 commits into from
Nov 11, 2020
Merged

update to tf 0.13 #22

merged 8 commits into from
Nov 11, 2020

Conversation

mcalhoun
Copy link
Member

what

  • update module to support terraform 0.13
  • move from dep to gomod
  • update to current style context.tf

why

  • update outdated dependencies and constraints

@mcalhoun mcalhoun requested review from a team as code owners November 10, 2020 19:09
versions.tf Outdated Show resolved Hide resolved
versions.tf Outdated
@@ -1,5 +1,5 @@
terraform {
required_version = "~> 0.12.0"
required_version = ">= 0.12.0, < 0.14"

required_providers {
aws = "~> 2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aws = "~> 2.0"
aws = ">= 2.0"

use >= for all other providers as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Wouldn't this be risky if a breaking change comes along in provider v3 or v4 that makes our module stop working?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a risk, but the modules usually work ok with v3.
Otherwise, we'd have to modify all our hundreds of modules again and again for the next versions, which is way more work than to fix a module or a few if they are broken by the new provider version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

people should pin to a release, so even if the new release breaks something, the previous releases should work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily, I actually think that's the danger.

If the consumer is pinning to v1 of the module and the module allows a provider >= 2.0 and a new provider (say v3) is released, the consumer could get v3 of the provider, which could have backward-incompatible changes. The AWS v2 to AWS v3 is a perfect example as there are a bunch of breaking changes.

I'm fine following the convention here but just wanted to make sure I pointed out the risk and discussed the thought process.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we allow all versions, and we know about the risks.
It's still better than to update and test hundreds of modules for each new version of the providers

Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcalhoun LGTM, a few comments:

  1. Update examples/complete to context.tf similar to https://github.com/cloudposse/terraform-aws-datadog-integration/tree/master/examples/complete

  2. run these commands from the root of the repo

make init
make github/init
make readme
  1. Use the new provider syntax (the old one is deprecated and will throw errors in the next TF release
    https://github.com/cloudposse/terraform-aws-datadog-integration/blob/master/versions.tf#L4

@mcalhoun
Copy link
Member Author

Thanks for the review @aknysh I'll make those changes now!

@mcalhoun
Copy link
Member Author

/test all

@mcalhoun
Copy link
Member Author

/test all

@mcalhoun
Copy link
Member Author

/test all

Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in examples/complete/main.tf, this

module "sns" {
  source    = "../../"
  namespace = var.namespace
  name      = var.name
  stage     = var.stage
}

should be updated to this 

module "sns" {
source = "../../"

context = module.this.context
}


see https://github.com/cloudposse/terraform-aws-datadog-integration/blob/master/examples/complete/main.tf

osterman
osterman previously approved these changes Nov 10, 2020
@mcalhoun
Copy link
Member Author

/test all

@mcalhoun
Copy link
Member Author

in examples/complete/main.tf, this

module "sns" {
source = "../../"
namespace = var.namespace
name = var.name
stage = var.stage
}

should be updated to this

module "sns" {
source = "../../"

context = module.this.context
}

be2cdc4

context.tf Outdated
#

module "this" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.20.0"

@mcalhoun
Copy link
Member Author

/test all

@Nuru Nuru merged commit 057e5d0 into master Nov 11, 2020
@Nuru Nuru deleted the chore/upgrade-to-terraform-v0.13 branch November 11, 2020 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants