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

Properties that are listed in both writeOnlyProperties and createOnlyProperties cause NotUpdatableException #2138

Open
ejnarvala opened this issue Dec 18, 2024 · 0 comments

Comments

@ejnarvala
Copy link

ejnarvala commented Dec 18, 2024

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
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Terraform CLI and Terraform AWS Cloud Control Provider Version

  • terraform: 1.4.6
  • awscc: 1.20.0

Affected Resource(s)

  • awscc_gamelift_fleet

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "awscc_gamelift_fleet" "sample" {
  name                   = "some name"
  apply_capacity         = "ON_CREATE_AND_UPDATE"
  build_id               = "some-id"
  certificate_configuration = {
    certificate_type = "GENERATED"
  }
  compute_type                   = "EC2"
  description                    = ""
  ec2_inbound_permissions = []
  ec2_instance_type                  = "c5.large"
  fleet_type                         = "ON_DEMAND"
  locations = [
    {
      location = "us-east-1"
      location_capacity = {
        desired_ec2_instances = 1
        min_size              = 1
        max_size              = 10
      }
    }
  ]
  metric_groups                      = ["default"]
  new_game_session_protection_policy = "FullProtection"
  runtime_configuration = {
    game_session_activation_timeout_seconds = 300
    max_concurrent_game_session_activations = 100
    server_processes = [
      {
        concurrent_executions = 1
        launch_path           = "/local/game/launch/path"
        parameters             = ""
      }
    ]
  }
}

Debug Output

https://gist.github.com/ejnarvala/e7470024d26692ca170ce1b6e83239a0

Expected Behavior

The update should not try to set ApplyCapacity

Actual Behavior

The tf apply fails with:

│ Calling Cloud Control API service UpdateResource operation returned:
│ operation error CloudControl: UpdateResource, https response error
│ StatusCode: 400, RequestID: <redacted>,
│ NotUpdatableException: Invalid patch update: createOnlyProperties
│ [/properties/ApplyCapacity] cannot be updated

Steps to Reproduce

  1. create resource with terraform apply
  2. make change to a mutable attribute, not including apply_capacity
  3. try applying changes

Important Factoids

This seems to be caused by this behavior from this change, which forces writeOnly properties to be added to the update request, but does not exclude properties that are writeOnly and createOnly.

this comment also mentions the same behavior - #1804 (comment)

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant