// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).

package main

import (
	"context"
	"fmt"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/containerengine"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleCreateCluster() {
	// Create a default authentication provider that uses the DEFAULT
	// profile in the configuration file.
	// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
	client, err := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := containerengine.CreateClusterRequest{OpcRequestId: common.String("PUCVKMAYU1ULLAA0RMZX<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		CreateClusterDetails: containerengine.CreateClusterDetails{Options: &containerengine.ClusterCreateOptions{KubernetesNetworkConfig: &containerengine.KubernetesNetworkConfig{PodsCidr: common.String("EXAMPLE-podsCidr-Value"),
			ServicesCidr: common.String("EXAMPLE-servicesCidr-Value")},
			ServiceLbSubnetIds: []string{"EXAMPLE--Value"},
			AddOns: &containerengine.AddOnOptions{IsKubernetesDashboardEnabled: common.Bool(true),
				IsTillerEnabled: common.Bool(false)},
			IpFamilies:             []containerengine.ClusterCreateOptionsIpFamiliesEnum{containerengine.ClusterCreateOptionsIpFamiliesIpv4},
			OpenIdConnectDiscovery: &containerengine.OpenIdConnectDiscovery{IsOpenIdConnectDiscoveryEnabled: common.Bool(true)},
			OpenIdConnectTokenAuthenticationConfig: &containerengine.OpenIdConnectTokenAuthenticationConfig{GroupsClaim: common.String("EXAMPLE-groupsClaim-Value"),
				GroupsPrefix:               common.String("EXAMPLE-groupsPrefix-Value"),
				IsOpenIdConnectAuthEnabled: common.Bool(false),
				RequiredClaims: []containerengine.KeyValue{containerengine.KeyValue{Key: common.String("EXAMPLE-key-Value"),
					Value: common.String("EXAMPLE-value-Value")}},
				SigningAlgorithms: []string{"EXAMPLE--Value"},
				UsernamePrefix:    common.String("EXAMPLE-usernamePrefix-Value"),
				CaCertificate:     common.String("EXAMPLE-caCertificate-Value"),
				ConfigurationFile: common.String("EXAMPLE-configurationFile-Value"),
				IssuerUrl:         common.String("EXAMPLE-issuerUrl-Value"),
				UsernameClaim:     common.String("EXAMPLE-usernameClaim-Value"),
				ClientId:          common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value")},
			PersistentVolumeConfig: &containerengine.PersistentVolumeConfigDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_k7Oc6": map[string]interface{}{"EXAMPLE_KEY_W0Md3": "EXAMPLE--Value"}},
				FreeformTags: map[string]string{"EXAMPLE_KEY_QOse4": "EXAMPLE_VALUE_MgygtC8tFBTRK9KSk0Q3"}},
			ServiceLbConfig: &containerengine.ServiceLbConfigDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_Gj4Us": map[string]interface{}{"EXAMPLE_KEY_oClwR": "EXAMPLE--Value"}},
				FreeformTags: map[string]string{"EXAMPLE_KEY_btE0y": "EXAMPLE_VALUE_L0nMkiC8MpYZTN0UOfT0"}},
			AdmissionControllerOptions: &containerengine.AdmissionControllerOptions{IsPodSecurityPolicyEnabled: common.Bool(false)}},
			Type:                     containerengine.ClusterTypeEnhancedCluster,
			ClusterPodNetworkOptions: []containerengine.ClusterPodNetworkOptionDetails{containerengine.FlannelOverlayClusterPodNetworkOptionDetails{}},
			FreeformTags:             map[string]string{"EXAMPLE_KEY_20BBB": "EXAMPLE_VALUE_FXNp2SzmYCC1zInXUMUZ"},
			KmsKeyId:                 common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
			KubernetesVersion:        common.String("EXAMPLE-kubernetesVersion-Value"),
			Name:                     common.String("EXAMPLE-name-Value"),
			VcnId:                    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vcnId-Value"),
			CompartmentId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			DefinedTags:              map[string]map[string]interface{}{"EXAMPLE_KEY_aOnjg": map[string]interface{}{"EXAMPLE_KEY_5Cz6W": "EXAMPLE--Value"}},
			EndpointConfig: &containerengine.CreateClusterEndpointConfigDetails{IsPublicIpEnabled: common.Bool(true),
				NsgIds:   []string{"EXAMPLE--Value"},
				SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")},
			ImagePolicyConfig: &containerengine.CreateImagePolicyConfigDetails{IsPolicyEnabled: common.Bool(true),
				KeyDetails: []containerengine.KeyDetails{containerengine.KeyDetails{KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")}}}}}

	// Send the request using the service client
	resp, err := client.CreateCluster(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}