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

move GetProviderSchemaOptional check to correct block #33807

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Sep 5, 2023

A typo put the check for GetProviderSchemaOptional into the wrong if expression, and was missed partly because of the named return which we also remove here. We were also waiting for end-to-end tests with a new provider, but should have updated the mock tests to cover this logic.

A typo put the check for `GetProviderSchemaOptional` into the wrong `if`
expression, and was missed partly because of the named return which we
also remove here.
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

Given this configuration with 19 provider instances:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.14.0"
    }
  }
}

provider "aws" {
  alias  = "apnortheast1"
  region = "ap-northeast-1"
}

data "aws_arn" "apnortheast1" {
  provider = aws.apnortheast1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "apnortheast2"
  region = "ap-northeast-2"
}

data "aws_arn" "apnortheast2" {
  provider = aws.apnortheast2
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "apnortheast3"
  region = "ap-northeast-3"
}

data "aws_arn" "apnortheast3" {
  provider = aws.apnortheast3
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "apsouth1"
  region = "ap-south-1"
}

data "aws_arn" "apsouth1" {
  provider = aws.apsouth1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "apsoutheast1"
  region = "ap-southeast-1"
}

data "aws_arn" "apsoutheast1" {
  provider = aws.apsoutheast1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "apsoutheast2"
  region = "ap-southeast-2"
}

data "aws_arn" "apsoutheast2" {
  provider = aws.apsoutheast2
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "cacentral1"
  region = "ca-central-1"
}

data "aws_arn" "cacentral1" {
  provider = aws.cacentral1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "eucentral1"
  region = "eu-central-1"
}

data "aws_arn" "eucentral1" {
  provider = aws.eucentral1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "eunorth1"
  region = "eu-north-1"
}

data "aws_arn" "eunorth1" {
  provider = aws.eunorth1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "eusouth1"
  region = "eu-south-1"
}

data "aws_arn" "eusouth1" {
  provider = aws.eusouth1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "euwest1"
  region = "eu-west-1"
}

data "aws_arn" "euwest1" {
  provider = aws.euwest1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "euwest2"
  region = "eu-west-2"
}

data "aws_arn" "euwest2" {
  provider = aws.euwest2
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "euwest3"
  region = "eu-west-3"
}

data "aws_arn" "euwest3" {
  provider = aws.euwest3
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "mecentral1"
  region = "me-central-1"
}

data "aws_arn" "mecentral1" {
  provider = aws.mecentral1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "saeast1"
  region = "sa-east-1"
}

data "aws_arn" "saeast1" {
  provider = aws.saeast1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "useast1"
  region = "us-east-1"
}

data "aws_arn" "useast1" {
  provider = aws.useast1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "useast2"
  region = "us-east-2"
}

data "aws_arn" "useast2" {
  provider = aws.useast2
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "uswest1"
  region = "us-west-1"
}

data "aws_arn" "uswest1" {
  provider = aws.uswest1
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

provider "aws" {
  alias  = "uswest2"
  region = "us-west-2"
}

data "aws_arn" "uswest2" {
  provider = aws.uswest2
  arn      = "arn:aws:us-east-1:123456789012:iam:user/test"
}

And switching between production versions and development versions (this PR for terraform and a locally built hashicorp/aws provider with all the provider-side bits for GetProviderSchemaOptional enabled):

Terraform 1.5.6 and AWS Provider 5.14.0:

35.65 real       141.34 user       114.35 sys
1269710848  maximum resident set size

Terraform DEV and AWS Provider 5.14.0:

37.67 real       148.63 user       125.43 sys
1327726592  maximum resident set size

Terraform DEV and AWS Provider DEV:

37.96 real       116.76 user       185.14 sys
193249280  maximum resident set size

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@jbardin jbardin mentioned this pull request Sep 6, 2023
jbardin added a commit that referenced this pull request Sep 6, 2023
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants