AWS-CreateDSManagementInstance - AWS Systems Manager 自動化 Runbook 參考

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

AWS-CreateDSManagementInstance

Description

AWS-CreateDSManagementInstance Runbook 會建立 Amazon Elastic Compute Cloud (Amazon EC2) Windows 執行個體,供您用來管理 AWS Directory Service 目錄。管理執行個體無法用於管理 AD Connector 目錄。

執行此自動化 (主控台)

文件類型

 自動化

擁有者

Amazon

平台

Windows

參數

  • AutomationAssumeRole

    類型:字串

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

  • AmiID

    類型:字串

    預設:{{ ssm:/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-Base }}

    描述:(必要) 您要用來啟動管理執行個體的 Amazon Machine Image(AMI) ID。

  • DirectoryId

    類型:字串

    描述:(必要) 您要管理的 AWS Directory Service 目錄 ID。執行個體會加入您指定的目錄。

  • IamInstanceProfileName

    類型:字串

    描述:(必要) 您指定的名稱會套用至自動化建立並連接至管理執行個體的 IAM 執行個體描述檔。

  • InstanceType

    類型:字串

    預設:t3.medium

    允許的值:

    • t2.nano

    • t2.micro

    • t2.small

    • t2.medium

    • t2.large

    • t2.xlarge

    • t2.2xlarge

    • t3.nano

    • t3.micro

    • t3.small

    • t3.medium

    • t3.large

    • t3.xlarge

    • t3.2xlarge

    描述:(必要) 您要啟動的執行個體類型。

  • KeyPairName

    類型:字串

    描述:(選用) 建立執行個體時要使用的金鑰對。如果您未指定值,則不會與執行個體建立任何金鑰對關聯。

  • RemoteAccessCidr

    類型:字串

    描述:(必要) 您要允許 RDP 流量 (連接埠 3389) 的 CIDR 區塊。您指定的 CIDR 區塊會套用至傳入規則,而此規則會新增至自動化建立的安全群組。

  • SecurityGroupName

    類型:字串

    描述:(必要) 您指定的名稱會套用至自動化所建立並與管理執行個體相關聯的安全群組。

  • 標籤

    類型:MapList

    描述:(選用) 您要套用至自動化所建立資源的鍵值對。

必要的 IAM 許可

AutomationAssumeRole 參數需要下列動作才能成功使用 Runbook。

  • ds:DescribeDirectories

  • ec2:AuthorizeSecurityGroupIngress

  • ec2:CreateSecurityGroup

  • ec2:CreateTags

  • ec2:DeleteSecurityGroup

  • ec2:DescribeInstances

  • ec2:DescribeInstanceStatus

  • ec2:DescribeKeyPairs

  • ec2:DescribeSecurityGroups

  • ec2:DescribeVpcs

  • ec2:RunInstances

  • ec2:TerminateInstances

  • iam:AddRoleToInstanceProfile

  • iam:AttachRolePolicy

  • iam:CreateInstanceProfile

  • iam:CreateRole

  • iam:DeleteInstanceProfile

  • iam:DeleteRole

  • iam:DetachRolePolicy

  • iam:GetInstanceProfile

  • iam:GetRole

  • iam:ListAttachedRolePolicies

  • iam:ListInstanceProfiles

  • iam:ListInstanceProfilesForRole

  • iam:PassRole

  • iam:RemoveRoleFromInstanceProfile

  • iam:TagInstanceProfile

  • iam:TagRole

  • ssm:CreateDocument

  • ssm:DeleteDocument

  • ssm:DescribeInstanceInformation

  • ssm:GetAutomationExecution

  • ssm:GetParameters

  • ssm:ListCommandInvocations

  • ssm:ListCommands

  • ssm:ListDocuments

  • ssm:SendCommand

  • ssm:StartAutomationExecution

文件步驟

  • aws:executeAwsApi - 收集您在 DirectoryId 參數中指定的目錄詳細資訊。

  • aws:executeAwsApi - 取得啟動目錄之虛擬私有雲端 (VPC) 的 CIDR 區塊。

  • aws:executeAwsApi - 使用您在 SecurityGroupName 參數中指定的值建立安全群組。

  • aws:executeAwsApi - 為新建立的安全群組建立傳入規則,允許來自您在 RemoteAccessCidr 參數中指定 CIDR 的 RDP 流量。

  • aws:executeAwsApi - 使用您在 IamInstanceProfileName 參數中指定的值建立 IAM 角色和執行個體描述檔。

  • aws:executeAwsApi - 根據您在 Runbook 參數中指定的值啟動 Amazon EC2 執行個體。

  • aws:executeAwsApi - 建立 AWS Systems Manager 文件,將新啟動的執行個體加入您的目錄。

  • aws:runCommand - 將新執行個體加入您的目錄。

  • aws:runCommand - 在新執行個體上安裝遠端伺服器管理工具。