

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# `AWS-CreateEKSClusterWithFargateProfile`
<a name="aws-createeksclusterwithfargateprofile"></a>

 **描述** 

 `AWS-CreateEKSClusterWithFargateProfile`运行手册使用创建了亚马逊 Elastic Kubernetes Service（亚马逊 EKS）集群。 AWS Fargate

 [运行此自动化（控制台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWS-CreateEKSClusterWithFargateProfile) 

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux、macOS、Windows

**参数**
+ AutomationAssumeRole

  类型：字符串

  描述：（可选）允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称（ARN）。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
+ ClusterName

  类型：字符串

  描述：（必填）集群的唯一名称。
+ ClusterRoleArn

  类型：字符串

  描述：（必填）IAM 角色的 ARN，该角色为 Kubernetes 控制平面提供代表您调用 AWS API 操作的权限。
+ FargateProfileName

  类型：字符串

  描述：（必填）Fargate 配置文件的名称。
+ FargateProfileRoleArn

  类型：字符串

  描述：（必填）亚马逊 EKS Pod 执行 IAM 角色的 ARN。
+ FargateProfileSelectors

  类型：字符串

  描述：（必填）用于将吊舱与 Fargate 配置文件进行匹配的选择器。
+ SubnetIds

  类型： StringList

  描述：（必填）您要用于 Amazon EKS 集群的子网。 IDs Amazon EKS 在这些子网中创建弹性网络接口，用于在您的节点和 Kubernetes 控制平面之间进行通信。必须指定至少两个子网 IDs。
+ EKSEndpointPrivateAccess

  类型：布尔值

  默认值：True

  描述：（可选）将此值设置为，`True`以允许对集群的 Kubernetes API 服务器终端节点进行私有访问。如果启用私有访问，集群的 VPC 内的 Kubernetes API 请求将使用私有 VPC 端点。如果您禁用私有访问并且集群中有节点或 AWS Fargate Pod，请确保`publicAccessCidrs`其中包含与节点或 Fargate Pod 通信所必需的 CIDR 块。
+ EKSEndpointPublicAccess

  类型：布尔值

  默认值：False

  描述：（可选）将此值设置为，`False`以禁用对集群的 Kubernetes API 服务器端点的公共访问权限。如果您禁用公共访问，则集群的 Kubernetes API 服务器只能接收来自其启动的 VPC 内部的请求。
+ PublicAccessCIDRs

  类型： StringList

  描述：（可选）允许访问集群的公共 Kubernetes API 服务器端点的 CIDR 块。拒绝从您指定的 CIDR 块之外的地址与端点的通信。如果您已禁用私有终端节点访问并且集群中有节点或 Fargate pod，请确保指定必要的 CIDR 块。
+ SecurityGroupIds

  类型： StringList

  描述：（可选）指定一个或多个安全组以与 Amazon EKS 在您的账户中创建的弹性网络接口相关联。

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+ `ssm:GetAutomationExecution`
+ `ssm:StartAutomationExecution`
+ `ec2:DescribeRouteTables`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeVpcs`
+ `eks:CreateCluster`
+ `eks:CreateFargateProfile`
+ `eks:DescribeCluster`
+ `eks:DescribeFargateProfile`
+ `iam:CreateServiceLinkedRole`
+ `iam:GetRole`
+ `iam:ListAttachedRolePolicies`
+ `iam:PassRole`

 **文档步骤** 
+ 创建 EKSCluster (aws:executeAwsApi)-创建 Amazon EKS 集群。
+ 验证 EKSCluster IsActive (aws: waitForAwsResourceProperty)-验证集群状态为`ACTIVE`。
+ CreateFargateProfile (aws:executeAwsApi)-为集群创建 Fargate。
+ VerifyFargateProfileIsActive (aws: waitForAwsResourceProperty)-验证 Fargate 配置文件状态为。`ACTIVE`

 **输出** 

 `CreateEKSCluster.CreateClusterResponse`   
描述：从 `CreateCluster` API 调用中收到的响应。

 `CreateFargateProfile.CreateFargateProfileResponse`   
描述：从 `CreateFargateProfile` API 调用中收到的响应。