Skip to content

IAM: Changing application of an API key is allowed in TF but have no effect #2021

@boomaker

Description

@boomaker

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.5.0 (same with older versions)

Affected Resource(s)

  • scaleway_iam_api_key

Terraform Configuration Files

# Create IAM application for global S3 access:
resource "scaleway_iam_application" "app" {
  name = "My App"
}

# Create API key to access bucket:
resource "scaleway_iam_api_key" "s3" {
  application_id = scaleway_iam_application.app.id
  description    = "Access to S3 buckets"
}

Debug Output

If for whatever reason I need to change the application_id of the API Key:

Plan:

  # scaleway_iam_api_key.s3 will be updated in-place
  ~ resource "scaleway_iam_api_key" "s3" {
      ~ application_id     = "********" -> "***************"
        id                 = "SCW***************"
        # (8 unchanged attributes hidden)
    }

Apply:

scaleway_iam_api_key.s3: Modifying... [id=SCW*******]
scaleway_iam_api_key.s3: Modifications complete after 1s [id=SCW********]

Expected Behavior

application_id of the API key is effectively changed server-side and API key is now affected to the new application.

Actual Behavior

API key is still linked to the old application_id, and the next terraform plan will trigger again the change request.

Important Factoids

PLEASE allow changing the application_id with an in-place update and NOT with a delete/recreate that would break the applications using the API key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions