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

Fix identity_type #1978

Merged
merged 3 commits into from
Jan 15, 2024
Merged

Fix identity_type #1978

merged 3 commits into from
Jan 15, 2024

Conversation

viliampucik
Copy link
Contributor

Google provider supports empty string for identity_type. Even if IDENTITY_TYPE_UNSPECIFIED is used as the value, Terraform state stores empty string as the value instead. Hence it make sense to support empty string as a value in the module.

Also ANY_USER_ACCOUNT is the correct value for ingress identity_type.


Checklist

I applicable, I acknowledge that I have:

  • Read the contributing guide
  • Ran terraform fmt on all modified files
  • Regenerated the relevant README.md files using tools/tfdoc.py
  • Made sure all relevant tests pass

Copy link

google-cla bot commented Jan 15, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…nd use correct value name for ingress 'identity_type'
@ludoo
Copy link
Collaborator

ludoo commented Jan 15, 2024

Can you provide a use case? We initially defaulted to empty and the effect was not what users intended, unless an actual value was passed. Unless behaviour changed, I don't think we should default to something that has no actual use.

@viliampucik
Copy link
Contributor Author

viliampucik commented Jan 15, 2024

@ludoo The issue is not with the default value. The issue is that when you use IDENTITY_TYPE_UNSPECIFIED value for identity_type in your Terraform code, then after terraform apply, Terraform state will store empty string for identity_type instead (that's the main issue). The new run of terraform plan/apply will show a difference between your Terraform code and state, so you will end up with infinite diff. It is better to allow and use empty string instead of IDENTITY_TYPE_UNSPECIFIED.

Copy link
Collaborator

@ludoo ludoo left a comment

Choose a reason for hiding this comment

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

modules/vpc-sc/variables.tf Outdated Show resolved Hide resolved
@ludoo ludoo enabled auto-merge (squash) January 15, 2024 20:26
@ludoo ludoo merged commit 19eb247 into GoogleCloudPlatform:master Jan 15, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants