You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Add create only plan modifier for non-updateable attributes in autogenerated resources (#3747)
* adjusting CreateOnlyAttributePlanModifier to support all attribute types
* handling parsing correct create only boolean
* adding refactor of transformation
* adding code generation of plan modifier
* update generated resources
* renaming plan modifier
* small renaming
* adjust renaming
* adjusting unit tests associated to model generation
* add plan modifier to latest changes
* adjust singleton resource unit test
* avoid plan modifier for any computed attributes to avoid blocking update operation
* clarifying why usage of single interface, renaming result var, clean up of unused code
// CreateOnly returns a plan modifier that ensures that update operations fails when the attribute is changed.
14
+
// This is useful for attributes only supported in create and not in update.
15
+
// It shows a helpful error message helping the user to update their config to match the state.
16
+
// Never use a schema.Default for create only attributes, instead use WithXXXDefault, the default will lead to plan changes that are not expected after import.
17
+
// Implement CopyFromPlan if the attribute is not in the API Response.
18
+
funcCreateOnly() CreateOnlyModifier {
17
19
return&createOnlyAttributePlanModifier{}
18
20
}
19
21
20
-
// CreateOnlyBoolPlanModifier creates a plan modifier that prevents updates to boolean attributes.
// CreateOnlyAttributePlanModifier returns a plan modifier that ensures that update operations fails when the attribute is changed.
61
-
// This is useful for attributes only supported in create and not in update.
62
-
// It shows a helpful error message helping the user to update their config to match the state.
63
-
// Never use a schema.Default for create only attributes, instead use WithXXXDefault, the default will lead to plan changes that are not expected after import.
64
-
// Implement CopyFromPlan if the attribute is not in the API Response.
return"Ensures the update operation fails when updating an attribute. If the read after import don't equal the configuration value it will also raise an error."
return"Ensures the update operation fails when updating an attribute. If the read after import don't equal the configuration value it will also raise an error."
MarkdownDescription: "Indicates whether to delete the resource being created if a timeout is reached when waiting for completion. When set to `true` and timeout occurs, it triggers the deletion and returns immediately without waiting for deletion to complete. When set to `false`, the timeout will not trigger resource deletion. If you suspect a transient error when the value is `true`, wait before retrying to allow resource deletion to finish. Default is `true`.",
MarkdownDescription: "Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/).",
MarkdownDescription: "Indicates whether to delete the resource being created if a timeout is reached when waiting for completion. When set to `true` and timeout occurs, it triggers the deletion and returns immediately without waiting for deletion to complete. When set to `false`, the timeout will not trigger resource deletion. If you suspect a transient error when the value is `true`, wait before retrying to allow resource deletion to finish. Default is `true`.",
MarkdownDescription: "Indicates whether to delete the resource being created if a timeout is reached when waiting for completion. When set to `true` and timeout occurs, it triggers the deletion and returns immediately without waiting for deletion to complete. When set to `false`, the timeout will not trigger resource deletion. If you suspect a transient error when the value is `true`, wait before retrying to allow resource deletion to finish. Default is `true`.",
MarkdownDescription: "Indicates whether to delete the resource being created if a timeout is reached when waiting for completion. When set to `true` and timeout occurs, it triggers the deletion and returns immediately without waiting for deletion to complete. When set to `false`, the timeout will not trigger resource deletion. If you suspect a transient error when the value is `true`, wait before retrying to allow resource deletion to finish. Default is `true`.",
0 commit comments