// 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{CreateClusterDetails: containerengine.CreateClusterDetails{KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
		KubernetesVersion: common.String("EXAMPLE-kubernetesVersion-Value"),
		Name:              common.String("EXAMPLE-name-Value"),
		Options: &containerengine.ClusterCreateOptions{AddOns: &containerengine.AddOnOptions{IsKubernetesDashboardEnabled: common.Bool(false),
			IsTillerEnabled: common.Bool(false)},
			AdmissionControllerOptions: &containerengine.AdmissionControllerOptions{IsPodSecurityPolicyEnabled: common.Bool(true)},
			KubernetesNetworkConfig: &containerengine.KubernetesNetworkConfig{ServicesCidr: common.String("EXAMPLE-servicesCidr-Value"),
				PodsCidr: common.String("EXAMPLE-podsCidr-Value")},
			PersistentVolumeConfig: &containerengine.PersistentVolumeConfigDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_wJkK6": map[string]interface{}{"EXAMPLE_KEY_62x91": "EXAMPLE--Value"}},
				FreeformTags: map[string]string{"EXAMPLE_KEY_tZvWv": "EXAMPLE_VALUE_tgYkQQaRy0GMgNyhbc9J"}},
			ServiceLbConfig: &containerengine.ServiceLbConfigDetails{FreeformTags: map[string]string{"EXAMPLE_KEY_Qalg1": "EXAMPLE_VALUE_Ig4gT1F6k6J6x4U0RiBq"},
				DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_tE6nN": map[string]interface{}{"EXAMPLE_KEY_odMtk": "EXAMPLE--Value"}}},
			ServiceLbSubnetIds: []string{"EXAMPLE--Value"}},
		ClusterPodNetworkOptions: []containerengine.ClusterPodNetworkOptionDetails{containerengine.FlannelOverlayClusterPodNetworkOptionDetails{}},
		DefinedTags:              map[string]map[string]interface{}{"EXAMPLE_KEY_HHsFl": map[string]interface{}{"EXAMPLE_KEY_UdgiJ": "EXAMPLE--Value"}},
		FreeformTags:             map[string]string{"EXAMPLE_KEY_uuRD2": "EXAMPLE_VALUE_wmka4JnxHOBBvBs23P10"},
		ImagePolicyConfig: &containerengine.CreateImagePolicyConfigDetails{IsPolicyEnabled: common.Bool(true),
			KeyDetails: []containerengine.KeyDetails{containerengine.KeyDetails{KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")}}},
		Type:          containerengine.ClusterTypeBasicCluster,
		VcnId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vcnId-Value"),
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		EndpointConfig: &containerengine.CreateClusterEndpointConfigDetails{IsPublicIpEnabled: common.Bool(true),
			NsgIds:   []string{"EXAMPLE--Value"},
			SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}},
		OpcRequestId:  common.String("XKDJOXQ3O6NNF4Y9BRMS<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-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)
}