https://pulumi.com logo
#google-cloud
Title
# google-cloud
b

bored-car-38257

04/27/2021, 3:23 PM
Hi All , Again question on
GKE
-
auto-pilot.
- i created a autopilot cluster manually - then imported it with
pulumi import
command - got the below suggested code .
Copy code
package main

import (
	"<http://github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/container|github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/container>"
	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := container.NewCluster(ctx, "name", &container.ClusterArgs{
			EnableAutopilot:           pulumi.Bool(true),
			EnableBinaryAuthorization: pulumi.Bool(false),
			EnableKubernetesAlpha:     pulumi.Bool(false),
			EnableL4IlbSubsetting:     pulumi.Bool(false),
			EnableLegacyAbac:          pulumi.Bool(false),
			EnableTpu:                 pulumi.Bool(false),
			Name:                      pulumi.String("cluster-name"),
			Network:                   pulumi.String("default"),
			VerticalPodAutoscaling: &container.ClusterVerticalPodAutoscalingArgs{
				Enabled: pulumi.Bool(true),
			},
		}, pulumi.Protect(true))
		if err != nil {
			return err
		}
		return nil
	})
}
But when i tried using the above code as sample to create another
auto-pilot
cluster . Got below error
Copy code
error: gcp:container/cluster:Cluster resource 'name' has a problem: ConflictsWith: "enable_binary_authorization": conflicts with enable_autopilot. Examine values at 'Cluster.EnableBinaryAuthorization'.
b

billowy-army-68599

04/27/2021, 3:31 PM
Hi Kannan, it seems if you're using autopilot, you can't enable binary authorization. It looks like this might be an import bug, but I think you can fix this by removing
EnableBinaryAuthorization: pulumi.Bool(false)
👍🏽 1
b

bored-car-38257

04/28/2021, 2:11 AM
@billowy-army-68599 - i suspected that did that too .. but still error persist .. am running through all
ConflictsWith:
in this code - github
b

billowy-army-68599

04/28/2021, 2:40 PM
did you get this resolved?
b

bored-car-38257

04/29/2021, 1:26 AM
no even removing the binary auth did not solve it .. same error when i had a bare minimum entry just name and project with
EnableAutopilot:           pulumi.Bool(true),
still got the error
3 Views