Skip to content

Commit e66ce37

Browse files
Fix eks cluster PRC replace (#4415)
The eks:Cluster resource has received a new parameter with ForceNew and a default. When upgrading from an old version before the parameter was added this triggers a replace. This PR adds a workaround for that - when the state is read the `bootstrapSelfManagedAddons` parameter is added with its default value if not present. covered by `TestEKSClusterUpgrade` partially fixes #4410 stacked on #4403
1 parent 8530507 commit e66ce37

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

provider/resources.go

+12
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,18 @@ compatibility shim in favor of the new "name" field.`)
21922192
"node_group_name": tfbridge.AutoName("nodeGroupName", 255, "-"),
21932193
},
21942194
},
2195+
"aws_eks_cluster": {
2196+
TransformFromState: func(_ context.Context, pm resource.PropertyMap) (resource.PropertyMap, error) {
2197+
// if the defaultOutboundAccessEnabled property is not set, set it to the default value of true
2198+
// this prevents an unnecessary replacement when upgrading the provider
2199+
// There is a TF migration which should handle this but due to [pulumi/pulumi-terraform-bridge#1667]
2200+
// it does not work as expected.
2201+
if _, ok := pm["bootstrapSelfManagedAddons"]; !ok {
2202+
pm["bootstrapSelfManagedAddons"] = resource.NewBoolProperty(true)
2203+
}
2204+
return pm, nil
2205+
},
2206+
},
21952207
"aws_eks_fargate_profile": {
21962208
Tok: awsResource(eksMod, "FargateProfile"),
21972209
Fields: map[string]*tfbridge.SchemaInfo{

0 commit comments

Comments
 (0)