Create EKS, AKS and GKE by using API

I want to create EKS, GKE, AKS by using API, like this for RKE

curl -k -s 'https://XXXX.com/v3/cluster' -H 'content-type: application/json' -H "Authorization: Bearer $TOKEN" --data-binary '{"type":"cluster","nodes":[],"rancherKubernetesEngineConfig":{"ignoreDockerVersion":true},"name":"yournewcluster"}' --insecure

I used Terraform and works fine but I would like to use API like RKE

The Solution:

curl -k -s 'https://XXXX.com/v3/cluster' -H 'content-type: application/json' -H "Authorization: Bearer $TOKEN" --data-binary '{"dockerRootDir":"/var/lib/docker","enableClusterAlerting":false,"enableClusterMonitoring":false,"enableNetworkPolicy":false,"windowsPreferedCluster":false,"type":"cluster","name":"alpha","eksConfig":{"imported":false,"amazonCredentialSecret":"cattle-global-data:cc-rc65p","displayName":"alpha","kmsKey":"","kubernetesVersion":"1.21","loggingTypes":[],"nodeGroups":[{"desiredSize":2,"diskSize":20,"ec2SshKey":"","gpu":false,"imageId":"","instanceType":"t3.medium","labels":{},"maxSize":2,"minSize":2,"nodegroupName":"alpha","requestSpotInstances":false,"resourceTags":{},"spotInstanceTypes":[],"subnets":[],"tags":{},"type":"nodeGroup","userData":"","launchTemplate":null,"version":"1.21"}],"privateAccess":false,"publicAccess":true,"publicAccessSources":[],"region":"eu-central-1","secretsEncryption":false,"securityGroups":[],"serviceRole":"","subnets":[],"tags":{},"type":"eksclusterconfigspec"},"labels":{}}'```