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

v2.21.0 is incompatible with Terraform 0.12.26+ #294

Closed
dzoeteman opened this issue Feb 26, 2021 · 4 comments
Closed

v2.21.0 is incompatible with Terraform 0.12.26+ #294

dzoeteman opened this issue Feb 26, 2021 · 4 comments

Comments

@dzoeteman
Copy link

#289 was released, which includes a change to the versions.tf file with added source/version to the provider and updated the TF required version to 0.12.26+.
However, this is not actually compatible with 0.12+, as noted by this warning now in our Terraform pipelines (TF 0.12.30):

Warning: Provider source not supported in Terraform v0.12
  on .terraform/modules/<module name>/versions.tf line 5, in terraform:
   5:     aws = {
   6:       source  = "hashicorp/aws"
   7:       version = ">= 2.49"
   8:     }
@cspital
Copy link

cspital commented Feb 26, 2021

0.12.24 has this issue as well

@rob-unearth
Copy link

0.12.17 as well

@bryantbiggs
Copy link
Member

hi all - this is only a warning so it does not break functionality (and conversely - there is a similar warning when the previous version format is used for the newer terraform versions 0.13 and 0.14). if you look closely, its just the source field that is not supported and therefore terraform does not respect it in 0.12, but the correct provider version is pulled.

we are planning to move forward with a version upgrade soon (0.13.x) since 0.15 is just around the corner and there are a number of improvements we'd like to utilize in the later versions. for now, 0.12.26 still works and hence why no bump to 3.x of the module, but there will be this warning.

I tested this locally using 0.12.26 (which this module supports) and even changed the version to not use >= to show that its pulling the correct provider version:

TF init:

Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "aws" (hashicorp/aws) 2.49.0...


Warning: Provider source not supported in Terraform v0.12

  on versions.tf line 5, in terraform:
   5:     aws = {
   6:       source  = "hashicorp/aws"
   7:       version = ">= 2.49"
   8:     }

A source was declared for provider aws. Terraform v0.12 does not support the
provider source attribute. It will be ignored.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

TF plan:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_vpc.default: Refreshing state...
module.db.module.db_instance.data.aws_iam_policy_document.enhanced_monitoring: Refreshing state...
data.aws_subnet_ids.all: Refreshing state...
data.aws_security_group.default: Refreshing state...

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.db.module.db_instance.aws_db_instance.this[0] will be created
  + resource "aws_db_instance" "this" {
      + address                               = (known after apply)
      + allocated_storage                     = 5
      + allow_major_version_upgrade           = false
      + apply_immediately                     = false
      + arn                                   = (known after apply)
      + auto_minor_version_upgrade            = true
      + availability_zone                     = (known after apply)
      + backup_retention_period               = 0
      + backup_window                         = "03:00-06:00"
      + ca_cert_identifier                    = "rds-ca-2019"
      + character_set_name                    = (known after apply)
      + copy_tags_to_snapshot                 = false
      + db_subnet_group_name                  = (known after apply)
      + delete_automated_backups              = true
      + deletion_protection                   = false
      + enabled_cloudwatch_logs_exports       = [
          + "postgresql",
          + "upgrade",
        ]
      + endpoint                              = (known after apply)
      + engine                                = "postgres"
      + engine_version                        = "9.6.9"
      + final_snapshot_identifier             = "demodb"
      + hosted_zone_id                        = (known after apply)
      + iam_database_authentication_enabled   = false
      + id                                    = (known after apply)
      + identifier                            = "demodb-postgres"
      + identifier_prefix                     = (known after apply)
      + instance_class                        = "db.t2.large"
      + iops                                  = 0
      + kms_key_id                            = (known after apply)
      + license_model                         = (known after apply)
      + maintenance_window                    = "mon:00:00-mon:03:00"
      + max_allocated_storage                 = 0
      + monitoring_interval                   = 0
      + monitoring_role_arn                   = (known after apply)
      + multi_az                              = false
      + name                                  = "demodb"
      + option_group_name                     = (known after apply)
      + parameter_group_name                  = (known after apply)
      + password                              = (sensitive value)
      + performance_insights_enabled          = false
      + performance_insights_kms_key_id       = (known after apply)
      + performance_insights_retention_period = (known after apply)
      + port                                  = 5432
      + publicly_accessible                   = false
      + replicas                              = (known after apply)
      + resource_id                           = (known after apply)
      + skip_final_snapshot                   = true
      + status                                = (known after apply)
      + storage_encrypted                     = false
      + storage_type                          = "gp2"
      + tags                                  = {
          + "Environment" = "dev"
          + "Name"        = "demodb-postgres"
          + "Owner"       = "user"
        }
      + timezone                              = (known after apply)
      + username                              = "demouser"
      + vpc_security_group_ids                = [
          + "sg-c399f6a7",
        ]

      + timeouts {
          + create = "40m"
          + delete = "40m"
          + update = "80m"
        }
    }

  # module.db.module.db_option_group.aws_db_option_group.this[0] will be created
  + resource "aws_db_option_group" "this" {
      + arn                      = (known after apply)
      + engine_name              = "postgres"
      + id                       = (known after apply)
      + major_engine_version     = "9.6"
      + name                     = (known after apply)
      + name_prefix              = "demodb-postgres-"
      + option_group_description = "Option group for demodb-postgres"
      + tags                     = {
          + "Environment" = "dev"
          + "Name"        = "demodb-postgres"
          + "Owner"       = "user"
        }

      + timeouts {
          + delete = "15m"
        }
    }

  # module.db.module.db_parameter_group.aws_db_parameter_group.this[0] will be created
  + resource "aws_db_parameter_group" "this" {
      + arn         = (known after apply)
      + description = "Database parameter group for demodb-postgres"
      + family      = "postgres9.6"
      + id          = (known after apply)
      + name        = (known after apply)
      + name_prefix = "demodb-postgres-"
      + tags        = {
          + "Environment" = "dev"
          + "Name"        = "demodb-postgres"
          + "Owner"       = "user"
        }
    }

  # module.db.module.db_subnet_group.aws_db_subnet_group.this[0] will be created
  + resource "aws_db_subnet_group" "this" {
      + arn         = (known after apply)
      + description = "Database subnet group for demodb-postgres"
      + id          = (known after apply)
      + name        = (known after apply)
      + name_prefix = "demodb-postgres-"
      + subnet_ids  = [
          + "subnet-0e95ab57",
          + "subnet-a631c0c2",
        ]
      + tags        = {
          + "Environment" = "dev"
          + "Name"        = "demodb-postgres"
          + "Owner"       = "user"
        }
    }

Plan: 4 to add, 0 to change, 0 to destroy.

Warning: Provider source not supported in Terraform v0.12

  on versions.tf line 5, in terraform:
   5:     aws = {
   6:       source  = "hashicorp/aws"
   7:       version = "2.49"
   8:     }

A source was declared for provider aws. Terraform v0.12 does not support the
provider source attribute. It will be ignored.

(and 5 more similar warnings elsewhere)


------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
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