pulumi-aws-native icon indicating copy to clipboard operation
pulumi-aws-native copied to clipboard

ReplaceOnChanges not set for nested properties

Open t0yv0 opened this issue 1 year ago • 2 comments

What happened?

It looks like there is some existing code around markCreateOnlyProperty that is incomplete with respect to nested properties.

https://github.com/pulumi/pulumi-aws-native/blob/master/provider/pkg/schema/gen.go#L667

Example

Consider AWS::LookoutMetrics::AnomalyDetector example.

AWS CF schema specifies:

  "createOnlyProperties" : [ "/properties/AnomalyDetectorName", "/properties/MetricSource" ],

However this is not a top-level property. It's an object under definitions:

    "MetricSource" : {
      "type" : "object",
      "properties" : {
        "S3SourceConfig" : {
          "$ref" : "#/definitions/S3SourceConfig"
        },
        "RDSSourceConfig" : {
          "$ref" : "#/definitions/RDSSourceConfig"
        },
        "RedshiftSourceConfig" : {
          "$ref" : "#/definitions/RedshiftSourceConfig"
        },
        "CloudwatchConfig" : {
          "$ref" : "#/definitions/CloudwatchConfig"
        },
        "AppFlowConfig" : {
          "$ref" : "#/definitions/AppFlowConfig"
        }
      },
      "additionalProperties" : false
    },

Used as a nested declaration of another property:

    "MetricSet" : {
      "type" : "object",
      "properties" : {
        "MetricSource" : {
          "$ref" : "#/definitions/MetricSource"
        },

Currently make local_generate started failing catastrophically on encountering this. To workaround the problem, I will temporarily introduce a patch to ignore these failures, but we possibly need to revisit later on for completeness.

AFAIK replaceOnChanges property in the schema is of a documentation value at the moment and does not affect the actual behavior of the provider, but this may change.

Output of pulumi about

N/A

Additional context

N/A

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

t0yv0 avatar Sep 05 '24 19:09 t0yv0

Turns out I was mistaken, this is a warning and not a fatal error so it is simply a nice-to-have.

t0yv0 avatar Sep 05 '24 19:09 t0yv0

Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still experiencing this issue, could you leave a quick comment to let us know so we can prioritize it?

github-actions[bot] avatar Jul 25 '25 04:07 github-actions[bot]