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

[Bug]: Kinesis analytics v2 application recreates after change of runtime_envrionment && ConcurrentModificationException #37529

Closed
Sagoito opened this issue May 15, 2024 · 4 comments
Labels
bug Addresses a defect in current functionality. service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service.

Comments

@Sagoito
Copy link
Contributor

Sagoito commented May 15, 2024

Terraform Core Version

1.6.6

AWS Provider Version

5.48.0

Affected Resource(s)

  • aws_kinesisanalyticsv2_application

Expected Behavior

After the kinesis configuration runtime_environment is changed it should trigger an update for the existing kinesis application.

Actual Behavior

Terraform deletes the kinesisanalitycsv2 application and creates a new one with the same name, which resolves in ConcurrentModificationException.

Relevant Error/Panic Output Snippet

Error: creating Kinesis Analytics v2 Application (app_name): ConcurrentModificationException: Tags are already registered for this resource ARN: arn:aws:kinesisanalytics:region:accountid:application/app_name, please retry later. Or you can create without tags and then add tags using TagResource API after successful resource creation.
with aws_kinesisanalyticsv2_application.app,
on kinesisV2.tf line 14, in resource "aws_kinesisanalyticsv2_application" "app":
14: resource "aws_kinesisanalyticsv2_application" "app" {

Terraform Configuration Files

provider "aws" {
  region  = "us-east-1"
  default_tags {
    tags = {
      TestTag = "test-tag"
    }
  }
}

resource "aws_kinesisanalyticsv2_application" "app" {
  name                   = "app_name"
  service_execution_role = aws_iam_role.kinesis_application.arn

  start_application   = true
  runtime_environment = "FLINK-1_15"

  application_configuration {
    run_configuration {
      flink_run_configuration {
        allow_non_restored_state = true
      }
    }
    application_code_configuration {
      code_content {
        s3_content_location {
          bucket_arn = aws_s3_bucket.kinesis_application_bucket.arn
          file_key   = aws_s3_object.kinesis_application_jar.key
        }
      }
      code_content_type = "ZIPFILE"
    }
    application_snapshot_configuration {
      snapshots_enabled = true
    }

    flink_application_configuration {
      parallelism_configuration {
        auto_scaling_enabled = true
        configuration_type   = "CUSTOM"
        parallelism          = 1
        parallelism_per_kpu  = 1
      }
    }
  }
}

Steps to Reproduce

Create a terraform stack on aws with the kinesis analytics v2 application using runtime_environment = "FLINK-1_15".
Modify the Terraform file and change the version of runtime_environment to runtime_environment = "FLINK-1_18".
Run the plan and apply again.

Debug Output

No response

Panic Output

No response

Important Factoids

The issue with ConcurrentModificationException is described in #31239, but the expected behavior is incorrect as it states that "Terraform should delete the existing AWS Kinesis Analytics application and create a new application with the new runtime environment."
In case of changing runtime_environment the update of the application should be performed instead of recreating application. In aws-sdk-go-v2 application runtime environment update can be performed via func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error)

References

No response

Would you like to implement a fix?

None

@Sagoito Sagoito added the bug Addresses a defect in current functionality. label May 15, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service. label May 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
@justinretzolk
Copy link
Member

Hey @Sagoito 👋 Thank you for taking the time to raise this! In this case, I'm going to mark this as a duplicate of #31239 and close this in favor of continuing the conversation there. My reasoning being that the kinesisanalyticsv2 service has not yet been migrated to AWS Go SDKv2 (see #36176), and so the update behavior that you mentioned is not yet expected.

@justinretzolk
Copy link
Member

Duplicate of #31239

@justinretzolk justinretzolk marked this as a duplicate of #31239 May 24, 2024
Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@terraform-aws-provider terraform-aws-provider bot removed the needs-triage Waiting for first response or review from a maintainer. label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/kinesisanalyticsv2 Issues and PRs that pertain to the kinesisanalyticsv2 service.
Projects
None yet
Development

No branches or pull requests

2 participants