I need to create a eks cluster using ansible but ansible community.aws.aws_eks_cluster dosen't have kubernetesNetworkConfig parameter where we can specify serviceIpv4Cidr while creating cluster.
So i used the below to create but it failed with Unable to determine service/operation name to be authorized
AccessDeniedException,
- name: Call aws API to create EKS cluster
uri:
url: "https://eks.us-east-1.amazonaws.com/clusters"
method: PUT
validate_certs: yes
status_code:
- 200
body: "{{ hc_body | to_json | string }}"
return_content: yes
headers:
Authorization: Bearer "{{a}}"
X-Amz-Security-Token: "{{ security_token1 }}"
Content-Type: "application/json"
Accept: "application/json"
vars:
aws_access_key: "{{ aws_access_key1 }}"
aws_secret_key: "{{ aws_secret_key1 }}"
a: "{{ ( aws_access_key1 + ':' + aws_secret_key1 ) | b64decode }}"
hc_body:
clientRequestToken: "{{ security_token1 }}"
kubernetesNetworkConfig:
ipFamily: ipv4
serviceIpv4Cidr: "x.x.x.x/24"
name: my_cluster
resourcesVpcConfig:
endpointPrivateAccess: true
securityGroupIds: "{{group_id}}"
subnetIds: "{{subnets_list}}"
roleArn: "{{ arn_val2 }}"
is there any way to pass kubernetesNetworkConfig after/during cluster creation (rest api) or resolve the above issue?