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

cloudflare_account_member resource does not properly support account_id provider deprecation #1819

Closed
2 tasks done
JDKnobloch opened this issue Aug 4, 2022 · 10 comments · Fixed by #1823
Closed
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug. likelihood/few Categorizes issue or PR as impacting a small portion of users. service/iam Categorizes issue or PR as related to the IAM service. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@JDKnobloch
Copy link

JDKnobloch commented Aug 4, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform: v1.2.6
Cloudflare provider: v3.20.0

Hey all - we have gone ahead and began migrating away from supplying the account_id variable within the provider and have noticed that the cloudflare_account_member resource does not properly work using the provided account_id variable on the resource level.

An issue tracker exists that marks the work as complete for this resource, however, the account_id variable does not appear to work. Example below includes the failed plan output.

Affected resource(s)

  • cloudflare_account_member

Terraform configuration files

resource "cloudflare_account_member" "example" {
  email_address = "[email protected]"
  account_id    = var.cloudflare_account_id

  role_ids = [
    "0123456",
  ]
  lifecycle {
    ignore_changes = [email_address]
  }
}

Debug output

cloudflare_account_member.example: Refreshing state... [id=0be7de180d632439373b8aedb0ba75f3]
2022-08-04T15:22:21.834-0600 [ERROR] vertex "cloudflare_account_member.example" error: required missing account ID
2022-08-04T15:22:21.834-0600 [ERROR] vertex "cloudflare_account_member.example" error: required missing account ID
2022-08-04T15:22:21.835-0600 [ERROR] vertex "cloudflare_account_member.example(expand)" error: required missing account ID
2022-08-04T15:22:21.835-0600 [ERROR] provider.terraform-provider-cloudflare_v3.20.0: Response contains error diagnostic: @module=sdk.proto diagnostic_summary="required missing account ID" tf_proto_version=5.3 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_account_member tf_rpc=ReadResource @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:56 diagnostic_detail= diagnostic_severity=ERROR tf_req_id=9ab96701-a515-4641-0ab4-199b3f56300f timestamp=2022-08-04T15:22:21.834-0600

Panic output

No response

Expected output

No changes - this resource already exists, we simply moved the account_id from provider to resource

Actual output

│ Error: required missing account ID

│ with cloudflare_account_member.example,
│ on user.tf line 4, in resource "cloudflare_account_member" "example":
│ 4: resource "cloudflare_account_member" "example" {

Steps to reproduce

Have not fully verified a from scratch cloudflare_account_member resource, our general steps were:

  1. Create cloudflare_account_member resource using provider-supplied account_id
  2. Once this is tf managed, remove provider-supplied account_id and use instead resource-supplied account_id

Additional factoids

No response

References

No response

@JDKnobloch JDKnobloch added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 4, 2022
@ralphluaces
Copy link

Also seeing this same behavior trying to move account_members to using account_id.

@jacobbednarz
Copy link
Member

thanks for raising this @JDKnobloch. looking through the history, it looks like the commit that actually made use for creation and deletion was dropped during a merge conflict. i've gone ahead and pulled it into #1823 so this should work now. feel free to pull that branch locally, build a custom version of the provider and give it a while to make sure it works for you too.

@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/iam Categorizes issue or PR as related to the IAM service. likelihood/few Categorizes issue or PR as impacting a small portion of users. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Aug 8, 2022
@github-actions github-actions bot added this to the v3.21.0 milestone Aug 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

This functionality has been released in v3.21.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@ChristophShyper
Copy link
Contributor

@jacobbednarz It's still happening with v3.21.0.

@ralphluaces
Copy link

This is not resolved, Also still happening for me on v3.21.0

@brettmiller
Copy link

Still having the issue as weill w/ terraform 1.2.7 and cloudflare/cloudflare v3.21.0

@davidcollom
Copy link

This is still the same with v4.10.0 - Setting the EnvVar CLOUDFLARE_ACCOUNT_ID allows you to get terraform to work, but ignores the value set with account_id

@GangGreenTemperTatum
Copy link

Hello, does anyone have a valid workaround for this at all? I tried the workaround listed here which does not seem to work for me:

│ Error: Unsupported argument
│ 
│   on provider.tf line 12, in provider "cloudflare":
│   12:   account_id = var.account_id
│ 
│ An argument named "account_id" is not expected here.
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v4.14.0
% tf providers

Providers required by configuration:
.
└── provider[registry.terraform.io/cloudflare/cloudflare] 4.14.0

Providers required by state:

    provider[registry.terraform.io/cloudflare/cloudflare]

@kieranjamesCOT
Copy link

Still getting the same issue on V4.21.0 of provider, 1.6.6 of terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. likelihood/few Categorizes issue or PR as impacting a small portion of users. service/iam Categorizes issue or PR as related to the IAM service. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
8 participants