

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

 **Description** 

 `AWS-CreateEKSClusterWithFargateProfile` Runbook 會使用 建立 Amazon Elastic Kubernetes Service (Amazon EKS) 叢集 AWS Fargate。

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

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux、macOS、 Windows

**參數**
+ AutomationAssumeRole

  類型：字串

  描述：（選用） 允許 Systems Manager Automation 代表您執行動作的 (IAM) 角色的 AWS Identity and Access Management Amazon Resource Name (ARN)。如果未指定角色，Systems Manager Automation 會使用啟動此 Runbook 之使用者的許可。
+ ClusterName

  類型：字串

  描述：（必要） 叢集的唯一名稱。
+ ClusterRoleArn

  類型：字串

  描述：（必要） IAM 角色的 ARN，提供 Kubernetes 控制平面代表您呼叫 AWS API 操作的許可。
+ FargateProfileName

  類型：字串

  描述：（必要） Fargate 設定檔的名稱。
+ FargateProfileRoleArn

  類型：字串

  描述：（必要） Amazon EKS Pod 執行 IAM 角色的 ARN。
+ FargateProfileSelectors

  類型：字串

  描述：（必要） 將 Pod 與 Fargate 設定檔相符的選取器。
+ SubnetIds

  類型：StringList

  描述：（必要） 您要用於 Amazon EKS 叢集IDs。Amazon EKS 會在這些子網路中建立彈性網路介面，以便在節點和 Kubernetes 控制平面之間進行通訊。您必須指定至少兩個子網路 ID。
+ EKSEndpointPrivateAccess

  類型：布林值

  預設：True

  描述：（選用） 將此值設為 `True`，以允許叢集 Kubernetes API 伺服器端點的私有存取。如果您啟用私有存取，叢集 VPC 中的 Kubernetes API 請求將使用私有 VPC 端點。如果您停用私有存取，且叢集中有節點或 Pod，則請確保 `publicAccessCidrs`包含與節點或 Fargate AWS 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` 參數需要下列動作才能成功使用 Runbook。
+ `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`

 **文件步驟** 
+ CreateEKSCluster (aws：executeAwsApi) - 建立 Amazon EKS 叢集。
+ VerifyEKSClusterIsActive (aws：waitForAwsResourceProperty) - 驗證叢集狀態為 `ACTIVE`。
+ CreateFargateProfile (aws：executeAwsApi) - 為叢集建立 Fargate。
+ VerifyFargateProfileIsActive (aws：waitForAwsResourceProperty) - 驗證 Fargate 設定檔狀態為 `ACTIVE`。

 **輸出** 

 `CreateEKSCluster.CreateClusterResponse`   
描述：從 `CreateCluster` API 呼叫收到的回應。

 `CreateFargateProfile.CreateFargateProfileResponse`   
描述：從 `CreateFargateProfile` API 呼叫收到的回應。