id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
systems-manager-automation-runbook-guide-098
|
systems-manager-automation-runbook-guide.pdf
| 98 |
• AWSSupport-TroubleshootEKSWorkerNode • AWS-UpdateEKSCluster • AWS-UpdateEKSManagedNodeGroup • AWS-UpdateEKSSelfManagedLinuxNodeGroups • AWSSupport-SetupK8sApiProxyForEKS • AWSSupport-TroubleshootEbsCsiDriversForEks AWSSupport-CollectEKSInstanceLogs Description Amazon EKS 387 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-CollectEKSInstanceLogs runbook gathers operating system and Amazon Elastic Kubernetes Service (Amazon EKS) related log files from an Amazon Elastic Compute Cloud (Amazon EC2) instance to help you troubleshoot common issues. While the automation is gathering the associated log files, changes are made to the file system structure including the creation of temporary directories, the copying of log files to the temporary directories, and compressing the log files into an archive. This activity can result in increased CPUUtilization on the EC2 instance. For more information about CPUUtilization , see Instance metrics in the Amazon CloudWatch User Guide . If you specify a value for the LogDestination parameter, the automation evaluates the policy status of the Amazon Simple Storage Service (Amazon S3) bucket you specify. To help with the security of the logs gathered from your EC2 instance, if the policy status isPublic is set to true , or if the access control list (ACL) grants READ|WRITE permissions to the All Users Amazon S3 predefined group, the logs are not uploaded. For more information about Amazon S3 predefined groups, see Amazon S3 predefined groups in the Amazon Simple Storage Service User Guide . Note This automation requires at least 10 percent of available disk space on the root Amazon Elastic Block Store (Amazon EBS) volume attached to your EC2 instance. If there is not enough available disk space on the root volume, the automation stops. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux Parameters • AutomationAssumeRole AWSSupport-CollectEKSInstanceLogs 388 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EKSInstanceId Type: String Description: (Required) ID of the Amazon EKS EC2 instance you want to collect logs from. • LogDestination Type: String Description: (Optional) The S3 bucket in your account to upload the archived logs to. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ssm:SendCommand We recommend that the EC2 instance receiving the command has an IAM role with the AmazonSSMManagedInstanceCore Amazon managed policy attached. To upload the log archive to the S3 bucket you specify in the LogDestination parameter, you must add the s3:PutObject permission. Document Steps • aws:assertAwsResourceProperty - Confirms the operating system of the value specified in the EKSInstanceId parameter is Linux. • aws:runCommand - Gathers operating system and Amazon EKS related log files, compressing them into an archive in the /var/log directory. AWSSupport-CollectEKSInstanceLogs 389 AWS Systems Manager Automation runbook reference User Guide • aws:branch - Confirms whether a value was specified for the LogDestination parameter. • aws:runCommand - Uploads the log archive to the S3 bucket you specify in the LogDestination parameter. AWS-CreateEKSClusterWithFargateProfile Description The AWS-CreateEKSClusterWithFargateProfile runbook creates an Amazon Elastic Kubernetes Service (Amazon EKS) cluster using an AWS Fargate. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) A unique name for the cluster. AWS-CreateEKSClusterWithFargateProfile 390 AWS Systems Manager Automation runbook reference User Guide • ClusterRoleArn Type: String Description: (Required) The ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. • FargateProfileName Type: String Description: (Required) The name of the Fargate profile. • FargateProfileRoleArn Type: String Description: (Required) The ARN of the Amazon EKS Pod execution IAM role. • FargateProfileSelectors Type: String Description: (Required) The selectors to match pods to the Fargate profile. • SubnetIds Type: StringList Description: (Required) The IDs of the subnets you want to use for your Amazon EKS cluster. Amazon EKS creates elastic network interfaces in these subnets for communication between your nodes and the Kubernetes control plane. You must specify at least two subnet IDs. • EKSEndpointPrivateAccess Type: Boolean Default: True Description: (Optional) Set this value to True to allow private access for your cluster's Kubernetes API server endpoint. If you enable private access, Kubernetes API requests from within your cluster's VPC use the private VPC endpoint. If you disable private access and you have nodes or AWS Fargate pods in the cluster, then ensure that publicAccessCidrs include the necessary CIDR
|
systems-manager-automation-runbook-guide-099
|
systems-manager-automation-runbook-guide.pdf
| 99 |
to use for your Amazon EKS cluster. Amazon EKS creates elastic network interfaces in these subnets for communication between your nodes and the Kubernetes control plane. You must specify at least two subnet IDs. • EKSEndpointPrivateAccess Type: Boolean Default: True Description: (Optional) Set this value to True to allow private access for your cluster's Kubernetes API server endpoint. If you enable private access, Kubernetes API requests from within your cluster's VPC use the private VPC endpoint. If you disable private access and you have nodes or AWS Fargate pods in the cluster, then ensure that publicAccessCidrs include the necessary CIDR blocks for communication with the nodes or Fargate pods. • EKSEndpointPublicAccess AWS-CreateEKSClusterWithFargateProfile 391 AWS Systems Manager Automation runbook reference User Guide Type: Boolean Default: False Description: (Optional) Set this value to False to disable public access to your cluster's Kubernetes API server endpoint. If you disable public access, your cluster's Kubernetes API server can only receive requests from within the VPC where it was launched. • PublicAccessCIDRs Type: StringList Description: (Optional) The CIDR blocks that are allowed access to your cluster's public Kubernetes API server endpoint. Communication to the endpoint from addresses outside of the CIDR blocks that you specify is denied. If you've disabled private endpoint access and you have nodes or Fargate pods in the cluster, then ensure that you specify the necessary CIDR blocks. • SecurityGroupIds Type: StringList Description: (Optional) Specify one or more security groups to associate with the elastic network interfaces created in your account by Amazon EKS. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • ec2:DescribeRouteTables • ec2:DescribeSubnets • ec2:DescribeVpcs • eks:CreateCluster • eks:CreateFargateProfile • eks:DescribeCluster • eks:DescribeFargateProfile AWS-CreateEKSClusterWithFargateProfile 392 AWS Systems Manager Automation runbook reference User Guide • iam:CreateServiceLinkedRole • iam:GetRole • iam:ListAttachedRolePolicies • iam:PassRole Document Steps • CreateEKSCluster (aws:executeAwsApi) - Creates an Amazon EKS cluster. • VerifyEKSClusterIsActive (aws:waitForAwsResourceProperty) - Verifies the cluster state is ACTIVE. • CreateFargateProfile (aws:executeAwsApi) - Creates a Fargate for the cluster. • VerifyFargateProfileIsActive (aws:waitForAwsResourceProperty) - Verifies the Fargate profile state is ACTIVE. Outputs CreateEKSCluster.CreateClusterResponse Description: Response received from the CreateCluster API call. CreateFargateProfile.CreateFargateProfileResponse Description: Response received from the CreateFargateProfile API call. AWS-CreateEKSClusterWithNodegroup Description The AWS-CreateEKSClusterWithNodegroup runbook creates an Amazon Elastic Kubernetes Service (Amazon EKS) cluster using a node group for capacity. Run this Automation (console) Document type Automation Owner AWS-CreateEKSClusterWithNodegroup 393 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) A unique name for the cluster. • ClusterRoleArn Type: String Description: (Required) The ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. • NodegroupName Type: String Description: (Required) A unique name for the node group. • NodegroupRoleArn Type: String Description: (Required) The ARN of the IAM role to associate with your node group. The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch nodes and register them into a cluster, you must create an IAM role for those nodes to use when they are launched. AWS-CreateEKSClusterWithNodegroup 394 AWS Systems Manager Automation runbook reference User Guide • SubnetIds Type: StringList Description: (Required) The IDs of the subnets you want to use for your Amazon EKS cluster. Amazon EKS creates elastic network interfaces in these subnets for communication between your nodes and the Kubernetes control plane. You must specify at least two subnet IDs. • EKSEndpointPrivateAccess Type: Boolean Default: True Description: (Optional) Set this value to True to allow private access for your cluster's Kubernetes API server endpoint. If you enable private access, Kubernetes API requests from within your cluster's VPC use the private VPC endpoint. If you disable private access and you have nodes or AWS Fargate pods in the cluster, then ensure that publicAccessCidrs include the necessary CIDR blocks for communication with the nodes or Fargate pods. • EKSEndpointPublicAccess Type: Boolean Default: False Description: (Optional) Set this value to False to disable public access to your cluster's Kubernetes API server endpoint. If you disable public access, your cluster's Kubernetes API server can only receive requests from within the VPC where it was launched. • PublicAccessCIDRs Type: StringList Description: (Optional) The CIDR blocks that are allowed access to your cluster's public Kubernetes API server endpoint. Communication to the endpoint from addresses outside of the CIDR blocks that you
|
systems-manager-automation-runbook-guide-100
|
systems-manager-automation-runbook-guide.pdf
| 100 |
in the cluster, then ensure that publicAccessCidrs include the necessary CIDR blocks for communication with the nodes or Fargate pods. • EKSEndpointPublicAccess Type: Boolean Default: False Description: (Optional) Set this value to False to disable public access to your cluster's Kubernetes API server endpoint. If you disable public access, your cluster's Kubernetes API server can only receive requests from within the VPC where it was launched. • PublicAccessCIDRs Type: StringList Description: (Optional) The CIDR blocks that are allowed access to your cluster's public Kubernetes API server endpoint. Communication to the endpoint from addresses outside of the CIDR blocks that you specify is denied. If you've disabled private endpoint access and you have nodes or Fargate pods in the cluster, then ensure that you specify the necessary CIDR blocks. • SecurityGroupIds Type: StringList AWS-CreateEKSClusterWithNodegroup 395 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) Specify one or more security groups to associate with the elastic network interfaces created in your account by Amazon EKS. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeSubnets • eks:CreateCluster • eks:CreateNodegroup • eks:DescribeCluster • eks:DescribeNodegroup • iam:CreateServiceLinkedRole • iam:GetRole • iam:ListAttachedRolePolicies • iam:PassRole Document Steps • CreateEKSCluster (aws:executeAwsApi) - Creates an Amazon EKS cluster. • VerifyEKSClusterIsActive (aws:waitForAwsResourceProperty) - Verifies the cluster state is ACTIVE. • CreateNodegroup (aws:executeAwsApi) - Creates a node group for the cluster. • VerifyNodegroupIsActive (aws:waitForAwsResourceProperty) - Verifies the node group state is ACTIVE. Outputs • CreateEKSCluster.CreateClusterResponse: Response received from the CreateCluster API call. AWS-CreateEKSClusterWithNodegroup 396 AWS Systems Manager Automation runbook reference User Guide • CreateNodegroup.CreateNodegroupResponse: Response received from the CreateNodegroup API call. AWS-DeleteEKSCluster Description This runbook deletes the resources associated with an Amazon EKS cluster, including node groups and Fargate profiles. Optionally, you can choose to delete all self-managed nodes, the AWS CloudFormation stacks used to create the nodes, and the VPC CloudFormation stack for your cluster. For more information about deleting a cluster, see Deleting a cluster in the Amazon EKS User Guide. Note If you have active services in your cluster that are associated with a load balancer, you must delete those services before deleting the cluster. If you don't, the system can't delete the load balancers. Use the following procedure to find and delete services before you run the AWS-DeleteEKSCluster runbook. To locate and delete services in your cluster 1. Install the Kubernetes command line utility, kubectl . For more information, see Installing kubectl in the Amazon EKS User Guide. 2. Run the following command to list all services running in your cluster. kubectl get svc --all-namespaces 3. Run the following command to delete any services that have an associated EXTERNAL-IP value. These services are fronted by a load balancer, and you must delete them in Kubernetes to allow the load balancer and associated resources to be properly released. kubectl delete svc service-name AWS-DeleteEKSCluster 397 AWS Systems Manager Automation runbook reference User Guide You can now run the AWS-DeleteEKSCluster runbook. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EKSClusterName Type: String Description: (Required) The name of the Amazon EKS Cluster to be deleted. • VPCCloudFormationStack Type: String Description: (Optional) AWS CloudFormation stack name for VPC for the EKS cluster being deleted. This deletes the AWS CloudFormation stack for VPC and any resources created by the stack. • VPCCloudFormationStackRole Type: String AWS-DeleteEKSCluster 398 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The ARN of an IAM role that AWS CloudFormation assumes to delete the VPC CloudFormation stack. AWS CloudFormation uses the role's credentials to make calls on your behalf. • SelfManagedNodeStacks Type: String Description: (Optional) Comma-separated list of AWS CloudFormation stack names for self- managed nodes, This will delete the AWS CloudFormation stacks for self-managed nodes. • SelfManagedNodeStacksRole Type: String Description: (Optional) The ARN of an IAM role that AWS CloudFormation assumes to delete the Self-managed Node Stacks. AWS CloudFormation uses the role's credentials to make calls on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • sts:AssumeRole • eks:ListNodegroups • eks:DeleteNodegroup • eks:ListFargateProfiles • eks:DeleteFargateProfile • eks:DeleteCluster • cfn:DescribeStacks • cfn:DeleteStack Document Steps • aws:executeScript - DeleteNodeGroups: Find and delete all node groups in the EKS cluster. AWS-DeleteEKSCluster 399 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - DeleteFargateProfiles: Find and delete all Fargate profiles in the EKS cluster. • aws:executeScript - DeleteSelfManagedNodes: Delete all self-managed nodes and the CloudFormation stacks used to create the nodes.
|
systems-manager-automation-runbook-guide-101
|
systems-manager-automation-runbook-guide.pdf
| 101 |
AWS CloudFormation uses the role's credentials to make calls on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • sts:AssumeRole • eks:ListNodegroups • eks:DeleteNodegroup • eks:ListFargateProfiles • eks:DeleteFargateProfile • eks:DeleteCluster • cfn:DescribeStacks • cfn:DeleteStack Document Steps • aws:executeScript - DeleteNodeGroups: Find and delete all node groups in the EKS cluster. AWS-DeleteEKSCluster 399 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - DeleteFargateProfiles: Find and delete all Fargate profiles in the EKS cluster. • aws:executeScript - DeleteSelfManagedNodes: Delete all self-managed nodes and the CloudFormation stacks used to create the nodes. • aws:executeScript - DeleteEKSCluster: Delete EKS cluster. • aws:executeScript - DeleteVPCCloudFormationStack: Delete the VPC CloudFormation stack. AWS-MigrateToNewEKSSelfManagedNodeGroup Description The AWS-MigrateToNewEKSSelfManagedNodeGroup runbook helps you create a new Amazon Elastic Kubernetes Service (Amazon EKS) Linux node group to migrate your existing application to. For more information, see Migrating to a new node group in the Amazon EKS User Guide. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. AWS-MigrateToNewEKSSelfManagedNodeGroup 400 AWS Systems Manager Automation runbook reference User Guide • OldStackName Type: String Description: (Required) The name or stack ID of your existing AWS CloudFormation stack. • NewStackName Type: String Description: (Optional) The name of the new AWS CloudFormation stack that is created for your new node group. If you don't specify a value for this parameter, the stack name is created using the format: NewNodeGroup-ClusterName-AutomationExecutionID. • ClusterControlPlaneSecurityGroup Type: String Description: (Optional) The ID of the security group you want nodes to use to communicate with the Amazon EKS control plane. If you don't specify a value for this parameter, the security group specified in your existing AWS CloudFormation stack is used. • NodeInstanceType Type: String Description: (Optional) The instance type that you want to use for the new node group. If you don't specify a value for this parameter, the instance type specified in your existing AWS CloudFormation stack is used. • NodeGroupName Type: String Description: (Optional) The name of your new node group. If you don't specify a value for this parameter, the node group name specified in your existing AWS CloudFormation stack is used. • NodeAutoScalingGroupDesiredCapacity Type: String Description: (Optional) The desired number of nodes to scale to when your new stack is created. This number must be greater than or equal to the NodeAutoScalingGroupMinSize value and less than or equal to the NodeAutoScalingGroupMaxSize. If you don't specify a value for this 401 AWS-MigrateToNewEKSSelfManagedNodeGroup AWS Systems Manager Automation runbook reference User Guide parameter, the node group desired capacity specified in your existing AWS CloudFormation stack is used. • NodeAutoScalingGroupMaxSize Type: String Description: (Optional) The maximum number of nodes that your node group can scale out to. If you don't specify a value for this parameter, the node group maximum size specified in your existing AWS CloudFormation stack is used. • NodeAutoScalingGroupMinSize Type: String Description: (Optional) The minimum number of nodes that your node group can scale in to. If you don't specify a value for this parameter, the node group minimum size specified in your existing AWS CloudFormation stack is used. • NodeImageId Type: String Description: (Optional) The ID of the Amazon Machine Image (AMI) that you want the node group to use. • NodeImageIdSSMParam Type: String Description: (Optional) The public Systems Manager parameter for the AMI that you want the node group to use. • NodeVolumeSize Type: String Description: (Optional) The size of the root volume for your nodes in GiB. If you don't specify a value for this parameter, the node volume size specified in your existing AWS CloudFormation stack is used. • NodeVolumeType Type: String AWS-MigrateToNewEKSSelfManagedNodeGroup 402 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The type of Amazon EBS volume you want to use for the root volume of your nodes. If you don't specify a value for this parameter, the volume type specified in your existing AWS CloudFormation stack is used. • KeyName Type: String Description: (Optional) The key pair you want to assign to your nodes. If you don't specify a value for this parameter, the key pair specified in your existing AWS CloudFormation stack is used. • Subnets Type: StringList Description: (Optional) A comma-separated list of the subnet IDs that you want to use for your new node group. If you don't specify a value for this parameter, the subnets specified in your existing AWS CloudFormation stack is used. • DisableIMDSv1 Type: Boolean Description: (Optional) Specify true to disable Instance Metadata Service Version 1 (IMDSv1). By default, nodes
|
systems-manager-automation-runbook-guide-102
|
systems-manager-automation-runbook-guide.pdf
| 102 |
used. • KeyName Type: String Description: (Optional) The key pair you want to assign to your nodes. If you don't specify a value for this parameter, the key pair specified in your existing AWS CloudFormation stack is used. • Subnets Type: StringList Description: (Optional) A comma-separated list of the subnet IDs that you want to use for your new node group. If you don't specify a value for this parameter, the subnets specified in your existing AWS CloudFormation stack is used. • DisableIMDSv1 Type: Boolean Description: (Optional) Specify true to disable Instance Metadata Service Version 1 (IMDSv1). By default, nodes support IMDSv1 and IMDSv2. • BootstrapArguments Type: String Description: (Optional) Additional arguments you want to pass to the node bootstrap script. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ssm:GetParameters • autoscaling:CreateAutoScalingGroup AWS-MigrateToNewEKSSelfManagedNodeGroup 403 AWS Systems Manager Automation runbook reference User Guide • autoscaling:CreateOrUpdateTags • autoscaling:DeleteTags • autoscaling:DescribeAutoScalingGroups • autoscaling:DescribeScalingActivities • autoscaling:DescribeScheduledActions • autoscaling:SetDesiredCapacity • autoscaling:TerminateInstanceInAutoScalingGroup • autoscaling:UpdateAutoScalingGroup • cloudformation:CreateStack • cloudformation:DescribeStackResource • cloudformation:DescribeStacks • cloudformation:UpdateStack • ec2:AuthorizeSecurityGroupEgress • ec2:AuthorizeSecurityGroupIngress • ec2:CreateLaunchTemplateVersion • ec2:CreateLaunchTemplate • ec2:CreateSecurityGroup • ec2:CreateTags • ec2:DeleteLaunchTemplate • ec2:DeleteSecurityGroup • ec2:DescribeAvailabilityZones • ec2:DescribeImages • ec2:DescribeInstanceAttribute • ec2:DescribeInstanceStatus • ec2:DescribeInstances • ec2:DescribeKeyPairs • ec2:DescribeLaunchTemplateVersions • ec2:DescribeLaunchTemplates • ec2:DescribeSecurityGroups AWS-MigrateToNewEKSSelfManagedNodeGroup 404 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeSubnets • ec2:DescribeVpcs • ec2:RevokeSecurityGroupEgress • ec2:RevokeSecurityGroupIngress • ec2:RunInstances • ec2:TerminateInstances • iam:AddRoleToInstanceProfile • iam:AttachRolePolicy • iam:CreateInstanceProfile • iam:CreateRole • iam:GetInstanceProfile • iam:GetRole • iam:PassRole Document Steps • DetermineParameterValuesForNewNodeGroup (aws:executeScript) - Gathers the parameter values to use for the new node group. • CreateStack (aws:createStack) - Creates the AWS CloudFormation stack for the new node group. • GetNewStackNodeInstanceRole (aws:executeAwsApi) - Gets the node instance role. • GetNewStackSecurityGroup (aws:executeAwsApi) - The step gets the node security group. • AddIngressRulesToNewNodeSecurityGroup (aws:executeAwsApi) - Adds ingress rules to the newly created security group so it can accept traffic from the one assigned to your previous node group. • AddIngressRulesToOldNodeSecurityGroup (aws:executeAwsApi) - Adds ingress rules to the previous security group so it can accept traffic from the one assigned to your newly created node group. • VerifyStackComplete (aws:assertAwsResourceProperty) - Verifies the new stack status is CREATE_COMPLETE. Outputs AWS-MigrateToNewEKSSelfManagedNodeGroup 405 AWS Systems Manager Automation runbook reference User Guide DetermineParameterValuesForNewNodeGroup.NewStackParameters - The parameters used to create the new stack. GetNewStackNodeInstanceRole.NewNodeInstanceRole - The node instance role for the new node group. GetNewStackSecurityGroup.NewNodeSecurityGroup - The ID of the security group for the new node group. DetermineParameterValuesForNewNodeGroup.NewStackName - The AWS CloudFormation stack name for the new node group. CreateStack.StackId - The AWS CloudFormation stack ID for the new node group. AWSPremiumSupport-TroubleshootEKSCluster Description The AWSPremiumSupport-TroubleshootEKSCluster runbook diagnoses common issues with an Amazon Elastic Kubernetes Service (Amazon EKS) cluster, underlying infrastructure, and provides recommended remediation steps. Important Access to AWSPremiumSupport-* runbooks requires either an Enterprise or Business Support Subscription. For more information, see Compare AWS Support Plans . If you specify a value for the S3BucketName parameter, the automation evaluates the policy status of the Amazon Simple Storage Service (Amazon S3) bucket you specify. To help with the security of the logs gathered from your EC2 instance, if the policy status isPublic is set to true , or if the access control list (ACL) grants READ|WRITE permissions to the All Users Amazon S3 predefined group, the logs are not uploaded. For more information about Amazon S3 predefined groups, see Amazon S3 predefined groups in the Amazon Simple Storage Service User Guide . Run this Automation (console) Document type Automation AWSPremiumSupport-TroubleshootEKSCluster 406 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the Amazon EKS cluster that you want to troubleshoot. • S3BucketName Type: String Description: (Required) The name of the private Amazon S3 bucket where the report generated by the runbook should be uploaded. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeInstances • ec2:DescribeInstanceTypes AWSPremiumSupport-TroubleshootEKSCluster 407 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeSubnets • ec2:DescribeSecurityGroups • ec2:DescribeRouteTables • ec2:DescribeNatGateways • ec2:DescribeVpcs • ec2:DescribeNetworkAcls • iam:GetInstanceProfile • iam:ListInstanceProfiles • iam:ListAttachedRolePolicies • eks:DescribeCluster • eks:ListNodegroups • eks:DescribeNodegroup • autoscaling:DescribeAutoScalingGroups In addition, the AWS Identity and Access Management (IAM) policy attached to the user or role that starts the automation must allow the ssm:GetParameter operation to the following public AWS Systems Manager parameters to get the latest recommended Amazon EKS Amazon Machine Image (AMI) for the worker nodes. • arn:aws:ssm:::parameter/aws/service/eks/optimized-ami/*/amazon-linux-2/ recommended/image_id •
|
systems-manager-automation-runbook-guide-103
|
systems-manager-automation-runbook-guide.pdf
| 103 |
use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeInstances • ec2:DescribeInstanceTypes AWSPremiumSupport-TroubleshootEKSCluster 407 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeSubnets • ec2:DescribeSecurityGroups • ec2:DescribeRouteTables • ec2:DescribeNatGateways • ec2:DescribeVpcs • ec2:DescribeNetworkAcls • iam:GetInstanceProfile • iam:ListInstanceProfiles • iam:ListAttachedRolePolicies • eks:DescribeCluster • eks:ListNodegroups • eks:DescribeNodegroup • autoscaling:DescribeAutoScalingGroups In addition, the AWS Identity and Access Management (IAM) policy attached to the user or role that starts the automation must allow the ssm:GetParameter operation to the following public AWS Systems Manager parameters to get the latest recommended Amazon EKS Amazon Machine Image (AMI) for the worker nodes. • arn:aws:ssm:::parameter/aws/service/eks/optimized-ami/*/amazon-linux-2/ recommended/image_id • arn:aws:ssm:::parameter/aws/service/ami-windows-latest/ Windows_Server-2019-English-Core-EKS_Optimized-*/image_id • arn:aws:ssm:::parameter/aws/service/ami-windows-latest/ Windows_Server-2019-English-Full-EKS_Optimized-*/image_id • arn:aws:ssm:::parameter/aws/service/ami-windows-latest/ Windows_Server-1909-English-Core-EKS_Optimized-*/image_id • arn:aws:ssm:::parameter/aws/service/eks/optimized-ami/*/amazon-linux-2- gpu/recommended/image_id To upload the report generated by the runbook to an Amazon S3 bucket, the following permissions are required for the specified Amazon S3 bucket you specify. AWSPremiumSupport-TroubleshootEKSCluster 408 AWS Systems Manager Automation runbook reference User Guide • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:PutObject Document Steps • aws:executeAwsApi - Gathers details for the specified Amazon EKS cluster. • aws:executeScript - Gathers details of the Amazon Elastic Compute Cloud (Amazon EC2) instances, Auto Scaling groups, AMIs, and Amazon EC2 GPU graphic instance types. • aws:executeScript - Gathers details of the virtual private cloud (VPC), subnets, network address translation (NAT) gateways, subnet routes, security groups and network access control lists (ACLs) of the Amazon EKS cluster. • aws:executeScript - Gathers details of attached IAM instance profiles and role policies. • aws:executeScript - Gathers details of the Amazon S3 bucket you specify in the S3BucketName parameter. • aws:executeScript - Classifies the Amazon VPC subnets as public or private. • aws:executeScript - Checks the Amazon VPC subnets for tags that are required as part of an Amazon EKS cluster. • aws:executeScript - Checks the Amazon VPC subnets for the tags that are required for Elastic Load Balancing subnets. • aws:executeScript - Checks if the worker node Amazon EC2 instances use the latest Amazon EKS optimized AMIs • aws:executeScript - Checks if the Amazon VPC security groups attached to worker nodes for the tags that are required. • aws:executeScript - Checks the Amazon EKS cluster and worker node Amazon VPC security group rules for the recommended ingress rules to the Amazon EKS cluster. • aws:executeScript - Checks the Amazon EKS cluster and worker node Amazon VPC security group rules for the recommended egress rules from the Amazon EKS cluster. • aws:executeScript - Checks the network ACL configuration of the Amazon VPC subnets. • aws:executeScript - Checks if the worker node Amazon EC2 instances have the required managed policies. • aws:executeScript - Checks if the Auto Scaling groups have the necessary tags for cluster autoscaling. AWSPremiumSupport-TroubleshootEKSCluster 409 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Checks if the worker node Amazon EC2 instances are connected to the internet. • aws:executeScript - Generates a report based on the outputs from the previous steps. If a value is specified for the S3BucketName parameter, the generated report is uploaded to the Amazon S3 bucket. AWSSupport-TroubleshootEKSWorkerNode Description The AWSSupport-TroubleshootEKSWorkerNode runbook analyzes an Amazon Elastic Compute Cloud (Amazon EC2) worker node and Amazon Elastic Kubernetes Service (Amazon EKS) cluster to help you identify and troubleshoot common causes that prevent worker nodes from joining a cluster. The runbook outputs guidance to help you resolve any issues that are identified. Important To successfully run this automation, the state of your Amazon EC2 worker node must be running , and the Amazon EKS cluster state must be ACTIVE . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux Parameters • AutomationAssumeRole Type: String AWSSupport-TroubleshootEKSWorkerNode 410 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the Amazon EKS cluster. • WorkerID Type: String Description: (Required) The ID of the Amazon EC2 worker node that failed to join the cluster. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeDhcpOptions • ec2:DescribeImages • ec2:DescribeInstanceAttribute • ec2:DescribeInstances • ec2:DescribeInstanceStatus • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcAttribute • ec2:DescribeVpcEndpoints • ec2:DescribeVpcs AWSSupport-TroubleshootEKSWorkerNode 411 AWS Systems Manager Automation runbook reference User Guide • eks:DescribeCluster • iam:GetInstanceProfile • iam:GetRole • iam:ListAttachedRolePolicies • ssm:DescribeInstanceInformation • ssm:ListCommandInvocations • ssm:ListCommands • ssm:SendCommand Document Steps • aws:assertAwsResourceProperty - Confirms that the Amazon EKS cluster you specify in the ClusterName parameter exists and is in an ACTIVE state. • aws:assertAwsResourceProperty - Confirms that the Amazon EC2 worker node you specify in the WorkerID parameter exists and is in a running state. • aws:executeScript
|
systems-manager-automation-runbook-guide-104
|
systems-manager-automation-runbook-guide.pdf
| 104 |
ec2:DescribeImages • ec2:DescribeInstanceAttribute • ec2:DescribeInstances • ec2:DescribeInstanceStatus • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcAttribute • ec2:DescribeVpcEndpoints • ec2:DescribeVpcs AWSSupport-TroubleshootEKSWorkerNode 411 AWS Systems Manager Automation runbook reference User Guide • eks:DescribeCluster • iam:GetInstanceProfile • iam:GetRole • iam:ListAttachedRolePolicies • ssm:DescribeInstanceInformation • ssm:ListCommandInvocations • ssm:ListCommands • ssm:SendCommand Document Steps • aws:assertAwsResourceProperty - Confirms that the Amazon EKS cluster you specify in the ClusterName parameter exists and is in an ACTIVE state. • aws:assertAwsResourceProperty - Confirms that the Amazon EC2 worker node you specify in the WorkerID parameter exists and is in a running state. • aws:executeScript - Runs a Python script that helps identify possible causes for the worker node failing to join the cluster. AWS-UpdateEKSCluster Description The AWS-UpdateEKSCluster runbook helps you update your Amazon Elastic Kubernetes Service (Amazon EKS) cluster to the Kubernetes version that you want to use. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows AWS-UpdateEKSCluster 412 AWS Systems Manager Automation runbook reference User Guide Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of your Amazon EKS cluster. • Version Type: String Description: (Required) The Kubernetes version that you want to update your cluster to. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • eks:DescribeUpdate • eks:UpdateClusterVersion Document Steps • aws:executeAwsApi - Updates the Kubernetes version that is used by your Amazon EKS cluster. • aws:waitForAwsResourceProperty - Waits for the update status to be Successful. AWS-UpdateEKSManagedNodeGroup Description AWS-UpdateEKSManagedNodeGroup 413 AWS Systems Manager Automation runbook reference User Guide The AWS-UpdateEKSManagedNodeGroup runbook helps you update an Amazon Elastic Kubernetes Service (Amazon EKS) managed node group. You can either choose a Version or Configuration update. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the cluster whose node group you want to update. • NodeGroupName Type: String Description: (Required) The name of the node group to update. • UpdateType Type: String Valid values: Update Node Group Version | Update Node Group Configurations AWS-UpdateEKSManagedNodeGroup 414 AWS Systems Manager Automation runbook reference User Guide Default: Update Node Group Version Description: (Required) The type of update that you want to perform on the node group. The following parameters apply only to the Version update type: • AMIReleaseVersion Type: String Description: (Optional) The version of the Amazon EKS optimized AMI that you want to use. By default, the latest version is used. • ForceUpgrade Type: Boolean Description: (Optional) If true, the update won't fail in response to a pod disruption budget violation. • KubernetesVersion Type: String Description: (Optional) The Kubernetes version to update the node group to. • LaunchTemplateId Type: String Description: (Optional) The ID of the launch template. • LaunchTemplateName Type: String Description: (Optional) The name of the launch template. • LaunchTemplateVersion Type: String Description: (Optional) The Amazon Elastic Compute Cloud (Amazon EC2) launch template version. This parameter is only valid if a node group was created from a launch template. AWS-UpdateEKSManagedNodeGroup 415 AWS Systems Manager Automation runbook reference User Guide The following parameters apply only to the Configuration update type: • AddOrUpdateNodeGroupLabels Type: StringMap Description: (Optional) Kubernetes labels that you want to add or update. • AddOrUpdateKubernetesTaintsEffect Type: StringList Description: (Optional) The Kubernetes taints that you want to add or update. • MaxUnavailableNodeGroups Type: Integer Default: 0 Description: (Optional) The maximum number of nodes that are unavailable at once during a version update. • MaxUnavailablePercentageNodeGroup Type: Integer Default: 0 Description: (Optional) The percentage of nodes that are unavailable during a version update. • NodeGroupDesiredSize Type: Integer Default: 0 Description: (Optional) The number of nodes that the managed node group should maintain. • NodeGroupMaxSize Type: Integer Default: 0 AWS-UpdateEKSManagedNodeGroup 416 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The maximum number of nodes that the managed node group can scale out to. • NodeGroupMinSize Type: Integer Default: 0 Description: (Optional) The minimum number of nodes that the managed node group can scale in to. • RemoveKubernetesTaintsEffect Type: StringList Description: (Optional) The Kubernetes taints that you want to remove. • RemoveNodeGroupLabels Type: StringList Description: (Optional) A comma-separated list of labels that you want to remove. Required IAM permissions The AutomationAssumeRole parameter
|
systems-manager-automation-runbook-guide-105
|
systems-manager-automation-runbook-guide.pdf
| 105 |
number of nodes that the managed node group should maintain. • NodeGroupMaxSize Type: Integer Default: 0 AWS-UpdateEKSManagedNodeGroup 416 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The maximum number of nodes that the managed node group can scale out to. • NodeGroupMinSize Type: Integer Default: 0 Description: (Optional) The minimum number of nodes that the managed node group can scale in to. • RemoveKubernetesTaintsEffect Type: StringList Description: (Optional) The Kubernetes taints that you want to remove. • RemoveNodeGroupLabels Type: StringList Description: (Optional) A comma-separated list of labels that you want to remove. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • eks:UpdateNodegroupConfig • eks:UpdateNodegroupVersion Document Steps • aws:executeScript - Updates an Amazon EKS cluster node group according to the values that you specify for the runbook input parameters. • aws:waitForAwsResourceProperty - Waits for the cluster update status to be Successful. AWS-UpdateEKSManagedNodeGroup 417 AWS Systems Manager Automation runbook reference User Guide AWS-UpdateEKSSelfManagedLinuxNodeGroups Description The AWS-UpdateEKSSelfManagedLinuxNodeGroups runbook updates self-managed managed node groups in your Amazon Elastic Kubernetes Service (Amazon EKS) cluster using an AWS CloudFormation stack. If your cluster uses auto scaling, we recommend scaling the deployment down to two replicas before using this runbook. To scale a deployment to two replicas 1. Install the Kubernetes command line utility, kubectl. For more information, see Installing kubectl in the Amazon EKS User Guide. 2. Run the following command. kubectl scale deployments/cluster-autoscaler --replicas=2 -n kube-system 3. Run the AWS-UpdateEKSSelfManagedLinuxNodeGroups runbook. 4. Scale the deployment back to the desired number of replicas by running the following command. kubectl scale deployments/cluster-autoscaler --replicas=number -n kube-system Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWS-UpdateEKSSelfManagedLinuxNodeGroups 418 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the Amazon EKS cluster. • NodeGroupName Type: String Description: (Required) The name of the managed node group. • ClusterControlPlaneSecurityGroup Type: String Description: (Required) The ID of the control plane security group. • DisableIMDSv1 Type: Boolean Description: (Optional) Determines whether you want to allow Instance Metadata Service Version 1 (IMDSv1) and IMDSv2. • KeyName Type: String Description: (Optional) The key name for the instances. • NodeAutoScalingGroupDesiredCapacity Type: String Description: (Optional) The number of nodes that the node group should maintain. • NodeAutoScalingGroupMaxSize AWS-UpdateEKSSelfManagedLinuxNodeGroups 419 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The maximum number of nodes that the node group can scale out to. • NodeAutoScalingGroupMinSize Type: String Description: (Optional) The minimum number of nodes that the node group can scale in to. • NodeInstanceType Type: String Default: t3.large Description: (Optional) The instance type that you want to use for the node group. • NodeImageId Type: String Description: (Optional) The ID of the Amazon Machine Image (AMI) that you want the node group to use. • NodeImageIdSSMParam Type: String Default: /aws/service/eks/optimized-ami/1.21/amazon-linux-2/recommended/image_id Description: (Optional) The public Systems Manager parameter for the AMI that you want the node group to use. • StackName Type: String Description: (Required) The name of the AWS CloudFormation stack used to update the node group. • Subnets Type: String AWS-UpdateEKSSelfManagedLinuxNodeGroups 420 AWS Systems Manager Automation runbook reference User Guide Description: (Required) A comma-separated list of the IDs for the subnets that you want your cluster to use. • VpcId Type: String Default: Default Description: (Required) The virtual private cloud (VPC) where your cluster is deployed. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • eks:CreateCluster • eks:CreateNodegroup • eks:DeleteNodegroup • eks:DeleteCluster • eks:DescribeCluster • eks:DescribeNodegroup • eks:ListClusters • eks:ListNodegroups • eks:UpdateClusterConfig • eks:UpdateNodegroupConfig Document Steps • aws:executeScript - Updates an Amazon EKS cluster node group according to the values that you specify for the runbook input parameters. • aws:waitForAwsResourceProperty - Waits for the AWS CloudFormation stack update status to be returned. AWS-UpdateEKSSelfManagedLinuxNodeGroups 421 AWS Systems Manager Automation runbook reference User Guide AWSSupport-SetupK8sApiProxyForEKS Description The AWSSupport-SetupK8sApiProxyForEKS automation runbook provides a way to create an AWS Lambda function that acts as a proxy for making control plane API calls to the Amazon Elastic Kubernetes Service cluster endpoint. It serves as a building block for runbooks which require making control plane API calls for automating tasks and troubleshooting issues with an Amazon EKS cluster. Important All the resources created by this automation are tagged so that they can be easily found. The tags used are: • AWSSupport-SetupK8sApiProxyForEKS: true Note • The automation is a helper runbook and cannot be executed as a standalone runbook. It is invoked as a
|
systems-manager-automation-runbook-guide-106
|
systems-manager-automation-runbook-guide.pdf
| 106 |
runbook provides a way to create an AWS Lambda function that acts as a proxy for making control plane API calls to the Amazon Elastic Kubernetes Service cluster endpoint. It serves as a building block for runbooks which require making control plane API calls for automating tasks and troubleshooting issues with an Amazon EKS cluster. Important All the resources created by this automation are tagged so that they can be easily found. The tags used are: • AWSSupport-SetupK8sApiProxyForEKS: true Note • The automation is a helper runbook and cannot be executed as a standalone runbook. It is invoked as a child automation for runbooks which require control plane API calls to Amazon EKS cluster. • Please ensure to run Cleanup operation after usage to avoid incurring unwanted costs. Document type Automation Owner Amazon Platforms Linux Parameters AWSSupport-SetupK8sApiProxyForEKS 422 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the Amazon Elastic Kubernetes Service cluster. • Operation Type: String Description: (Required) Operation to perform: Setup provisions the Lambda function in the account, Cleanup will de-provision resources created as part of setup phase. Allowed Values: Setup | Cleanup Default: Setup • LambdaRoleArn Type: String Description: (Optional) The ARN of the IAM role that allows the AWS Lambda function to access the required AWS services and resources. If no role is specified, this Systems Manager Automation will create one IAM role for Lambda in your account with the name Automation-K8sProxy-Role-<ExecutionId> that includes the managed policies: AWSLambdaBasicExecutionRole and AWSLambdaVPCAccessExecutionRole. How does it work? The runbook performs the following steps: • Validates that the automation is running as a child execution. The runbook will not work when invoked as a standalone runbook since it does not perform any meaningful work on its own. AWSSupport-SetupK8sApiProxyForEKS 423 AWS Systems Manager Automation runbook reference User Guide • Checks for existing AWS CloudFormation stack for the proxy Lambda function for the specified cluster. • If the stack exists, the existing infrastructure is re-used instead of re-creating it. • A reference counter is maintained using tags to ensure a runbook does not delete the infrastructure if it is being re-used by another runbook for the same cluster. • Perform the operation type (Setup/Cleanup) specified for the invocation: • Setup: Creates or describes existing resources. Cleanup: Removes provisioned resources, if the infrastructure is not being used by any other runbook. Required IAM Permissions The AutomationAssumeRole parameter requires the following permissions given LambdaRoleArn is not passed: • cloudformation:CreateStack • cloudformation:DescribeStacks • cloudformation:DeleteStack • cloudformation:UpdateStack • ec2:CreateNetworkInterface • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcs • ec2:DeleteNetworkInterface • eks:DescribeCluster • lambda:CreateFunction • lambda:DeleteFunction • lambda:ListTags • lambda:GetFunction • lambda:ListTags AWSSupport-SetupK8sApiProxyForEKS 424 AWS Systems Manager Automation runbook reference User Guide • lambda:TagResource • lambda:UntagResource • lambda:UpdateFunctionCode • logs:CreateLogGroup • logs:PutRetentionPolicy • logs:TagResource • logs:UntagResource • logs:DescribeLogGroups • logs:DescribeLogStreams • logs:ListTagsForResource • iam:CreateRole • iam:AttachRolePolicy • iam:DetachRolePolicy • iam:PassRole • iam:GetRole • iam:DeleteRole • iam:TagRole • iam:UntagRole • tag:GetResources • tag:TagResources When LambdaRoleArn is provided, the automation does not need to create the role and the following permissions can be excluded: • iam:CreateRole • iam:DeleteRole • iam:TagRole • iam:UntagRole • iam:AttachRolePolicy • iam:DetachRolePolicy AWSSupport-SetupK8sApiProxyForEKS 425 AWS Systems Manager Automation runbook reference User Guide Below is an example policy demonstrating permissions required for AutomationAssumeRole when LambdaRoleArn is not passed: { "Version": "2012-10-17", "Statement": [ { "Action": [ "tag:GetResources", "tag:TagResources", "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:DescribeRouteTables", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "ec2:DeleteNetworkInterface", "eks:DescribeCluster", "iam:GetRole", "cloudformation:DescribeStacks", "logs:DescribeLogGroups", "logs:DescribeLogStreams", "lambda:GetFunction", "lambda:ListTags", "logs:ListTagsForResource" ], "Resource": "*", "Effect": "Allow", "Sid": "AllowActionsWithoutConditions" }, { "Condition": { "StringEquals": { "aws:RequestTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": "iam:CreateRole", "Resource": [ "arn:<partition>:iam:::<account-id>::role/Automation-K8sProxy*" ], "Effect": "Allow", "Sid": "AllowCreateRoleWithRequiredTag" }, AWSSupport-SetupK8sApiProxyForEKS 426 AWS Systems Manager Automation runbook reference User Guide { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "iam:DeleteRole", "iam:TagRole", "iam:UntagRole" ], "Resource": [ "arn:<partition>:iam:::<account-id>::role/Automation-K8sProxy*" ], "Effect": "Allow", "Sid": "IAMActions" }, { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" }, "StringLike": { "iam:PolicyARN": [ "arn:<partition>:iam::<partition>:policy/service-role/ AWSLambdaBasicExecutionRole", "arn:<partition>:iam::<partition>:policy/service-role/ AWSLambdaVPCAccessExecutionRole" ] } }, "Action": [ "iam:AttachRolePolicy", "iam:DetachRolePolicy" ], "Resource": [ "arn:<partition>:iam:::<account-id>::role/Automation-K8sProxy*" ], "Effect": "Allow", "Sid": "AttachRolePolicy" }, { "Condition": { "StringEquals": { AWSSupport-SetupK8sApiProxyForEKS 427 AWS Systems Manager Automation runbook reference User Guide "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:TagResource", "lambda:UntagResource", "lambda:UpdateFunctionCode" ], "Resource": "arn:<partition>:lambda::<region-id>:::<account- id>::function:Automation-K8sProxy*", "Effect": "Allow", "Sid": "LambdaActions" }, { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:UpdateStack" ], "Resource": "arn:<partition>:cloudformation::<region-id>:::<account-id>::stack/ AWSSupport-SetupK8sApiProxyForEKS*", "Effect": "Allow", "Sid": "CloudFormationActions" }, { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", "logs:PutRetentionPolicy", "logs:TagResource", "logs:UntagResource" AWSSupport-SetupK8sApiProxyForEKS 428 AWS
|
systems-manager-automation-runbook-guide-107
|
systems-manager-automation-runbook-guide.pdf
| 107 |
[ "arn:<partition>:iam::<partition>:policy/service-role/ AWSLambdaBasicExecutionRole", "arn:<partition>:iam::<partition>:policy/service-role/ AWSLambdaVPCAccessExecutionRole" ] } }, "Action": [ "iam:AttachRolePolicy", "iam:DetachRolePolicy" ], "Resource": [ "arn:<partition>:iam:::<account-id>::role/Automation-K8sProxy*" ], "Effect": "Allow", "Sid": "AttachRolePolicy" }, { "Condition": { "StringEquals": { AWSSupport-SetupK8sApiProxyForEKS 427 AWS Systems Manager Automation runbook reference User Guide "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:TagResource", "lambda:UntagResource", "lambda:UpdateFunctionCode" ], "Resource": "arn:<partition>:lambda::<region-id>:::<account- id>::function:Automation-K8sProxy*", "Effect": "Allow", "Sid": "LambdaActions" }, { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:UpdateStack" ], "Resource": "arn:<partition>:cloudformation::<region-id>:::<account-id>::stack/ AWSSupport-SetupK8sApiProxyForEKS*", "Effect": "Allow", "Sid": "CloudFormationActions" }, { "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } }, "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", "logs:PutRetentionPolicy", "logs:TagResource", "logs:UntagResource" AWSSupport-SetupK8sApiProxyForEKS 428 AWS Systems Manager Automation runbook reference User Guide ], "Resource": [ "arn:<partition>:logs::<region-id>:::<account-id>::log-group:/aws/lambda/ Automation-K8sProxy*", "arn:<partition>:logs::<region-id>:::<account-id>::log-group:/aws/lambda/ Automation-K8sProxy*:*" ], "Effect": "Allow", "Sid": "LogsActions" }, { "Condition": { "StringLikeIfExists": { "iam:PassedToService": "lambda.amazonaws.com" } }, "Action": [ "iam:PassRole" ], "Resource": [ "arn:<partition>:iam:::<account-id>::role/Automation-K8sProxy-Role*" ], "Effect": "Allow", "Sid": "PassRoleToLambda" } ] } In case the LambdaRoleArn is passed, please ensure that it has AWSLambdaBasicExecutionRole policy attached to it for public cluster and additionally, AWSLambdaVPCAccessExecutionRole for private clusters. Resources Created The following resources are created during Setup operation: 1. AWS Lambda function 2. IAM Role: Lambda execution role, if not provided. 3. CloudWatch Log Group (Lambda Logs) AWSSupport-SetupK8sApiProxyForEKS 429 AWS Systems Manager Automation runbook reference User Guide Lambda function and execution role are retained until Cleanup operation is executed. Lambda log group will be retained for 30 days or until manually deleted. Instructions The runbook is a helper utility designed to be executed from within other runbooks as a child automation. It facilitates the creation of infrastructure enabling the parent runbook to make Amazon EKS K8s control plane API calls. In order to use the runbook, you can follow the below steps from the context of the parent automation. 1. Setup Phase: Invoke the automation using aws:executeAutomation action operation from the runbook that would like to make Amazon EKS K8s control plane API calls with operation set to Setup. Example of input parameters: { "AutomationAssumeRole": "<role-arn>", "ClusterName": "<eks-cluster-name>", "Operation": "Setup" } The output of the aws:executeAutomation step will contain the ARN of the proxy Lambda function. 2. Using the Lambda Proxy: Invoke the Lambda function inside the aws:executeScript action using boto3's Lambda.Client.invoke(...) with a list of API call paths and bearer token. The Lambda function will perform HTTP GET calls to the specified path by passing the bearer token as part of authorization header. Example of Lambda invoke event: { "ApiCalls": ["/api/v1/pods/", ...], "BearerToken": "..." } AWSSupport-SetupK8sApiProxyForEKS 430 AWS Systems Manager Automation runbook reference User Guide Note The bearer token has to be generated as part of the parent automation script. You need to ensure the principal executing the parent runbook has read-only permission to the specified Amazon EKS cluster. 3. Cleanup Phase: Invoke the automation using aws:executeAutomation action operation from the runbook that would like to make Amazon EKS K8s control plane API calls with operation set to Cleanup. Example of input parameters: { "AutomationAssumeRole": "<role-arn>", "ClusterName": "<eks-cluster-name>", "Operation": "Cleanup" } Automation Steps 1. ValidateExecution • Verifies that the automation is not running as a standalone execution. 2. CheckForExistingStack • Checks if a AWS CloudFormation stack was already provisioned for the specified cluster name. • Returns stack existence status and whether it's safe to delete. 3. BranchOnIsStackExists • Decision step that branches based on stack existence. • Routes to either update existing stack name or proceed with operation branching. 4. UpdateStackName • Updates the StackName variable with the existing stack's name. • Only executed if stack already exists. 5. BranchOnOperation • Routes the automation based on the Operation parameter (Setup /Cleanup). • For Setup: Routes to either create new stack or describe existing resources. AWSSupport-SetupK8sApiProxyForEKS 431 AWS Systems Manager Automation runbook reference User Guide • For Cleanup: Proceeds to stack deletion if safe to delete. 6. GetClusterNetworkConfig • Describes the Amazon EKS cluster to obtain VPC configuration. • Retrieves endpoint, VPC ID, subnet IDs, security group ID, and CA data. 7. ProvisionResources • Creates a AWS CloudFormation stack with required resources. • Provisions Lambda function with necessary networking configuration. • Tags all resources for tracking and management. 8. DescribeStackResources • Retrieves information about the created/existing stack. • Gets the ARN of the provisioned Lambda function. 9. BranchOnIsLambdaDeploymentRequired • Determines if Lambda code deployment is needed. • Only proceeds to deployment for newly created stacks. 10.DeployLambdaFunctionCode • Deploys the Lambda function code using the deployment package. • Updates the function with the proxy implementation. 11.AssertLambdaAvailable • Verifies that the Lambda function code update was successful. • Waits for the function to be in Successful state. 12.PerformStackCleanup • Deletes the AWS CloudFormation stack and associated resources. • Executed during Cleanup operation or on failure of Setup operation. Outputs LambdaFunctionArn: ARN of the proxy Lambda function References Systems Manager Automation • Run an automation AWSSupport-SetupK8sApiProxyForEKS 432 AWS Systems Manager Automation runbook
|
systems-manager-automation-runbook-guide-108
|
systems-manager-automation-runbook-guide.pdf
| 108 |
Determines if Lambda code deployment is needed. • Only proceeds to deployment for newly created stacks. 10.DeployLambdaFunctionCode • Deploys the Lambda function code using the deployment package. • Updates the function with the proxy implementation. 11.AssertLambdaAvailable • Verifies that the Lambda function code update was successful. • Waits for the function to be in Successful state. 12.PerformStackCleanup • Deletes the AWS CloudFormation stack and associated resources. • Executed during Cleanup operation or on failure of Setup operation. Outputs LambdaFunctionArn: ARN of the proxy Lambda function References Systems Manager Automation • Run an automation AWSSupport-SetupK8sApiProxyForEKS 432 AWS Systems Manager Automation runbook reference User Guide • Setting up an Automation • Support Automation Workflows AWSSupport-TroubleshootEbsCsiDriversForEks Description The AWSSupport-TroubleshootEbsCsiDriversForEks runbook helps troubleshoot issues with Amazon Elastic Block Store volume mounts in Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon EBS Container Storage Interface (CSI) driver issues Important Currently the Amazon EBS CSI Driver running on AWS Fargate is not supported. How does it work? The runbook AWSSupport-TroubleshootEbsCsiDriversForEks performs the following high- level steps: • Verifies if the target Amazon EKS cluster exists and is in active state. • Deploys necessary authentication resources for making Kubernetes API calls based on whether the addon is Amazon EKS-managed or self-managed. • Performs Amazon EBS CSI controller health checks and diagnostics. • Runs IAM permissions checks on node roles and service account roles. • Diagnoses persistent volume creation issues for the specified application pod. • Checks node-to-pod scheduling and examines pod events. • Collects relevant Kubernetes and application logs, uploading them to the specified Amazon S3 bucket. • Performs node health checks and verifies connectivity with Amazon EC2 endpoints. • Reviews persistent volume block device attachments and mounting status. • Cleans up the authentication infrastructure created during troubleshooting. • Generates a comprehensive troubleshooting report combining all diagnostic results. AWSSupport-TroubleshootEbsCsiDriversForEks 433 AWS Systems Manager Automation runbook reference User Guide Note • The Amazon EKS cluster's authentication mode must be set to either API or API_AND_CONFIG_MAP. We recommend using Amazon EKS Access entry. The runbook requires Kubernetes Role-based access control (RBAC) permissions to perform the necessary API calls. • If you don't specify an IAM role for the Lambda function (LambdaRoleArn parameter), the automation creates a role named Automation-K8sProxy- Role-<ExecutionId> in your account. This role includes the managed policies AWSLambdaBasicExecutionRole and AWSLambdaVPCAccessExecutionRole. • Some diagnostic steps require the Amazon EKS worker nodes to be Systems Manager managed instances. If the nodes aren't Systems Manager managed instances, steps that require Systems Manager access are skipped, but other checks continue. • The automation includes a cleanup step that removes authentication infrastructure resources. This cleanup step runs even when previous steps fail, which helps prevent orphaned resources in your AWS account. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeIamInstanceProfileAssociations AWSSupport-TroubleshootEbsCsiDriversForEks 434 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeInstanceStatus • ec2:GetEbsEncryptionByDefault • eks:DescribeAddon • eks:DescribeAddonVersions • eks:DescribeCluster • iam:GetInstanceProfile • iam:GetOpenIDConnectProvider • iam:GetRole • iam:ListOpenIDConnectProviders • iam:SimulatePrincipalPolicy • s3:GetBucketLocation • s3:GetBucketPolicyStatus • s3:GetBucketPublicAccessBlock • s3:GetBucketVersioning • s3:ListBucket • s3:ListBucketVersions • ssm:DescribeInstanceInformation • ssm:GetAutomationExecution • ssm:GetDocument • ssm:ListCommandInvocations • ssm:ListCommands • ssm:SendCommand • ssm:StartAutomationExecution Instructions Follow these steps to configure the automation: 1. Create a SSM automation role TroubleshootEbsCsiDriversForEks-SSM-Role in your account. Verify that the trust relationship contains the following policy. AWSSupport-TroubleshootEbsCsiDriversForEks 435 AWS Systems Manager Automation runbook reference User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } 2. Attach the policy below to the IAM role to grant the required permissions to perform the specified actions on the specified resources. • If you are expecting to upload execution and resources logs to Amazon S3 bucket in same AWS region, replace arn:{partition}:s3:::BUCKET_NAME/* as yours in OptionalRestrictPutObjects. • The Amazon S3 bucket should point to the correct Amazon S3 bucket if you will select S3BucketName in SSM execution. • This permission is optional if you don't specify S3BucketName • The Amazon S3 bucket must be private and in the same AWS region where you execute the SSM automation. { "Version": "2012-10-17", "Statement": [ { "Sid": "OptionalRestrictPutObjects", "Effect": "Allow", "Action": ["s3:PutObject"], "Resource": ["arn:{partition}:s3:::BUCKET_NAME/*"] }, { "Effect": "Allow", "Action": [ "ec2:DescribeIamInstanceProfileAssociations", "ec2:DescribeInstanceStatus", "ec2:GetEbsEncryptionByDefault", AWSSupport-TroubleshootEbsCsiDriversForEks 436 AWS Systems Manager Automation runbook reference User Guide "eks:DescribeAddon", "eks:DescribeAddonVersions", "eks:DescribeCluster", "iam:GetInstanceProfile", "iam:GetOpenIDConnectProvider", "iam:GetRole", "iam:ListOpenIDConnectProviders", "iam:SimulatePrincipalPolicy", "s3:GetBucketLocation", "s3:GetBucketPolicyStatus", "s3:GetBucketPublicAccessBlock", "s3:GetBucketVersioning", "s3:ListBucket", "s3:ListBucketVersions", "ssm:DescribeInstanceInformation", "ssm:GetAutomationExecution", "ssm:GetDocument", "ssm:ListCommandInvocations", "ssm:ListCommands", "ssm:SendCommand", "ssm:StartAutomationExecution" ], "Resource": "*" }, { "Sid": "SetupK8sApiProxyForEKSActions", "Effect": "Allow", "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "cloudformation:UpdateStack", "ec2:CreateNetworkInterface", "ec2:DeleteNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:DescribeRouteTables", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "eks:DescribeCluster", "iam:CreateRole", "iam:DeleteRole", "iam:GetRole", "iam:TagRole", AWSSupport-TroubleshootEbsCsiDriversForEks 437 AWS Systems Manager Automation runbook reference User Guide "iam:UntagRole", "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:GetFunction", "lambda:InvokeFunction", "lambda:ListTags", "lambda:TagResource", "lambda:UntagResource", "lambda:UpdateFunctionCode", "logs:CreateLogGroup", "logs:CreateLogStream", "logs:DescribeLogGroups", "logs:DescribeLogStreams", "logs:ListTagsForResource", "logs:PutLogEvents", "logs:PutRetentionPolicy", "logs:TagResource", "logs:UntagResource", "ssm:DescribeAutomationExecutions", "tag:GetResources",
|
systems-manager-automation-runbook-guide-109
|
systems-manager-automation-runbook-guide.pdf
| 109 |
["s3:PutObject"], "Resource": ["arn:{partition}:s3:::BUCKET_NAME/*"] }, { "Effect": "Allow", "Action": [ "ec2:DescribeIamInstanceProfileAssociations", "ec2:DescribeInstanceStatus", "ec2:GetEbsEncryptionByDefault", AWSSupport-TroubleshootEbsCsiDriversForEks 436 AWS Systems Manager Automation runbook reference User Guide "eks:DescribeAddon", "eks:DescribeAddonVersions", "eks:DescribeCluster", "iam:GetInstanceProfile", "iam:GetOpenIDConnectProvider", "iam:GetRole", "iam:ListOpenIDConnectProviders", "iam:SimulatePrincipalPolicy", "s3:GetBucketLocation", "s3:GetBucketPolicyStatus", "s3:GetBucketPublicAccessBlock", "s3:GetBucketVersioning", "s3:ListBucket", "s3:ListBucketVersions", "ssm:DescribeInstanceInformation", "ssm:GetAutomationExecution", "ssm:GetDocument", "ssm:ListCommandInvocations", "ssm:ListCommands", "ssm:SendCommand", "ssm:StartAutomationExecution" ], "Resource": "*" }, { "Sid": "SetupK8sApiProxyForEKSActions", "Effect": "Allow", "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "cloudformation:UpdateStack", "ec2:CreateNetworkInterface", "ec2:DeleteNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:DescribeRouteTables", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "eks:DescribeCluster", "iam:CreateRole", "iam:DeleteRole", "iam:GetRole", "iam:TagRole", AWSSupport-TroubleshootEbsCsiDriversForEks 437 AWS Systems Manager Automation runbook reference User Guide "iam:UntagRole", "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:GetFunction", "lambda:InvokeFunction", "lambda:ListTags", "lambda:TagResource", "lambda:UntagResource", "lambda:UpdateFunctionCode", "logs:CreateLogGroup", "logs:CreateLogStream", "logs:DescribeLogGroups", "logs:DescribeLogStreams", "logs:ListTagsForResource", "logs:PutLogEvents", "logs:PutRetentionPolicy", "logs:TagResource", "logs:UntagResource", "ssm:DescribeAutomationExecutions", "tag:GetResources", "tag:TagResources" ], "Resource": "*" }, { "Sid": "PassRoleToAutomation", "Effect": "Allow", "Action": "iam:PassRole", "Resource": [ "arn:*:iam::*:role/TroubleshootEbsCsiDriversForEks-SSM-Role", "arn:*:iam::*:role/Automation-K8sProxy-Role-*" ], "Condition": { "StringLikeIfExists": { "iam:PassedToService": [ "lambda.amazonaws.com", "ssm.amazonaws.com" ] } } }, { "Sid": "AttachRolePolicy", "Effect": "Allow", AWSSupport-TroubleshootEbsCsiDriversForEks 438 AWS Systems Manager Automation runbook reference User Guide "Action": [ "iam:AttachRolePolicy", "iam:DetachRolePolicy" ], "Resource": "*", "Condition": { "StringLikeIfExists": { "iam:ResourceTag/AWSSupport-SetupK8sApiProxyForEKS": "true" } } } ] } 3. Grant the required permissions for Amazon EKS cluster RBAC (Role-Based Access Control). The recommended approach is to create an Access Entry in your Amazon EKS cluster. In the Amazon EKS console, navigate to your cluster. For Amazon EKS access entries, verify your access configuration is set to API_AND_CONFIG_MAP or API. For steps to configure authentication mode for access entries, see Setting up access entries. Choose Create access entry. • For IAM principal ARN, select the IAM role you created for SSM automation in the previous step. • For Type, select Standard. 4. Add an access policy: • For Access scope, select Cluster. • For Policy name, select AmazonEKSAdminViewPolicy. Choose Add policy. If you are not using access entries to manage Kubernetes API permissions, you must update the aws-auth ConfigMap and create a role binding between your IAM user or role. Ensure your IAM entity has the following read-only Kubernetes API permissions: • GET /apis/apps/v1/namespaces/{namespace}/deployments/{name} • GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name} • GET /apis/apps/v1/namespaces/{namespace}/daemonsets/{name} • GET /api/v1/nodes/{name} AWSSupport-TroubleshootEbsCsiDriversForEks 439 AWS Systems Manager Automation runbook reference User Guide • GET /api/v1/namespaces/{namespace}/serviceaccounts/{name} • GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} • GET /api/v1/persistentvolumes/{name} • GET /apis/storage.k8s.io/v1/storageclasses/{name} • GET /api/v1/namespaces/{namespace}/pods/{name} • GET /api/v1/namespaces/{namespace}/pods • GET /api/v1/namespaces/{namespace}/pods/{name}/log • GET /api/v1/events 5. Run the automation AWSSupport-TroubleshootEbsCsiDriversForEks (console) 6. Select Execute automation. 7. For the input parameters, enter the following: • AutomationAssumeRole (Optional): • Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows SSM Automation to perform the actions on your behalf. The role needs to be added to your Amazon EKS cluster access entry or RBAC permission to allow Kubernetes API calls. • Type: AWS::IAM::Role::Arn • Example: TroubleshootEbsCsiDriversForEks-SSM-Role • EksClusterName: • Description: The name of the target Amazon Elastic Kubernetes Service (Amazon EKS) cluster. • Type: String • ApplicationPodName: • Description: The name of the Kubernetes application pod having issues with the Amazon EBS CSI driver. • Type: String • ApplicationNamespace: • Description: The Kubernetes namespace for the application pod having issues with the Amazon EBS CSI driver. • Type: String AWSSupport-TroubleshootEbsCsiDriversForEks • EbsCsiControllerDeploymentName (Optional): 440 AWS Systems Manager Automation runbook reference User Guide • Description: (Optional) The deployment name for the Amazon EBS CSI controller pod. • Type: String • Default: ebs-csi-controller • EbsCsiControllerNamespace (Optional): • Description: (Optional) The Kubernetes namespace for the Amazon EBS CSI controller pod. • Type: String • Default: kube-system • S3BucketName (Optional): • Description: (Optional) The target Amazon S3 bucket name where the troubleshooting logs will be uploaded. • Type: AWS::S3::Bucket::Name • LambdaRoleArn (Optional): • Description: (Optional) The ARN of the IAM role that allows the AWS Lambda function to access the required AWS services and resources. • Type: AWS::IAM::Role::Arn Select Execute. 8. After completed, review the Outputs section for the detailed results of the execution. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows For more information on Amazon EBS CSI Driver, see Amazon EBS CSI Driver. AWSSupport-TroubleshootEbsCsiDriversForEks 441 AWS Systems Manager Automation runbook reference User Guide Elastic Beanstalk AWS Systems Manager Automation provides predefined runbooks for AWS Elastic Beanstalk. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-CollectElasticBeanstalkLogs • AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming • AWSConfigRemediation-EnableBeanstalkEnvironmentNotifications • AWSSupport-TroubleshootElasticBeanstalk AWSSupport-CollectElasticBeanstalkLogs Description The AWSSupport-CollectElasticBeanstalkLogs runbook gathers AWS Elastic Beanstalk related log files from an Amazon Elastic Compute Cloud (Amazon EC2) Windows Server instance launched by Elastic Beanstalk to help you troubleshoot common issues. While the automation is gathering the associated log files, changes are made to the file system structure including the creation of temporary directories, the copying of log files to the temporary directories, and compressing the log files into an archive. This activity can result in increased CPUUtilization on the Amazon EC2 instance. For more information about CPUUtilization , see
|
systems-manager-automation-runbook-guide-110
|
systems-manager-automation-runbook-guide.pdf
| 110 |
• AWSSupport-CollectElasticBeanstalkLogs • AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming • AWSConfigRemediation-EnableBeanstalkEnvironmentNotifications • AWSSupport-TroubleshootElasticBeanstalk AWSSupport-CollectElasticBeanstalkLogs Description The AWSSupport-CollectElasticBeanstalkLogs runbook gathers AWS Elastic Beanstalk related log files from an Amazon Elastic Compute Cloud (Amazon EC2) Windows Server instance launched by Elastic Beanstalk to help you troubleshoot common issues. While the automation is gathering the associated log files, changes are made to the file system structure including the creation of temporary directories, the copying of log files to the temporary directories, and compressing the log files into an archive. This activity can result in increased CPUUtilization on the Amazon EC2 instance. For more information about CPUUtilization , see Instance metrics in the Amazon CloudWatch User Guide . If you specify a value for the S3BucketName parameter, the automation evaluates the policy status of the Amazon Simple Storage Service (Amazon S3) bucket you specify. To help with the security of the logs gathered from your Amazon EC2 instance, if the policy status isPublic is set to true , or if the access control list (ACL) grants READ|WRITE permissions to the All Users Amazon S3 predefined group, the logs are not uploaded. For more information about Amazon S3 predefined groups, see Amazon S3 predefined groups in the Amazon Simple Storage Service User Guide . If you do not specify a value for the S3BucketName parameter, the automation uploads the log bundle to the default Elastic Beanstalk Amazon S3 bucket in the AWS Region where you run the automation. The directory is named according to the following structure, elasticbeanstalk- Elastic Beanstalk 442 AWS Systems Manager Automation runbook reference User Guide region - accountID . The region and accountID values will differ based on the Region and AWS account you run the automation in. The log bundle will be saved to the resources/environments/logs/bundle/ environmentID / instanceID directory. The environmentID and instanceID values will differ based on your Elastic Beanstalk environment and the Amazon EC2 instance you're gathering logs from. By default, the AWS Identity and Access Management (IAM) instance profile attached to the Amazon EC2 instances of the Elastic Beanstalk environment has the required permissions to upload the bundle to the default Elastic Beanstalk Amazon S3 bucket for your environment. If you specify a value for the S3BucketName parameter, the instance profile attached to the Amazon EC2 instance must allow the s3:GetBucketAcl , s3:GetBucketPolicy , s3:GetBucketPolicyStatus , and s3:PutObject actions for the specified Amazon S3 bucket and path. Note This automation requires at least 500 MB of available disk space on the root Amazon Elastic Block Store (Amazon EBS) volume attached to your Amazon EC2 instance. If there is not enough available disk space on the root volume, the automation stops. Run this Automation (console) Document type Automation Owner Amazon Platforms Windows Parameters • AutomationAssumeRole Type: String AWSSupport-CollectElasticBeanstalkLogs 443 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EnvironmentId Type: String Description: (Required) The ID of your Elastic Beanstalk environment you want to collect the log bundle from. • InstanceId Type: String (Required) The ID of the Amazon EC2 instance in your Elastic Beanstalk environment you want to collect the log bundle from. • S3BucketName Type: String (Optional) The Amazon S3 bucket you want to upload the archived logs to. • S3BucketPath Type: String (Optional) The Amazon S3 bucket path you want to upload the log bundle to. This parameter is ignored if you do not specify a value for the S3BucketName parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ssm:SendCommand • ssm:DescribeInstanceInformation AWSSupport-CollectElasticBeanstalkLogs 444 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeInstances Document Steps • aws:assertAwsResourceProperty - Confirms the Amazon EC2 instance you specify in the InstanceId parameter is managed by AWS Systems Manager. • aws:assertAwsResourceProperty - Confirms the Amazon EC2 instance you specify in the InstanceId parameter is a Windows Server instance. • aws:runCommand - Checks whether the instance is part of an Elastic Beanstalk environment, if there is sufficient disk space to bundle the logs, and whether the Amazon S3 bucket to which the logs would be uploaded to is public. • aws:runCommand - Collects the log files and uploads the archive to the Amazon S3 bucket specified in the S3BucketName parameter or to the default bucket for your Elastic Beanstalk environment if a value is not specified. AWSConfigRemediation- EnableElasticBeanstalkEnvironmentLogStreaming Description The AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming runbook enables logging on the AWS Elastic Beanstalk (Elastic Beanstalk) environment you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming 445 AWS Systems Manager Automation
|
systems-manager-automation-runbook-guide-111
|
systems-manager-automation-runbook-guide.pdf
| 111 |
sufficient disk space to bundle the logs, and whether the Amazon S3 bucket to which the logs would be uploaded to is public. • aws:runCommand - Collects the log files and uploads the archive to the Amazon S3 bucket specified in the S3BucketName parameter or to the default bucket for your Elastic Beanstalk environment if a value is not specified. AWSConfigRemediation- EnableElasticBeanstalkEnvironmentLogStreaming Description The AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming runbook enables logging on the AWS Elastic Beanstalk (Elastic Beanstalk) environment you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSConfigRemediation-EnableElasticBeanstalkEnvironmentLogStreaming 445 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • EnvironmentId Type: String Description: (Required) The ID of the Elastic Beanstalk environment that you want to enable logging on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticbeanstalk:DescribeConfigurationSettings • elasticbeanstalk:DescribeEnvironments • elasticbeanstalk:UpdateEnvironment Document Steps • aws:executeAwsApi - Enables logging on the Elastic Beanstalk environment you specify in the EnvironmentId parameter. • aws:waitForAwsResourceProperty - Waits for the status of the environment to change to Ready . • aws:executeScript - Verifies logging has been enabled on the Elastic Beanstalk environment. AWSConfigRemediation- EnableBeanstalkEnvironmentNotifications Description AWSConfigRemediation-EnableBeanstalkEnvironmentNotifications 446 AWS Systems Manager Automation runbook reference User Guide The AWSConfigRemediation-EnableBeanstalkEnvironmentNotifications runbook enables notifications for the AWS Elastic Beanstalk (Elastic Beanstalk) environment you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • EnvironmentId Type: String Description: (Required) The ID of the Elastic Beanstalk environment that you want to enable notifications for. • TopicArn Type: String Description: (Required) The ARN of the Amazon Simple Notification Service (Amazon SNS) topic you want to send notifications to. Required IAM permissions AWSConfigRemediation-EnableBeanstalkEnvironmentNotifications 447 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticbeanstalk:DescribeConfigurationSettings • elasticbeanstalk:DescribeEnvironments • elasticbeanstalk:UpdateEnvironment Document Steps • aws:executeAwsApi - Enables notifications for the Elastic Beanstalk environment you specify in the EnvironmentId parameter. • aws:waitForAwsResourceProperty - Waits for the status of the environment to change to Ready . • aws:executeScript - Verifies notifications have been enabled for the Elastic Beanstalk environment. AWSSupport-TroubleshootElasticBeanstalk Description The AWSSupport-TroubleshootElasticBeanstalk runbook helps you troubleshoot the potential reasons why your AWS Elastic Beanstalk environment is in a Degraded or Severe state. This automation checks the following AWS resources associated with your Elastic Beanstalk environment: • Configuration details for a load balancer, AWS CloudFormation stack, Amazon EC2 Auto Scaling group, Amazon Elastic Compute Cloud (Amazon EC2) instances, and virtual private cloud (VPC). • Network configuration issues with the associated security group rules, route tables, and network access control lists (ACLs) associated with your subnets. • Verifies connectivity to the Elastic Beanstalk endpoints and public internet access. • Verifies the status of the load balancer. • Verifies the status of the Amazon EC2 instances. AWSSupport-TroubleshootElasticBeanstalk 448 AWS Systems Manager Automation runbook reference User Guide • Retrieves a log bundle from your Elastic Beanstalk environment, and optionally uploads the files to Support. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ApplicationName Type: String Description: (Required) The name of your Elastic Beanstalk application. • EnvironmentName Type: String Description: (Required) The name of your Elastic Beanstalk environment. • AWSS3UploaderLink Type: String AWSSupport-TroubleshootElasticBeanstalk 449 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) A URL provided to you by Support to upload the log bundle from your Elastic Beanstalk environment to. This option is only available to customers who have purchased an Support plan, and have opened a Support case. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • autoscaling:Describe* • cloudformation:Describe* • cloudformation:Estimate* • cloudformation:Get* • cloudformation:List* • cloudformation:Validate* • cloudwatch:Describe* • cloudwatch:Get* • cloudwatch:List* • ec2:Describe* • elasticbeanstalk:Check* • elasticbeanstalk:Describe* • elasticbeanstalk:List* • elasticbeanstalk:RetrieveEnvironmentInfo* • elasticbeanstalk:RequestEnvironmentInfo* • elasticloadbalancing:Describe* • rds:Describe* • s3:Get* • s3:List* • sns:Get* • sns:List* Document Steps AWSSupport-TroubleshootElasticBeanstalk 450 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Verifies the AWS Identity and Access Management (IAM) principal who started the automation has the requisite permissions to perform all
|
systems-manager-automation-runbook-guide-112
|
systems-manager-automation-runbook-guide.pdf
| 112 |
Support plan, and have opened a Support case. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • autoscaling:Describe* • cloudformation:Describe* • cloudformation:Estimate* • cloudformation:Get* • cloudformation:List* • cloudformation:Validate* • cloudwatch:Describe* • cloudwatch:Get* • cloudwatch:List* • ec2:Describe* • elasticbeanstalk:Check* • elasticbeanstalk:Describe* • elasticbeanstalk:List* • elasticbeanstalk:RetrieveEnvironmentInfo* • elasticbeanstalk:RequestEnvironmentInfo* • elasticloadbalancing:Describe* • rds:Describe* • s3:Get* • s3:List* • sns:Get* • sns:List* Document Steps AWSSupport-TroubleshootElasticBeanstalk 450 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Verifies the AWS Identity and Access Management (IAM) principal who started the automation has the requisite permissions to perform all of the actions defined in the runbook. • aws:branch - Branches the workflow based on the results of the previous step. • aws:executeScript - Collects information about the Elastic Beanstalk environment including the load balancer, AWS CloudFormation stack, Auto Scaling group, Amazon EC2 instances, and VPC configuration. • aws:executeScript - Checks for network connectivity issues with the route tables and ACLs associated with the subnets in your VPC. • aws:executeScript - Checks for network connectivity issues with the security group rules associated with your Amazon EC2 instances. • aws:executeScript - Verifies the status checks for the Amazon EC2 instances. • aws:executeScript - Generates a link for a log bundle of your Elastic Beanstalk environment. • aws:executeScript - Uploads log bundle to Support. • aws:executeScript - Outputs a report of action items to help you troubleshoot issues that might be affecting the status of your Elastic Beanstalk environment. Elastic Load Balancing AWS Systems Manager Automation provides predefined runbooks for Elastic Load Balancing. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-DropInvalidHeadersForALB • AWS-EnableCLBAccessLogs • AWS-EnableCLBConnectionDraining • AWSConfigRemediation-EnableCLBCrossZoneLoadBalancing • AWSConfigRemediation-EnableELBDeletionProtection • AWSConfigRemediation-EnableLoggingForALBAndCLB • AWSSupport-TroubleshootCLBConnectivity • AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing • AWS-UpdateALBDesyncMitigationMode Elastic Load Balancing 451 AWS Systems Manager Automation runbook reference User Guide • AWS-UpdateCLBDesyncMitigationMode AWSConfigRemediation-DropInvalidHeadersForALB Description The AWSConfigRemediation-DropInvalidHeadersForALB runbook enables the application load balancer you specify to remove HTTP headers with invalid headers. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LoadBalancerArn Type: String Description: (Required) The Amazon Resource Name (ARN) of the load balancer that you want to drop invalid headers. Required IAM permissions AWSConfigRemediation-DropInvalidHeadersForALB 452 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • aws:executeAwsApi - Enables the drop invalid headers setting for the load balancer you specify in the LoadBalancerArn parameter. • aws:executeScript - Verifies the drop invalid headers setting has been enabled on the load balancer you specify in the LoadBalancerArn parameter. AWS-EnableCLBAccessLogs Description The AWS-EnableCLBAccessLogs runbook enables access logs for a Classic Load Balancer. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWS-EnableCLBAccessLogs 453 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EmitInterval Type: Integer Valid values: 5 | 60 Default: 60 Description: (Optional) The interval for publishing the access logs in minutes. • LoadBalancerNames Type: String Description: (Required) A comma separated list of Classic Load Balancers you want to enable access logs for. • S3BucketName Type: String Description: (Required) The name of the Amazon Simple Storage Service (Amazon S3) bucket where the access logs are stored. • S3BucketPrefix Type: String Description: (Optional) The logical hierarchy you created for your Amazon S3 bucket, for example my-bucket-prefix/prod. If the prefix is not provided, the log is placed at the root level of the bucket. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWS-EnableCLBAccessLogs 454 AWS Systems Manager Automation runbook reference User Guide • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • aws:executeAwsApi - Enables access logs for the Classic Load Balancers you specify in the LoadBalancerNames parameter. Outputs EnableCLBAccessLogs.SuccessesLoadBalancers - List of load balancer names where access logs were successfully enabled. EnableCLBAccessLogs.FailedLoadBalancers - MapList of load balancer names where enabling access logs failed and the reason for the failure. AWS-EnableCLBConnectionDraining Description The AWS-EnableCLBConnectionDraining runbook enables connection draining on a Classic Load Balancer (CLB) to the specified timeout value. Connection drainings enables the CLB to complete in-flight requests made to instances that are deregistering or unhealthy with the specified timeout being the time it keeps connections alive before reporting the instance as deregistered. For more
|
systems-manager-automation-runbook-guide-113
|
systems-manager-automation-runbook-guide.pdf
| 113 |
access logs for the Classic Load Balancers you specify in the LoadBalancerNames parameter. Outputs EnableCLBAccessLogs.SuccessesLoadBalancers - List of load balancer names where access logs were successfully enabled. EnableCLBAccessLogs.FailedLoadBalancers - MapList of load balancer names where enabling access logs failed and the reason for the failure. AWS-EnableCLBConnectionDraining Description The AWS-EnableCLBConnectionDraining runbook enables connection draining on a Classic Load Balancer (CLB) to the specified timeout value. Connection drainings enables the CLB to complete in-flight requests made to instances that are deregistering or unhealthy with the specified timeout being the time it keeps connections alive before reporting the instance as deregistered. For more information about connection draining on CLBs, see Configure connection draining for your Classic Load Balancer in the User Guide for Classic Load Balancers. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWS-EnableCLBConnectionDraining 455 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LoadBalancerName Type: String Description: (Required) The name of the load balancer you want to enable connection draining on. • ConnectionTimeout Type: Integer Valid values: 1-3600 Default: 300 Description: (Required) The connection timeout value for the load balancer. The timeout value can be set between 1 and 3600 seconds. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • ModifyLoadBalancerConnectionDraining (aws:executeAwsApi): Enables connection draining and sets the specified timeout value for the load balancer you specify. AWS-EnableCLBConnectionDraining 456 AWS Systems Manager Automation runbook reference User Guide • VerifyLoadBalancerConnectionDrainingEnabled (aws:assertAwsResourceProperty): Verifies that connection draining is enabled for the load balancer. • VerifyLoadBalancerConnectionDrainingTimeout (aws:assertAwsResourceProperty): Verifies that the connection timeout value for the load balancer matches the value you specified. AWSConfigRemediation-EnableCLBCrossZoneLoadBalancing Description The AWSConfigRemediation-EnableCLBCrossZoneLoadBalancing runbook enables cross- zone load balancing for the Classic Load Balancer (CLB) you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LoadBalancerName Type: String Description: (Required) The name of the CLB that you want to enable cross-zone load balancing on. AWSConfigRemediation-EnableCLBCrossZoneLoadBalancing 457 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elb:DescribeLoadBalancerAttributes • elb:ModifyLoadBalancerAttributes Document Steps • aws:executeAwsApi - Enables cross-zone load balancing for the CLB you specify in the LoadBalancerName parameter. • aws:assertAwsResourceProperty - Verifies cross-zone load balancing has been enabled on the CLB. AWSConfigRemediation-EnableELBDeletionProtection Description The AWSConfigRemediation-EnableELBDeletionProtection runbook enables deletion protection for the elastic load balancer (ELB) you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWSConfigRemediation-EnableELBDeletionProtection 458 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LoadBalancerArn Type: String Description: (Required) The Amazon Resource Name (ARN) of the ELB that you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:DescribeLoadBalancers • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • aws:executeScript - Enables deletion protection on the ELB you specify in the LoadBalancerArn parameter. AWSConfigRemediation-EnableLoggingForALBAndCLB Description The AWSConfigRemediation-EnableLoggingForALBAndCLB runbook enables logging for the specified AWS Application Load Balancer or a Classic Load Balancer (CLB). Run this Automation (console) AWSConfigRemediation-EnableLoggingForALBAndCLB 459 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LoadBalancerId Type: String Description: (Required) The Classic Load Balancer name or the Application Load Balancer ARN. • S3BucketName Type: String Description: (Required) The Amazon S3 bucket name. • S3BucketPrefix Type: String Description: (Optional) The logical hierarchy you created for your Amazon Simple Storage Service (Amazon S3) bucket, for example my-bucket-prefix/prod . If the prefix is not provided, the log is placed at the root level of the bucket. Required IAM permissions AWSConfigRemediation-EnableLoggingForALBAndCLB 460 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • aws:executeScript - Enables and verifies
|
systems-manager-automation-runbook-guide-114
|
systems-manager-automation-runbook-guide.pdf
| 114 |
name or the Application Load Balancer ARN. • S3BucketName Type: String Description: (Required) The Amazon S3 bucket name. • S3BucketPrefix Type: String Description: (Optional) The logical hierarchy you created for your Amazon Simple Storage Service (Amazon S3) bucket, for example my-bucket-prefix/prod . If the prefix is not provided, the log is placed at the root level of the bucket. Required IAM permissions AWSConfigRemediation-EnableLoggingForALBAndCLB 460 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • aws:executeScript - Enables and verifies the logging for the Classic Load Balancer or the Application Load Balancer. AWSSupport-TroubleshootCLBConnectivity Description The AWSSupport-TroubleshootCLBConnectivity runbook help you troubleshoot connectivity issues between a Classic Load Balancer (CLB) and Amazon Elastic Compute Cloud (Amazon EC2) instances. Also, connectivity issues between a client and the CLB are reviewed. This runbook also reviews health checks for the CLB, verifies that best practices are being followed, and creates a troubleshooting dashboard for you. Optionally, you can upload the automation output to an Amazon Simple Storage Service (Amazon S3) bucket. However, this runbook does not support uploading output to S3 buckets that are publicly accessible. We recommend creating a temporary S3 bucket for this automation. Important Using this runbook might incur charges for the dashboard that is created. For more information, see Amazon CloudWatch Pricing Run this Automation (console) Document type Automation AWSSupport-TroubleshootCLBConnectivity 461 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InvestigationType Type: String Valid values: Best Practices | Connectivity Issues | Troubleshooting Dashboard Description: (Required) The operations you want the runbook to perform. • LoadBalancerName Type: String Description: (Required) The name of the CLB. • S3Location Type: String Description: (Optional) The name of the S3 bucket you want to send the automation results to. Publicly accessible buckets are not supported. If your S3 bucket uses server-side encryption, the user or role running this automation must have kms:GenerateDataKey permissions for the AWS KMS key. • S3LocationPrefix Type: String AWSSupport-TroubleshootCLBConnectivity 462 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon S3 key prefix (subfolder) you want to upload the automation output to. The format output is stored in the following format: amzn-s3-demo- bucket/S3LocationPrefix/{{InvestigationType}}_{{automation:EXECUTION_ID}}.txt. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeInstances • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeVpcAttribute • ec2:DescribeVpcs • ec2:DescribeSubnets • elasticloadbalancing:DescribeLoadBalancers • elasticloadbalancing:DescribeLoadBalancerPolicies • elasticloadbalancing:DescribeInstanceHealth • elasticloadbalancing:DescribeLoadBalancerAttributes • iam:ListRoles • cloudwatch:PutDashboard • ssm:GetAutomationExecution • ssm:StartAutomationExecution • ssm:DescribeAutomationExecutions • ssm:DescribeAutomationStepExecutions • ssm:DescribeInstanceInformation • ssm:DescribeInstanceProperties • ssm:GetDocument • ssm:ListCommands AWSSupport-TroubleshootCLBConnectivity 463 AWS Systems Manager Automation runbook reference User Guide • ssm:ListCommandInvocations • ssm:ListDocuments • ssm:SendCommand • s3:GetBucketAcl • s3:GetBucketPolicyStatus • s3:GetPublicAccessBlock • s3:PutObject Document Steps • aws:executeScript - Verifies that the CLB you specify in the LoadBalancerName parameter exists. • aws:branch - Branches based on the value specified for the InvestigationType parameter. • aws:executeScript - Performs connectivity checks to the CLB. • aws:executeScript - Verifies that the CLB configuration adheres to Elastic Load Balancing best practices. • aws:executeScript - Creates an Amazon CloudWatch dashboard for your CLB. • aws:executeScript - Creates a text file with the results of the automation and uploads it to the Amazon S3 bucket you specify in the S3Location parameter. Outputs RunBestPractices.Summary RunConnectivityChecks.Summary CreateTroubleshootingDashboard.Output UploadOutputToS3.Output AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing Description The AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing runbook enables cross zone load balancing for the network load balancer (NLB) you specify. AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing 464 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LoadBalancerArn Type: String Description: (Required) The Amazon Resource Name (ARN) of the NLB that you want to enable cross zone load balancing on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing 465 AWS Systems Manager Automation runbook reference User Guide Document Steps • aws:executeAwsApi - Enables cross zone load balancing for the NLB you specify in the LoadBalancerArn parameter. • aws:executeScript - Verifies cross zone load balancing has been enabled on the NLB. AWS-UpdateALBDesyncMitigationMode Description The AWS-UpdateALBDesyncMitigationMode runbook will update the desync mitigation mode on an Application Load Balancer (ALB) to the specified mitigation mode. The desync mitigation mode determines
|
systems-manager-automation-runbook-guide-115
|
systems-manager-automation-runbook-guide.pdf
| 115 |
to enable cross zone load balancing on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes AWSConfigRemediation-EnableNLBCrossZoneLoadBalancing 465 AWS Systems Manager Automation runbook reference User Guide Document Steps • aws:executeAwsApi - Enables cross zone load balancing for the NLB you specify in the LoadBalancerArn parameter. • aws:executeScript - Verifies cross zone load balancing has been enabled on the NLB. AWS-UpdateALBDesyncMitigationMode Description The AWS-UpdateALBDesyncMitigationMode runbook will update the desync mitigation mode on an Application Load Balancer (ALB) to the specified mitigation mode. The desync mitigation mode determines how the load balancer handles requests that might pose a security risk to your application. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LoadBalancerArn AWS-UpdateALBDesyncMitigationMode 466 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The Amazon Resource Name (ARN) of the ALB that you want to modify the desync mitigation mode of. • DesyncMitigationMode Type: String Valid values: monitor | defensive | strictest Description: (Required) The mitigation mode that you want the ALB to use. For information about desync mitigation modes, see Desync mitigation mode in the User Guide for Application Load Balancers. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancers • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • VerifyLoadBalancerType (aws:assertAwsResourceProperty) - Verifies that the value specified for the LoadBalancerArn input parameter is for an application load balancer before proceeding to the next step. • ModifyLoadBalancerDesyncMode (aws:executeAwsApi) - Updates the ALB to use the specified DesyncMitigationMode. • VerifyLoadBalancerDesyncMitigationMode (aws:executeScript) - Verifies that the desync mitigation mode was updated for the target ALB. Outputs AWS-UpdateALBDesyncMitigationMode 467 AWS Systems Manager Automation runbook reference User Guide VerifyLoadBalancerDesyncMitigationMode.ModificationResult - Message payload of the script verifying the modification to your ALB. AWS-UpdateCLBDesyncMitigationMode Description The AWS-UpdateCLBDesyncMitigationMode runbook will update the desync mitigation mode on an Classic Load Balancer (CLB) to the specified mitigation mode. The desync mitigation mode determines how the load balancer handles requests that might pose a security risk to your application. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LoadBalancerName Type: String Description: (Required) The name of the CLB that you want to modify the desync mitigation mode of. • DesyncMitigationMode AWS-UpdateCLBDesyncMitigationMode 468 AWS Systems Manager Automation runbook reference User Guide Type: String Valid values: monitor | defensive | strictest Description: (Required) The mitigation mode that you want the CLB to use. For information about desync mitigation modes, see Desync mitigation mode in the User Guide for Application Load Balancers. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:ModifyLoadBalancerAttributes Document Steps • ModifyLoadBalancerDesyncMode (aws:executeAwsApi) - Updates the CLB to use the specified DesyncMitigationMode. • VerifyLoadBalancerDesyncMitigationMode (aws:executeScript) - Verifies that the desync mitigation mode was updated for the target CLB. Outputs VerifyLoadBalancerDesyncMitigationMode.ModificationResult - Message payload of the script verifying the modification to your CLB. Amazon EMR AWS Systems Manager Automation provides predefined runbooks for Amazon EMR. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics Amazon EMR 469 AWS Systems Manager Automation runbook reference User Guide • AWSSupport-AnalyzeEMRLogs • AWSSupport-DiagnoseEMRLogsWithAthena AWSSupport-AnalyzeEMRLogs Description This runbook helps identify errors while running a job on an Amazon EMR cluster. The runbook analyzes a list of defined logs on the file system and looks for a list of predefined keywords. These log entries are used to create Amazon CloudWatch Events events so you can take any needed actions based on the events. Optionally, the runbook publishes log entries to the Amazon CloudWatch Logs log group of your choosing. This runbook currently looks for the following errors and patterns in log files: • container_out_of_memory – YARN container ran out of memory, running job may fail. • yarn_nodemanager_health: CORE or TASK node is running low on disk space and will not be able to run tasks. • node_state_change: CORE or TASK node is unreachable by the MASTER node. • step_failure: An EMR Step has failed. • no_core_nodes_running: No CORE nodes are currently running,
|
systems-manager-automation-runbook-guide-116
|
systems-manager-automation-runbook-guide.pdf
| 116 |
so you can take any needed actions based on the events. Optionally, the runbook publishes log entries to the Amazon CloudWatch Logs log group of your choosing. This runbook currently looks for the following errors and patterns in log files: • container_out_of_memory – YARN container ran out of memory, running job may fail. • yarn_nodemanager_health: CORE or TASK node is running low on disk space and will not be able to run tasks. • node_state_change: CORE or TASK node is unreachable by the MASTER node. • step_failure: An EMR Step has failed. • no_core_nodes_running: No CORE nodes are currently running, cluster is unhealthy. • hdfs_missing_blocks: There are missing HDFS blocks which could lead to data loss. • hdfs_high_util: HDFS Utilization is high, which may affect jobs and cluster health. • instance_controller_restart: Instance-Controller process has restarted. This process is essential for cluster health. • instance_controller_restart_legacy: Instance-Controller process has restarted. This process is essential for cluster health. • high_load: High Load Average detected, may affect node health reporting or result in timeouts or slowdowns. • yarn_node_blacklisted: CORE or TASK node has been blacklisted by YARN from running tasks. • yarn_node_lost: CORE or TASK node has been marked as LOST by YARN, possible connectivity issues. Instances associated with the ClusterID that you specify must be managed by AWS Systems Manager. You can run this automation once, schedule the automation to run at a specific time AWSSupport-AnalyzeEMRLogs 470 AWS Systems Manager Automation runbook reference User Guide interval, or remove a schedule created previously by an automation. This runbook supports Amazon EMR release versions 5.20 to 6.30. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterID Type: String Description: (Required) The ID of the cluster whose nodes logs you want to analyze. • Operation Type: String Valid values: Run Once | Schedule | Remove Schedule Description: (Required) The operation to perform on the cluster. • IntervalTime Type: String AWSSupport-AnalyzeEMRLogs 471 AWS Systems Manager Automation runbook reference User Guide Valid values: 5 minutes | 10 minutes | 15 minutes Description: (Optional) The duration of time between running the automation. This parameter is only applicable if you specify Schedule for the Operation parameter. • LogToCloudWatchLogs Type: String Valid values: yes | no Description: (Optional) If you specify yes for the value of this parameter, the automation creates a CloudWatch Logs log group with the name specified in the CloudWatchLogGroup parameter to store any matched log entries. • CloudWatchLogGroup Type: String Description: (Optional) The name of the CloudWatch Logs log group you want to store any matched log entries in. This parameter is only applicable if you specify yes for the LogToCloudWatchLogs parameter. • CreateLogInsightsDashboard Type: String Valid values: yes | no Description: (Optional) If you specify yes , CloudWatch dashboard is created if it does not already exist. This parameter is only applicable if you specify yes for the LogToCloudWatchLogs parameter. • CreateMetricFilters Type: String Valid values: yes | no Description: (Optional) Specify yes if you want to create metric filters for the CloudWatch Logs log group. This parameter is only applicable if you specify yes for the LogToCloudWatchLogs parameter. AWSSupport-AnalyzeEMRLogs 472 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetDocument • ssm:ListDocuments • ssm:DescribeAutomationExecutions • ssm:DescribeAutomationStepExecutions • ssm:GetAutomationExecution • ssm:DescribeInstanceInformation • ssm:ListCommandInvocations • ssm:ListCommands • ssm:SendCommand • iam:CreateRole • iam:DeleteRole • iam:GetRolePolicy • iam:PutRolePolicy • iam:DeleteRolePolicy • iam:passrole • cloudformation:DescribeStacks • cloudformation:DeleteStack • cloudformation:CreateStack • events:DeleteRule • events:RemoveTargets • events:PutTargets • events:PutRule • events:DescribeRule • logs:DescribeLogGroups • logs:CreateLogGroup • logs:PutMetricFilter AWSSupport-AnalyzeEMRLogs 473 AWS Systems Manager Automation runbook reference User Guide • cloudwatch:PutDashboard • elasticmapreduce:ListInstances • elasticmapreduce:DescribeCluster Document Steps • aws:executeAwsApi - Gathers information about the Amazon EMR cluster specified in the ClusterID parameter. • aws:branch - Branches based on input. • If the provided operation is Run Once or Schedule : • aws:assertAwsResourceProperty - Verifies the cluster is available. • aws:executeAwsApi - Gathers the IDs of all instances running in the cluster. • aws:assertAwsResourceProperty - Verifies the SSM Agent is running on all instances in the cluster. • aws:branch - Branches based on whether you specified to run the automation once or on a schedule. • If the provided operation is Run Once : • aws:branch - Branches based on the value specified in the LogToCloudWatchLogs parameter. • If LogToCloudWatchLogs value is yes : • aws:executeScript - Checks if a CloudWatch Logs log group with the name specified in parameter CloudWatchLogGroup
|
systems-manager-automation-runbook-guide-117
|
systems-manager-automation-runbook-guide.pdf
| 117 |
• aws:assertAwsResourceProperty - Verifies the cluster is available. • aws:executeAwsApi - Gathers the IDs of all instances running in the cluster. • aws:assertAwsResourceProperty - Verifies the SSM Agent is running on all instances in the cluster. • aws:branch - Branches based on whether you specified to run the automation once or on a schedule. • If the provided operation is Run Once : • aws:branch - Branches based on the value specified in the LogToCloudWatchLogs parameter. • If LogToCloudWatchLogs value is yes : • aws:executeScript - Checks if a CloudWatch Logs log group with the name specified in parameter CloudWatchLogGroup already exists. If not, the group is created with the name specified. • aws:branch - Branches based on the value specified in the CreateMetricFilters parameter. • If CreateMetricFilters value is yes : • aws:executeAwsApi - 12 steps are ran for each metric filter • aws:branch - Branches based on the value specified in the CreateLogInsightsDashboard parameter. • If CreateLogInsightsDashboard value is yes : • aws:executeAwsApi - Creates a CloudWatch dashboard with the same name specified in the CloudWatchLogGroup parameter, if it does not already exist. AWSSupport-AnalyzeEMRLogs 474 AWS Systems Manager Automation runbook reference User Guide • If CreateLogInsightsDashboard value is no : • aws:runCommand - Runs a shell script to find log patterns on each instance in the cluster. • If CreateMetricFilters value is no : • aws:branch - Branches based on the value specified in CreateLogInsightsDashboard parameter. • If CreateLogInsightsDashboard value is yes : • aws:executeAwsApi - Creates a CloudWatch dashboard with the same name specified in the CloudWatchLogGroup parameter, if it does not already exist. • If CreateLogInsightsDashboard value is no : • aws:runCommand - Runs a shell script to find log patterns on each instance in the cluster. • If LogToCloudWatchLogs value is no : • aws:executeAwsApi - Runs a shell script to find log patterns on each instance in the cluster. • If the provided operation is Schedule : • aws:createStack - Creates an Amazon EventBridge event that targets this runbook. • If the provided operation is Remove Schedule : • aws:executeAwsApi - Verifies a schedule exists for the cluster. • aws:deleteStack - Deletes the schedule. Outputs GetClusterInformation.ClusterName GetClusterInformation.ClusterState ListingClusterInstances.InstanceIDs CreatingScheduleCloudFormationStack.StackStatus RemovingScheduleByDeletingScheduleCloudFormationStack.StackStatus CheckIfLogGroupExists.output AWSSupport-AnalyzeEMRLogs 475 AWS Systems Manager Automation runbook reference User Guide FindLogPatternOnEMRNode.CommandId AWSSupport-DiagnoseEMRLogsWithAthena Description The AWSSupport-DiagnoseEMRLogsWithAthena runbook helps diagnose Amazon EMR logs using Amazon Athena in integration with AWS Glue Data Catalog. Amazon Athena is used to query the Amazon EMR log files for containers, node logs, or both, with optional parameters for specific date ranges or keyword-based searches. The runbook can automatically retrieve the Amazon EMR log location for an existing cluster, or you can specify the Amazon S3 log location. To analyze the logs, the runbook: • Creates an AWS Glue database and executes Amazon Athena Data Definition Language (DDL) queries on the Amazon EMR Amazon S3 log location to create tables for cluster logs and a list of known issues. • Executes Data Manipulation Language (DML) queries to search for known issue patterns in the Amazon EMR logs. The queries return a list of detected issues, their occurrence count, and the number of matched keywords by Amazon S3 file path. • The results are uploaded to an Amazon S3 bucket you specify under the prefix saw_diagnose_EMR_known_issues. • The runbook returns the Amazon Athena query results, highlighting findings, recommendations, and references to Amazon Knowledge Center (KC) articles sourced from a predefined subset. • Upon completion or failure, the AWS Glue database and the known issues files uploaded to the Amazon S3 bucket are deleted. How does it work? The AWSSupport-DiagnoseEMRLogsWithAthena perform analysis of Amazon EMR logs using Amazon Athena to detect errors and highlight findings, recommendations and relevant Knowledge Center articles. The runbook performs the following steps: • Get Amazon EMR cluster log location using cluster ID or input Amazon S3 location to retrieve log location and size. • Provide Athena costs estimate based on log location size. AWSSupport-DiagnoseEMRLogsWithAthena 476 AWS Systems Manager Automation runbook reference User Guide • Get approval to proceed by requesting approval from designated IAM principals before running Athena queries and continuing to the next steps. • Upload known issues to the specified Amazon S3 bucket, creates an AWS Glue database and tables. • Execute Athena queries on the Amazon EMR logs data. Queries can search by date range, keywords, both criteria, or run without filters based on the provided inputs. • Analyze results to highlight findings, recommendations, and relevant KC articles. • Output links for Amazon Athena DML queries results. • Clean up the environment by removing created database, tables, and uploaded known issues. Document type Automation Owner Amazon Platforms / The AutomationAssumeRole parameter requires the following actions to successfully use the runbook: • athena:GetQueryExecution • athena:StartQueryExecution • athena:GetPreparedStatement • athena:CreatePreparedStatement • glue:GetDatabase • glue:CreateDatabase • glue:DeleteDatabase
|
systems-manager-automation-runbook-guide-118
|
systems-manager-automation-runbook-guide.pdf
| 118 |
AWS Glue database and tables. • Execute Athena queries on the Amazon EMR logs data. Queries can search by date range, keywords, both criteria, or run without filters based on the provided inputs. • Analyze results to highlight findings, recommendations, and relevant KC articles. • Output links for Amazon Athena DML queries results. • Clean up the environment by removing created database, tables, and uploaded known issues. Document type Automation Owner Amazon Platforms / The AutomationAssumeRole parameter requires the following actions to successfully use the runbook: • athena:GetQueryExecution • athena:StartQueryExecution • athena:GetPreparedStatement • athena:CreatePreparedStatement • glue:GetDatabase • glue:CreateDatabase • glue:DeleteDatabase • glue:CreateTable • glue:GetTable • glue:DeleteTable • elasticmapreduce:DescribeCluster AWSSupport-DiagnoseEMRLogsWithAthena 477 AWS Systems Manager Automation runbook reference User Guide • s3:ListBucket • s3:GetBucketVersioning • s3:ListBucketVersions • s3:GetBucketPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetObject • s3:GetBucketLocation • pricing:GetProducts • pricing:GetAttributeValues • pricing:DescribeServices • pricing:ListPriceLists Important To restrict access to only the resources needed by this automation, attach the following policy to the IAM role that trusts the SSM Service. Replace the Partition, Region and Account with the appropriate values for the partition, region and account number where the run book is executed. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "elasticmapreduce:DescribeCluster", "glue:GetDatabase", "athena:GetQueryExecution", "athena:StartQueryExecution", "athena:GetPreparedStatement", "athena:CreatePreparedStatement", "s3:ListBucket", "s3:GetBucketVersioning", "s3:ListBucketVersions", "s3:GetBucketPublicAccessBlock", AWSSupport-DiagnoseEMRLogsWithAthena 478 AWS Systems Manager Automation runbook reference User Guide "s3:GetBucketPolicyStatus", "s3:GetObject", "s3:GetBucketLocation", "pricing:GetProducts", "pricing:GetAttributeValues", "pricing:DescribeServices", "pricing:ListPriceLists" ], "Resource": "*" }, { "Sid": "RestrictPutObjects", "Effect": "Allow", "Action": [ "s3:PutObject" ], "Resource": [ "arn:{Partition}:s3:::*/*/results/*", "arn:{partition}:s3:::*/*/saw_diagnose_emr_known_issues/*" ] }, { "Sid": "RestrictDeleteAccess", "Effect": "Allow", "Action": [ "s3:DeleteObject", "s3:DeleteObjectVersion" ], "Resource": [ "arn:{Partition}:s3:::*/*/saw_diagnose_emr_known_issues/*" ] }, { "Effect": "Allow", "Action": [ "glue:GetDatabase", "glue:CreateDatabase", "glue:DeleteDatabase" ], "Resource": [ "arn:{Partition}:glue:{Region}:{Account}:database/saw_diagnose_emr_database_*", "arn:{Partition}:glue:{Region}:{Account}:table/saw_diagnose_emr_database_*/*", "arn:{Partition}:glue:{Region}:{Account}:userDefinedFunction/ saw_diagnose_emr_database_*/*", AWSSupport-DiagnoseEMRLogsWithAthena 479 AWS Systems Manager Automation runbook reference User Guide "arn:{Partition}:glue:{Region}:{Account}:catalog" ] }, { "Effect": "Allow", "Action": [ "glue:CreateTable", "glue:GetTable", "glue:DeleteTable" ], "Resource": [ "arn:{Partition}:glue:{Region}:{Account}:table/saw_diagnose_emr_database_*/ saw_diagnose_emr_known_issues", "arn:{Partition}:glue:{Region}:{Account}:table/saw_diagnose_emr_database_*/ saw_diagnose_emr_logs_table", "arn:{Partition}:glue:{Region}:{Account}:table/saw_diagnose_emr_database_*/ j_*", "arn:{Partition}:glue:{Region}:{Account}:database/saw_diagnose_emr_database_*", "arn:{Partition}:glue:{Region}:{Account}:catalog" ] } ] } Instructions Follow these steps to configure the automation: 1. Navigate AWSSupport-DiagnoseEMRLogsWithAthena in the AWS Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterID (Required): The Amazon EMR cluster ID. AWSSupport-DiagnoseEMRLogsWithAthena 480 AWS Systems Manager Automation runbook reference User Guide • S3LogLocation (Optional): The Amazon S3 Amazon EMR log location. Input the Path-style URL Amazon S3 location, for example: s3://amzn-s3-demo-bucket/myfolder/j-1K48XXXXXXHCB/. Provide this parameter if the Amazon EMR cluster has been terminated for more than 30 days. • S3BucketName (Required): The Amazon S3 bucket name to upload a list of known issues, and the output of Amazon Athena queries. The bucket should have Block Public Access Enabled and be in the same AWS region and account as the Amazon EMR cluster. • Approvers (Required): The list of AWS authenticated principals who are able to either approve or reject the action. You can specify principals by using any of the following formats: user name, user ARN, IAM role ARN, or IAM assume role ARN. The maximum number of approvers is 10. • FetchNodeLogsOnly (Optional): If set to true, the automation diagnoses the Amazon EMR application containers logs. The default value is false. • FetchContainersLogsOnly (Optional): If set to true, the automation diagnoses the Amazon EMR containers logs. The default value is false. • EndSearchDate (Optional): The end date for log searches. If provided, the automation will exclusively search for logs generated up to the specified date in the format YYYY-MM-DD (for example: 2024-12-30). • DaysToCheck (Optional): When EndSearchDate is provided, this parameter is required to determine the number of days to retrospectively search for logs from the specified EndSearchDate. The maximum value is 30 days. The default value is 1. • SearchKeywords (Optional): The list of keywords to search in the logs, separated by commas. The keywords cannot contain single or double quotes. AWSSupport-DiagnoseEMRLogsWithAthena 481 AWS Systems Manager Automation runbook reference User Guide 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • getLogLocation: Retrieves the Amazon S3 log location by querying the specified Amazon EMR Cluster ID. If the automation is unable to query the log location from the Amazon EMR cluster ID, the runbook uses the S3LogLocation input parameter. • branchOnValidLog: Verifies the Amazon EMR logs location. If the location is valid, proceed to estimate the Amazon Athena potential costs when executing queries on the Amazon EMR logs. • estimateAthenaCosts: Determines the size of Amazon EMR logs and provides a cost estimate for executing Athena scans on the log dataset. For non-commercial regions (non-AWS partitions), this step just provides the log size without estimating costs. Costs can be calculated using
|
systems-manager-automation-runbook-guide-119
|
systems-manager-automation-runbook-guide.pdf
| 119 |
the specified Amazon EMR Cluster ID. If the automation is unable to query the log location from the Amazon EMR cluster ID, the runbook uses the S3LogLocation input parameter. • branchOnValidLog: Verifies the Amazon EMR logs location. If the location is valid, proceed to estimate the Amazon Athena potential costs when executing queries on the Amazon EMR logs. • estimateAthenaCosts: Determines the size of Amazon EMR logs and provides a cost estimate for executing Athena scans on the log dataset. For non-commercial regions (non-AWS partitions), this step just provides the log size without estimating costs. Costs can be calculated using the Athena pricing documentation in the specified region. • approveAutomation: Waits for the designated IAM principals approval to proceed with the next steps of the automation. The approve notification contains the estimated cost of Amazon Athena scan on the Amazon EMR logs, and details about the resources being provisioned by the automation. • uploadKnownIssuesExecuteAthenaQueries: AWSSupport-DiagnoseEMRLogsWithAthena 482 AWS Systems Manager Automation runbook reference User Guide Uploads the predefined known issues to the Amazon S3 bucket specified in the S3BucketName parameter. Creates AWS Glue database and tables. Executes Amazon Athena queries in the AWS Glue database based on the input parameters. • getQueryExecutionStatus: Waits until the Amazon Athena query execution is in SUCCEEDED state. The Amazon Athena DML query searches for errors and exceptions in Amazon EMR cluster logs. • analyzeAthenaResults: Analyzes the Amazon Athena results to provide findings, recommendations, and Knowledge Center (KC) articles sourced from a predefined set of mappings. • getAnalyzeResultsQuery1ExecutionStatus: Waits until the query execution is in SUCCEEDED state. The Amazon Athena DML query analyzes the results from the previous DML query. This analysis query will return matched exceptions with resolutions and KC articles • getAnalyzeResultsQuery2ExecutionStatus: Waits until the query execution is in SUCCEEDED state. The Amazon Athena DML query analyzes the results from the previous DML query. This analysis query will return a list of exceptions/errors detected in each Amazon S3 log path. • printAthenaQueriesMessage: Prints links for the Amazon Athena DML queries results. • cleanupResources: Clean-ups resources by deleting the created AWS Glue database and delete known issues files that were created in the Amazon EMR logs bucket. 7. After completed, review the Outputs section for the detailed results of the execution: Output provides three links for Athena query results: • List of all errors and frequently occurred exceptions found in the Amazon EMR cluster logs, along with the corresponding log locations (Amazon S3 prefix). • Summary of unique known exceptions matched in the Amazon EMR logs, along with recommended resolutions and KC articles to help in troubleshooting. AWSSupport-DiagnoseEMRLogsWithAthena 483 AWS Systems Manager Automation runbook reference User Guide • Details on where specific errors and exceptions appear in the Amazon S3 log paths, to support further diagnosis. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • Refer toTroubleshooting Amazon EMR Clusters for more information Amazon OpenSearch Service AWS Systems Manager Automation provides predefined runbooks for Amazon OpenSearch Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-DeleteOpenSearchDomain • AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain • AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups • AWSSupport-TroubleshootOpenSearchRedYellowCluster • AWSSupport-TroubleshootOpenSearchHighCPU Amazon OpenSearch Service 484 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-DeleteOpenSearchDomain Description The AWSConfigRemediation-DeleteOpenSearchDomain runbook deletes the given Amazon OpenSearch Service domain using the DeleteDomain API. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • DomainName Type: String Allowed values: (\d{12}/)?[a-z]{1}[a-z0-9-]{2,28} Description: (Required) The name of the Amazon OpenSearch Service domain that you want to delete. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. Required IAM permissions AWSConfigRemediation-DeleteOpenSearchDomain 485 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • es:DeleteDomain • es:DescribeDomain Document Steps • aws:executeScript - Accepts the Amazon OpenSearch Service domain name as input, deletes it, and verifies the deletion. AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain Description The AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain runbook enables EnforceHTTPS on a given Amazon OpenSearch Service domain using the UpdateDomainConfig API. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • DomainName AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain 486 AWS Systems Manager Automation runbook reference User Guide Type: String Allowed values: (\d{12}/)?[a-z]{1}[a-z0-9-]{2,28} Description: (Required) The name of the Amazon OpenSearch Service domain that you want to use to enforce HTTPS. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following
|
systems-manager-automation-runbook-guide-120
|
systems-manager-automation-runbook-guide.pdf
| 120 |
a given Amazon OpenSearch Service domain using the UpdateDomainConfig API. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • DomainName AWSConfigRemediation-EnforceHTTPSOnOpenSearchDomain 486 AWS Systems Manager Automation runbook reference User Guide Type: String Allowed values: (\d{12}/)?[a-z]{1}[a-z0-9-]{2,28} Description: (Required) The name of the Amazon OpenSearch Service domain that you want to use to enforce HTTPS. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • es:DescribeDomain • es:UpdateDomainConfig Document Steps • aws:executeScript - Enables the EnforceHTTPS endpoint option on the Amazon OpenSearch Service domain you specify in the DomainName parameter. AWSConfigRemediation- UpdateOpenSearchDomainSecurityGroups Description The AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups runbook updates the security group configuration on a given Amazon OpenSearch Service domain using the UpdateDomainConfig API. AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups 487 AWS Systems Manager Automation runbook reference User Guide Note AWS Security groups can only be applied to Amazon OpenSearch Service domains configured for Amazon Virtual Private Cloud (VPC) Access, and not to Amazon OpenSearch Service domains configured for Public Access. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • DomainName Type: String Description: (Required) The name of the Amazon OpenSearch Service domain that you want to use to update security groups. • SecurityGroupList Type: StringList Description: (Required) The security group IDs that you want to assign to the Amazon OpenSearch Service domain. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-UpdateOpenSearchDomainSecurityGroups 488 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • es:DescribeDomain • es:UpdateDomainConfig Document Steps • aws:executeScript - Updates the security group configuration on the Amazon OpenSearch Service domain you specify in the DomainName parameter. AWSSupport-TroubleshootOpenSearchRedYellowCluster Description AWSSupport-TroubleshootOpenSearchRedYellowCluster automation runbook is used to identify the cause for red or yellow cluster health status and guide you through changing the cluster back to green. How does it work? The runbook AWSSupport-TroubleshootOpenSearchRedYellowCluster helps you troubleshoot the cause of red or yellow cluster and provides the next steps to resolve this issue by analyzing the cluster configuration and resource utilization. The runbook performs the following steps: • Calls the DescribeDomain API against the target domain to get the cluster configuration. • Checks if the OpenSearch Service domain is internet-based (public) or Amazon Virtual Private Cloud (VPC)-based. • Creates a public or Amazon VPC-based AWS Lambda function depending on the cluster configuration. Note: The Lambda function contains the troubleshooting code that run the OpenSearch Service APIs against the cluster to determine why the cluster is in red or yellow state. AWSSupport-TroubleshootOpenSearchRedYellowCluster 489 AWS Systems Manager Automation runbook reference User Guide • Deletes the Lambda function. • Displays the checks performed and the next recommended steps to resolve the red or yellow cluster issue. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • cloudformation:CreateStack • cloudformation:DescribeStacks • cloudformation:DescribeStackEvents • cloudformation:DeleteStack • lambda:CreateFunction • lambda:DeleteFunction • lambda:InvokeFunction • lambda:GetFunction • es:DescribeDomain • es:DescribeDomainConfig • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcs • ec2:DescribeNetworkInterfaces AWSSupport-TroubleshootOpenSearchRedYellowCluster 490 AWS Systems Manager Automation runbook reference User Guide • ec2:CreateNetworkInterface • ec2:DeleteNetworkInterface • ec2:DescribeInstances • ec2:AttachNetworkInterface • cloudwatch:GetMetricData • iam:PassRole The LambdaExecutionRole parameter requires the following actions to successfully use the runbook: • es:ESHttpGet • ec2:CreateNetworkInterface • ec2:DescribeNetworkInterfaces • ec2:DeleteNetworkInterface Overview of LambdaExecutionRole policy: The following is an example of a Lambda function's execution role (AWS Identity and Access Management (IAM) role) that grants the function permission to access AWS services and resources required by this runbook. For more information, see Lambda execution role. Note The ec2:DescribeNetworkInterfaces, ec2:CreateNetworkInterface, and ec2:DeleteNetworkInterface are only required if your OpenSearch Service cluster is Amazon VPC-based to allow the Lambda function to create and manage the Amazon VPC network interfaces. For more information, see Connecting outbound networking to resources in a Amazon VPC and Lambda execution role. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", AWSSupport-TroubleshootOpenSearchRedYellowCluster 491 AWS Systems Manager Automation runbook reference User Guide "Action": "es:ESHttpGet", "Resource": [ "arn:<partition>:es:<region>:<account-id>:domain/<domain- name>/", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cluster/health", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cat/indices", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cat/allocation", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cluster/allocation/explain" ] }, { "Condition": { "ArnLikeIfExists": { "ec2:Vpc": "arn:<partition>:ec2:<region>:<account-id>:vpc/ <vpc_id>" } }, "Action": [ "ec2:DeleteNetworkInterface", "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:UnassignPrivateIpAddresses", "ec2:AssignPrivateIpAddresses" ], "Resource": "*", "Effect": "Allow" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootOpenSearchRedYellowCluster in the AWS Systems Manager console. 2. Select Execute automation. AWSSupport-TroubleshootOpenSearchRedYellowCluster 492 AWS Systems Manager Automation runbook reference User Guide 3. For
|
systems-manager-automation-runbook-guide-121
|
systems-manager-automation-runbook-guide.pdf
| 121 |
Amazon VPC and Lambda execution role. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", AWSSupport-TroubleshootOpenSearchRedYellowCluster 491 AWS Systems Manager Automation runbook reference User Guide "Action": "es:ESHttpGet", "Resource": [ "arn:<partition>:es:<region>:<account-id>:domain/<domain- name>/", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cluster/health", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cat/indices", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cat/allocation", "arn:<partition>:es:<region>:<account-id>:domain/<domain-name>/ _cluster/allocation/explain" ] }, { "Condition": { "ArnLikeIfExists": { "ec2:Vpc": "arn:<partition>:ec2:<region>:<account-id>:vpc/ <vpc_id>" } }, "Action": [ "ec2:DeleteNetworkInterface", "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:UnassignPrivateIpAddresses", "ec2:AssignPrivateIpAddresses" ], "Resource": "*", "Effect": "Allow" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootOpenSearchRedYellowCluster in the AWS Systems Manager console. 2. Select Execute automation. AWSSupport-TroubleshootOpenSearchRedYellowCluster 492 AWS Systems Manager Automation runbook reference User Guide 3. For the input parameters enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LambdaExecutionRole (Required): The ARN of the IAM role that Lambda will use to sign requests to your Amazon OpenSearch Service cluster. • DomainName (Required): The name of the OpenSearch Service domain with red or yellow cluster health status. • UtilizationThreshold (Optional): The utilization threshold percentage used to compare the CPUUtilization and JVMMemoryPressure metrics. Default value is 80. 4. If you have enabled fine-grained access control on an OpenSearch Service cluster, make sure that the LambdaExecutionRole role arn is mapped to a role with at least cluster_monitor permission. AWSSupport-TroubleshootOpenSearchRedYellowCluster 493 AWS Systems Manager Automation runbook reference User Guide 5. Select Execute. 6. The automation initiates. 7. The automation runbook performs the following steps: • GetClusterConfiguration: Fetches the OpenSearch Service cluster configuration. • CreateAWSLambdaFunctionStack: Creates a temporary Lambda function in your account using AWS CloudFormation. The Lambda function is used to run the OpenSearch Service APIs. • WaitForAWSLambdaFunctionStack: Waits for the CloudFormation stack to complete. • GetClusterMetricsFromCloudWatch: Gets the Amazon CloudWatch ClusterStatus, CPUUtilization, and JVMMemoryPressure OpenSearch Service cluster related metrics and its creation date. • RunOpenSearchAPIs: Uses the Lambda function to call the OpenSearch Service APIs and analyze the cluster metrics data to diagnose the cause for the red or yellow cluster status. • DeleteAWSLambdaFunctionStack: Deletes the Lambda function created by this automation in your account. 8. After completed, review the Outputs section for the detailed results of the execution. • RootCause: Provides an overview of the identified cause for cluster health to be in red or yellow state. • IssueDescription: AWSSupport-TroubleshootOpenSearchRedYellowCluster 494 AWS Systems Manager Automation runbook reference User Guide Provides details for why the cluster is in red or yellow state and possible steps to return the cluster to green state. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • Refer toTroubleshooting Amazon OpenSearch Service for more information AWSSupport-TroubleshootOpenSearchHighCPU Description The AWSSupport-TroubleshootOpenSearchHighCPU runbook provides an automated solution to collect diagnostic data from an Amazon OpenSearch Service domain to troubleshoot high CPU issues. How does it work? The AWSSupport-TroubleshootOpenSearchHighCPU runbook helps to troubleshoot high CPU utilization in the Amazon OpenSearch Service domain. The runbook performs the following steps: • Runs the DescribeDomain API against the provided Amazon OpenSearch Service domain to get the cluster metadata. • Checks whether the Amazon OpenSearch Service domain is public or Amazon VPC-based and with the help of AWS CloudFormation, creates a public or Amazon VPC-based AWS Lambda function. • The Lambda function fetches diagnostic data from the Amazon OpenSearch Service domains. AWSSupport-TroubleshootOpenSearchHighCPU 495 AWS Systems Manager Automation runbook reference User Guide • Uses an AWS Step Functions state machine to orchestrate multiple Lambda function executions to gather more comprehensive data. • Stores the collected data in an Amazon CloudWatch log group for 24 hours by default. • Deletes the created resources, except the CloudWatch log group. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • cloudformation:CreateStack • cloudformation:CreateStack • cloudformation:DescribeStacks • cloudformation:DescribeStackEvents • cloudformation:DeleteStack • lambda:CreateFunction • lambda:DeleteFunction • lambda:InvokeFunction • lambda:GetFunction • lambda:TagResource • es:DescribeDomain • ec2:DescribeSecurityGroups • ec2:DescribeSubnets AWSSupport-TroubleshootOpenSearchHighCPU 496 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeVpcs • ec2:DescribeNetworkInterfaces • ec2:CreateNetworkInterface • ec2:DescribeInstances • ec2:AttachNetworkInterface • ec2:DeleteNetworkInterface • logs:CreateLogGroup • logs:PutRetentionPolicy • logs:TagResource • states:CreateStateMachine • states:DeleteStateMachine • states:StartExecution • states:TagResource • states:DescribeStateMachine • states:DescribeExecution • iam:PassRole • iam:CreateRole • iam:DeleteRole • iam:GetRole • iam:PutRolePolicy • iam:DeleteRolePolicy • ssm:DescribeAutomationExecutions • ssm:GetAutomationExecution The LambdaExecutionRole parameter requires the following actions to successfully use the runbook: • es:ESHttpGet • ec2:CreateNetworkInterface • ec2:DescribeNetworkInterfaces • ec2:DeleteNetworkInterface AWSSupport-TroubleshootOpenSearchHighCPU 497 AWS Systems Manager Automation runbook reference User Guide • logs:CreateLogStream • logs:PutLogEvents The Lambda execution role grants the function permission to access AWS services and resources required by this runbook. For more information, see Lambda execution role.
|
systems-manager-automation-runbook-guide-122
|
systems-manager-automation-runbook-guide.pdf
| 122 |
ec2:CreateNetworkInterface • ec2:DescribeInstances • ec2:AttachNetworkInterface • ec2:DeleteNetworkInterface • logs:CreateLogGroup • logs:PutRetentionPolicy • logs:TagResource • states:CreateStateMachine • states:DeleteStateMachine • states:StartExecution • states:TagResource • states:DescribeStateMachine • states:DescribeExecution • iam:PassRole • iam:CreateRole • iam:DeleteRole • iam:GetRole • iam:PutRolePolicy • iam:DeleteRolePolicy • ssm:DescribeAutomationExecutions • ssm:GetAutomationExecution The LambdaExecutionRole parameter requires the following actions to successfully use the runbook: • es:ESHttpGet • ec2:CreateNetworkInterface • ec2:DescribeNetworkInterfaces • ec2:DeleteNetworkInterface AWSSupport-TroubleshootOpenSearchHighCPU 497 AWS Systems Manager Automation runbook reference User Guide • logs:CreateLogStream • logs:PutLogEvents The Lambda execution role grants the function permission to access AWS services and resources required by this runbook. For more information, see Lambda execution role. Note The ec2:DescribeNetworkInterfaces, ec2:CreateNetworkInterface, and ec2:DeleteNetworkInterface are only required if your OpenSearch Service cluster is Amazon VPC-based to allow the Lambda function to create and manage the Amazon VPC network interfaces. For more information, see Connecting outbound networking to resources in a Amazon VPC and Lambda execution role. Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootOpenSearchHighCPU in the AWS Systems Manager console. 2. Select Execute automation. 3. For the input parameters enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DomainName (Required): The name of the Amazon OpenSearch Service domain that you want to troubleshoot for high CPU issues. • LambdaExecutionRoleForOpenSearch (Required): The ARN of the IAM role to attach to the Lambda function. The Lambda function uses the credentials from this role to sign requests to the Amazon OpenSearch Service domain. If AWSSupport-TroubleshootOpenSearchHighCPU 498 AWS Systems Manager Automation runbook reference User Guide fine-grained access control is enabled on the Amazon OpenSearch Service domain, you must map this role to an OpenSearch Service Dashboards backend role with a minimum of "cluster_monitor" permission. • DataRetentionDays (Optional): The number of days to retain the diagnostic data collected from the Amazon OpenSearch Service domain. By default, the data is retained for 24 hours (one day). You can choose to retain the data for a maximum of up to 30 days. • NumberOfDataSamples (Optional): The number of data samples to collect from the Amazon OpenSearch Service domain. By default, 5 data sample are collected. You can collect up to 10 samples and the Lambda function will be invoked for each sample collection. 4. If you have enabled fine-grained access control on an OpenSearch Service cluster, make sure that the LambdaExecutionRole role arn is mapped to a role with at least cluster_monitor permission. 5. Select Execute. AWSSupport-TroubleshootOpenSearchHighCPU 499 AWS Systems Manager Automation runbook reference User Guide 6. The automation initiates. 7. The automation runbook performs the following steps: • checkConcurrency: Ensures that there is only one execution of this runbook targeting the specified Amazon OpenSearch Service domain. If the runbook finds another execution targeting the same domain name, it returns an error and ends. • getDomainConfig: Gets the configuration details for the target OpenSearch Service domain. • provisionResources: Provisions the resources for data collection using AWS CloudFormation. • waitForStackCreation: Waits for the AWS CloudFormation stack to complete. • describeStackResources: Describes the AWS CloudFormation stack and gets the ARN of the state machine. • runStateMachine: Invokes the data collector Lambda function one or more times by running a Step Functions state machine. • describeErrorsFromStackEvents: Describes errors from the AWS CloudFormation stack for errors. • unstageOpenSearchHighCPUAutomation: Deletes the AWSSupport-TroubleshootOpenSearchHighCPU AWS CloudFormation stack. • describeErrorsFromStackDeletion: Describes errors encountered while deleting the AWS CloudFormation stack. • finalStatus: Returns the final output of the AWSSupport-TroubleshootOpenSearchHighCPU runbook. 8. After completed, review the Outputs section for the detailed results of the execution. AWSSupport-TroubleshootOpenSearchHighCPU • finalStatus.FinalOutput: 500 AWS Systems Manager Automation runbook reference User Guide Provides the CloudWatch log group where the diagnostic data is stored. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • Refer toTroubleshooting Amazon OpenSearch Service for more information EventBridge AWS Systems Manager Automation provides predefined runbooks for Amazon EventBridge. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-AddOpsItemDedupStringToEventBridgeRule • AWS-DisableEventBridgeRule AWS-AddOpsItemDedupStringToEventBridgeRule Description The AWS-AddOpsItemDedupStringToEventBridgeRule runbook adds a deduplication string for all AWS Systems Manager OpsItems associated with an Amazon EventBridge rule. The runbook doesn't add a deduplication string to the rule if one has already been applied. To learn more EventBridge 501 AWS Systems Manager Automation runbook reference User Guide deduplication strings and OpsItems, see Reducing duplicate OpsItems in the AWS Systems Manager User Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The
|
systems-manager-automation-runbook-guide-123
|
systems-manager-automation-runbook-guide.pdf
| 123 |
to view runbook content, see View runbook content. Topics • AWS-AddOpsItemDedupStringToEventBridgeRule • AWS-DisableEventBridgeRule AWS-AddOpsItemDedupStringToEventBridgeRule Description The AWS-AddOpsItemDedupStringToEventBridgeRule runbook adds a deduplication string for all AWS Systems Manager OpsItems associated with an Amazon EventBridge rule. The runbook doesn't add a deduplication string to the rule if one has already been applied. To learn more EventBridge 501 AWS Systems Manager Automation runbook reference User Guide deduplication strings and OpsItems, see Reducing duplicate OpsItems in the AWS Systems Manager User Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DedupString Type: String Description: (Required) The deduplication string you want to add to the rule. • RuleName Type: String Description: (Required) The name of the rule you want to add the deduplication string to. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWS-AddOpsItemDedupStringToEventBridgeRule 502 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetAutomationExecution • events:ListTargetsByRule • events:PutTargets Document Steps • aws:executeScript - Adds a deduplication string to the EventBridge rule you specify in the RuleName parameter. AWS-DisableEventBridgeRule Description The AWS-DisableEventBridgeRule runbook disables the Amazon EventBridge rule you specify.To learn more about EventBridge rules, see Amazon EventBridge rules in the Amazon EventBridge User Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on AWS-DisableEventBridgeRule 503 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EventBusName Type: String Default: default Description: (Optional) The event bus associated with the rule you want to disable. • RuleName Type: String Description: (Required) The name of the rule you want to disable. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • events:DisableRule Document Steps • aws:executeAwsApi - Disables the EventBridge rule you specify in the RuleName parameter. AWS Glue AWS Systems Manager Automation provides predefined runbooks for AWS Glue. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-TroubleshootGlueConnection AWS Glue 504 AWS Systems Manager Automation runbook reference User Guide AWSSupport-TroubleshootGlueConnection Description The AWSSupport-TroubleshootGlueConnections runbook helps troubleshoot AWS Glue connection issues. The target of the tested connection must be reached through a JDBC connection and can be either an Amazon Relational Database Service (Amazon RDS) cluster/instance, a Amazon Redshift cluster, or any other target accessible through JDBC. In the first two cases, the Reachability Analyzer tool is used to determine if the connectivity between the source (AWS Glue) and the target (Amazon RDS or Amazon Redshift) is granted. If the target of the connection is not Amazon RDS nor Amazon Redshift, connectivity is still tested by creating an AWS Lambda function in the same subnet as the AWS Glue connection (a network point of presence) and checking if the target name is resolvable and if it's reachable in the target port. Important In order to run the Reachability Analyzer checks, Elastic Network Interfaces will be created in each of the connection's datasource subnets. Please make sure you have enough free IPs on those subnets and that the consumption of one IP will not impact your workload before running this automation. Important All the resources created by this automation are tagged so that they can be easily found. The tags used are: • AWSSupport-TroubleshootGlueConnection: true • AutomationExecutionId: Amazon EC2 Systems Manager Execution Id How does it work? The runbook performs the following steps: • Describes the AWS Glue connection to get the source information (subnet and security groups) for the connectivity checks. AWSSupport-TroubleshootGlueConnection 505 AWS Systems Manager Automation runbook reference User Guide • Fetches the target information (subnet and security groups) from the datasource referenced in the JDBC URL or from the DatasourceSecurityGroups and DatasourceSubnets parameters if they are present. • If the datasource present in the JDBC URL is a Amazon RDS instance or cluster or a Amazon Redshift cluster, this automation creates ENIs using both the source and target information gathered in the previous steps and uses Reachability Analyzer to perform a connectivity check between them. • A Lambda function (network point of presence, in the context of this automation) is used to perform L4 connectivity and name resolution checks.
|
systems-manager-automation-runbook-guide-124
|
systems-manager-automation-runbook-guide.pdf
| 124 |
• Fetches the target information (subnet and security groups) from the datasource referenced in the JDBC URL or from the DatasourceSecurityGroups and DatasourceSubnets parameters if they are present. • If the datasource present in the JDBC URL is a Amazon RDS instance or cluster or a Amazon Redshift cluster, this automation creates ENIs using both the source and target information gathered in the previous steps and uses Reachability Analyzer to perform a connectivity check between them. • A Lambda function (network point of presence, in the context of this automation) is used to perform L4 connectivity and name resolution checks. • The same Lambda function is used to perform the checks against the Amazon S3 endpoint. • Policy Simulator is used to determine if the IAM role used in the connection has the needed permissions. • The automation checks if the security group used by the connection has the expected configuration. • A report is generated containing the possible causes for the failure in the test connection operation and/or also the succeeded tests that were performed. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • cloudformation:CreateStack • cloudformation:DeleteStack • ec2:CreateNetworkInsightsPath AWSSupport-TroubleshootGlueConnection 506 AWS Systems Manager Automation runbook reference User Guide • ec2:CreateNetworkInterface • ec2:CreateTags • ec2:DeleteNetworkInsightsAnalysis • ec2:DeleteNetworkInsightsPath • ec2:DeleteNetworkInterface • ec2:StartNetworkInsightsAnalysis • iam:AttachRolePolicy • iam:CreateRole • iam:DeleteRole • iam:DeleteRolePolicy • iam:DetachRolePolicy • iam:PutRolePolicy • iam:TagRole • lambda:CreateFunction • lambda:DeleteFunction • lambda:TagResource • logs:CreateLogGroup • logs:DeleteLogGroup • logs:PutRetentionPolicy • logs:TagResource • glue:GetConnection • glue:GetDataCatalogEncryptionSettings • cloudformation:DescribeStacks • cloudformation:DescribeStackEvents • ec2:DescribeDhcpOptions • ec2:DescribeNetworkInsightsPaths • ec2:DescribeNetworkInsightsAnalyses • ec2:DescribeSecurityGroupRules • ec2:DescribeSecurityGroups • ec2:DescribeSubnets AWSSupport-TroubleshootGlueConnection 507 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeVpcs • ec2:DescribeVpcAttribute • iam:GetRole • iam:ListAttachedRolePolicies • iam:SimulatePrincipalPolicy • kms:DescribeKey • lambda:InvokeFunction • lambda:GetFunction • s3:GetEncryptionConfiguration • iam:PassRole Important In addition to the above mentioned actions, the AutomationAssumeRole should have the AmazonVPCReachabilityAnalyzerFullAccessPolicy as an attached managed policy so that the Reachability Analyzer tests are performed successfully. Here is an example of a policy that could be granted for the AutomationAssumeRole: { "Version": "2012-10-17", "Statement": [{ "Sid": "TaggedAWSResourcesPermissions", "Effect": "Allow", "Condition": { "StringEquals": { "aws:ResourceTag/AWSSupport-TroubleshootGlueConnection": "true" } }, "Action": [ "iam:AttachRolePolicy", "iam:CreateRole", "iam:DeleteRole", "iam:DeleteRolePolicy", "iam:DetachRolePolicy", AWSSupport-TroubleshootGlueConnection 508 AWS Systems Manager Automation runbook reference User Guide "iam:TagRole", "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:TagResource", "logs:DeleteLogGroup", "logs:CreateLogGroup", "logs:PutRetentionPolicy", "logs:TagResource", "cloudformation:CreateStack", "cloudformation:DeleteStack" ], "Resource": "*" }, { "Sid": "TaggedEC2ResourcesPermissions", "Effect": "Allow", "Condition": { "StringEquals": { "ec2:ResourceTag/AWSSupport-TroubleshootGlueConnection": "true" } }, "Action": [ "ec2:DeleteNetworkInterface" ], "Resource": "*" }, { "Sid": "PutRolePolicy", "Effect": "Allow", "Condition": { "StringEquals": { "iam:ResourceTag/AWSSupport-TroubleshootGlueConnection": "true" } }, "Action": [ "iam:PutRolePolicy", "iam:DeleteRolePolicy" ], "Resource": "*" }, { "Sid": "InvokeFunction", "Effect": "Allow", "Action": [ AWSSupport-TroubleshootGlueConnection 509 AWS Systems Manager Automation runbook reference User Guide "lambda:InvokeFunction" ], "Resource": "arn:*:lambda:*:*:function:point-of-presence-*" }, { "Sid": "UnTaggedActions", "Effect": "Allow", "Action": [ "ec2:CreateNetworkInsightsPath", "ec2:DeleteNetworkInsightsAnalysis", "ec2:DeleteNetworkInsightsPath", "ec2:CreateNetworkInterface", "ec2:CreateTags", "ec2:StartNetworkInsightsAnalysis", "glue:GetConnection", "glue:GetDataCatalogEncryptionSettings", "cloudformation:DescribeStacks", "cloudformation:DescribeStackEvents", "ec2:DescribeDhcpOptions", "ec2:DescribeNetworkInsightsPaths", "ec2:DescribeNetworkInsightsAnalyses", "ec2:DescribeSecurityGroupRules", "ec2:DescribeSecurityGroups", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "ec2:DescribeVpcAttribute", "iam:GetRole", "iam:ListAttachedRolePolicies", "iam:SimulatePrincipalPolicy", "kms:DescribeKey", "lambda:GetFunction", "s3:GetEncryptionConfiguration" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": "arn:*:iam::*:role/point-of-presence-*", "Condition": { "StringLikeIfExists": { "iam:PassedToService": "lambda.amazonaws.com" AWSSupport-TroubleshootGlueConnection 510 AWS Systems Manager Automation runbook reference User Guide } } } ] } Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-TroubleshootGlueConnection in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • TestConnectionRole (Required) The Amazon Resource Name (ARN) of the IAM role that is used during the connection test. • ConnectionName (Required) AWS Glue failed test connection name you want to troubleshoot. • PersistReachabilityAnalyzerResults (Optional) The flag informing if the results of the Reachability Analyzer execution should be kept or not. Default: false. • PointOfPresenceLogRetentionPeriod (Optional) The amount of days the logs for the point of presence Lambda will be stored for. Default: 7. • DatasourceSubnets (Optional) If the original datasource is not available, use this parameter to provide the subnets that it used so that the connectivity tests are still performed. Must be used with DatasourceSecurityGroups. Example: subnet-1,subnet-2. AWSSupport-TroubleshootGlueConnection 511 AWS Systems Manager Automation runbook reference User Guide • DatasourceSecurityGroups (Optional) If the original datasource is not available, use this parameter to provide the security groups it used so that the connectivity tests are still performed. Must be used with DatasourceSubnets. Example: sg-1,sg-2. 4. Select Execute. 5. The automation initiates. 6. The automation runbook performs the following steps: • ParseInputs: This step validates the combination of inputs. If both DatasourceSecurityGroups and DatasourceSubnets are provided, they are valid and returned as is. If none are provided, two
|
systems-manager-automation-runbook-guide-125
|
systems-manager-automation-runbook-guide.pdf
| 125 |
connectivity tests are still performed. Must be used with DatasourceSecurityGroups. Example: subnet-1,subnet-2. AWSSupport-TroubleshootGlueConnection 511 AWS Systems Manager Automation runbook reference User Guide • DatasourceSecurityGroups (Optional) If the original datasource is not available, use this parameter to provide the security groups it used so that the connectivity tests are still performed. Must be used with DatasourceSubnets. Example: sg-1,sg-2. 4. Select Execute. 5. The automation initiates. 6. The automation runbook performs the following steps: • ParseInputs: This step validates the combination of inputs. If both DatasourceSecurityGroups and DatasourceSubnets are provided, they are valid and returned as is. If none are provided, two empty lists are returned. If just one of them is provided, the step raises a ValueException. • GetConnectionDetails: This steps returns the details of the provided AWS Glue connection. • ParseSecurityGroupList: This step is used to concatenate the SecurityGroupIdList in a String for future utilization in this automation. • GetConnectionData: AWSSupport-TroubleshootGlueConnection 512 AWS Systems Manager Automation runbook reference User Guide Determines based on the JDBC URL, what type of connection between: RedShift, RdsInstance, RdsCluster and Other. In addition, returns the domain and port used in the JDBC connection, the connection's Amazon VPC and its domain name servers. • GetNetworkDetails: Gets the subnet and security group information from the Amazon RDS or Amazon Redshift target. • CreateENITemplate: Generates the AWS CloudFormation template used to create the network interfaces that are used to test connectivity. This is required to run the Reachability Analyzer tool. • CreateENIStack: Creates the AWS CloudFormation stack from the template created in the previous step. • GetStackDetails: Describes the AWS CloudFormation stack created in the previous stack and retrieve the SourceNetworkInterface an TargetNetworkInterfaces information. • RunSourceToTargetCheck: Runs checks between the source and target ENIs created in the previous step using the Reachability Analyzer tool. • DeleteENIStack: Deletes the AWS CloudFormation stack that creates Network Interfaces • CreateNetworkPointOfPresence: AWS CloudFormation creates the Lambda function used as network point of presence. • GetFunctionName: Performs a AWS CloudFormation describe stack API call to retrieve the name of the Lambda function created in the previous step. • RunEndpointChecks: Uses the network point of presence to determine if the endpoint present in the JDBC connection is resolvable and reachable in the declared port. • CheckS3Connectivity: AWSSupport-TroubleshootGlueConnection 513 AWS Systems Manager Automation runbook reference User Guide Checks the network connectivity from the AWS Glue connection to the Amazon S3 service. • DeletePointOfPresence: Deletes the AWS CloudFormation stack that creates the network point of presence Lambda. • TestIAMRolePermissions: Checks if the IAM role used for the test has the needed permissions to execute it. • CheckConnectionSecurityGroupReferencingRule: Checks if the security group used in the AWS Glue connection is allowing all ingress traffic from itself. It will return a list of the security groups without this rule, if any. • GenerateReport: Generates a report containing a list o findings (possible reasons for the failure in the connection test) and next steps (attempts to resolve the connection test failure). 7. After completed, review the Outputs section for the detailed results of the execution: • Automation Results In this section, you will find scenarios describing possible causes for the test connection operation to fail (findings) and how they can be fixed (next steps). If the automation cannot find the cause of the test failure, this will be informed in this section as well. • Successful Tests In this section, you will find scenarios informing what has been successfully tested by this automation. Succeeded tests are useful in case the automation is not able to identify the cause of the test connection failure as they reduce the scope of the investigation by informing what is not contributing for the issue. • Automation Errors In this section, you will find scenarios describing issues that happened during the automation, that may have limited the number of tests the automation could perform. The description of the scenario will inform which step has failed. AWSSupport-TroubleshootGlueConnection 514 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page Amazon FSx AWS Systems Manager Automation provides predefined runbooks for Amazon FSx. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-ValidateFSxWindowsADConfig Amazon FSx 515 AWS Systems Manager Automation runbook reference User Guide AWSSupport-ValidateFSxWindowsADConfig Description The AWSSupport-ValidateFSxWindowsADConfig runbook is used to validate the self-managed Active Directory (AD) configuration of an Amazon FSx for Windows File Server How does it work? The runbook AWSSupport-ValidateFSxWindowsADConfig executes the Amazon FSx validation script on the temporary Amazon Elastic Compute Cloud (Amazon EC2) Windows instance launched by the runbook on the Amazon FSx subnet. The script performs multiple checks to validate the network connectivity to self-managed
|
systems-manager-automation-runbook-guide-126
|
systems-manager-automation-runbook-guide.pdf
| 126 |
about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-ValidateFSxWindowsADConfig Amazon FSx 515 AWS Systems Manager Automation runbook reference User Guide AWSSupport-ValidateFSxWindowsADConfig Description The AWSSupport-ValidateFSxWindowsADConfig runbook is used to validate the self-managed Active Directory (AD) configuration of an Amazon FSx for Windows File Server How does it work? The runbook AWSSupport-ValidateFSxWindowsADConfig executes the Amazon FSx validation script on the temporary Amazon Elastic Compute Cloud (Amazon EC2) Windows instance launched by the runbook on the Amazon FSx subnet. The script performs multiple checks to validate the network connectivity to self-managed AD/DNS servers and permissions of the Amazon FSx service account. The runbook can validate a failed or misconfigured Amazon FSx for Windows File Server or create a new Amazon FSx for Windows File Server with self-managed AD. By default, the runbook creates the Amazon EC2 Windows instance, security group for AWS Systems Manager (SSM) access, AWS Identity and Access Management (IAM) role and policy using AWS CloudFormation on the Amazon FSx subnet. If you want to run the script on an existing Amazon EC2 instance, provide the ID in the parameter InstanceId. On successful execution, it deletes the CloudFormation resources. However, to retain the resources, set the RetainCloudFormationStack parameter to true. The CloudFormation template creates an IAM role on your behalf with required permissions to attach to the Amazon EC2 instance to run the Amazon FSx validation script. To specify an existing IAM instance profile for the temporary instance, use the InstanceProfileName parameter. The associated IAM role must contain the following permissions: • ec2:DescribeSubnets and ec2:DescribeVpcs permissions and the Amazon Managed Policy AmazonSSMManagedInstanceCore. • Permissions to get the Amazon FSx service account username and password from Systems Manager by calling the GetSecretValue API. • Permissions to put object in the Amazon Simple Storage Service (Amazon S3) bucket for the script output. Prerequisites The subnet where the temporary Amazon EC2 instance is created (or the existing instance provided in the InstanceId parameter) must allow access to the AWS Systems Manager, AWS Secrets AWSSupport-ValidateFSxWindowsADConfig 516 AWS Systems Manager Automation runbook reference User Guide Manager, and Amazon S3 endpoints in order to run the AmazonFSxADValidation script using SSM Run Command. AWS Secrets Manager setup The validation script connects to the Microsoft AD domain by retrieving the Amazon FSx service account username and password with a runtime call to Secrets Manager. Follow the steps in Create an AWS Secrets Manager secret to create a new Secrets Manager secret. Make sure that the username and password are stored using a key/value pair in the format {"username":"EXAMPLE-USER","password":"EXAMPLE-PASSWORD"}". Refer to Authentication and access control for AWS Secrets Manager for information about securing access to secrets. For more information about the tool, refer to the TROUBLESHOOTING.md and README.md files in the AmazonFSxADValidation file. Runbook execution Execute the runbook with Amazon FSx ID or AD parameters. Following is the runbook workflow: • Gets the parameters from the Amazon FSx ID or uses the input AD parameters. • Creates the temporary validation Amazon EC2 Windows instance on the Amazon FSx subnet, security group for SSM access, IAM role and policy (conditional) using CloudFormation. If the InstanceId parameter is specified, it is used. • Downloads and executes the validation script on the target Amazon EC2 instance in Amazon FSx primary subnet. • Provides the AD validation result code in the automation output. Additionally, the complete script output is uploaded to the Amazon S3 bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSSupport-ValidateFSxWindowsADConfig 517 AWS Systems Manager Automation runbook reference User Guide Windows Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • cloudformation:CreateStack • cloudformation:DeleteStack • cloudformation:DescribeStacks • cloudformation:DescribeStackResources • cloudformation:DescribeStackEvents • ec2:CreateTags • ec2:RunInstances • ec2:TerminateInstances • ec2:CreateLaunchTemplate • ec2:DeleteLaunchTemplate • ec2:DescribeSubnets • ec2:DescribeSecurityGroups • ec2:DescribeImages • ec2:DescribeInstances • ec2:DescribeLaunchTemplates • ec2:DescribeLaunchTemplateVersions • ec2:CreateSecurityGroup • ec2:DeleteSecurityGroup • ec2:RevokeSecurityGroupEgress • ec2:AuthorizeSecurityGroupEgress • iam:CreateRole • iam:CreateInstanceProfile • iam:GetInstanceProfile AWSSupport-ValidateFSxWindowsADConfig 518 AWS Systems Manager Automation runbook reference User Guide • iam:getRolePolicy • iam:DeleteRole • iam:DeleteInstanceProfile • iam:AddRoleToInstanceProfile • iam:RemoveRoleFromInstanceProfile • iam:AttachRolePolicy • iam:DetachRolePolicy • iam:PutRolePolicy • iam:DeleteRolePolicy • iam:GetRole • iam:PassRole • ssm:SendCommand • ssm:StartAutomationExecution • ssm:DescribeInstanceInformation • ssm:DescribeAutomationExecutions • ssm:GetDocument • ssm:GetAutomationExecution • ssm:DescribeAutomationStepExecutions • ssm:ListCommandInvocations • ssm:GetParameters • ssm:ListCommands • ssm:GetCommandInvocation • fsx:DescribeFileSystems • ds:DescribeDirectories • s3:GetEncryptionConfiguration • s3:GetBucketPublicAccessBlock • s3:GetAccountPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:GetBucketLocation AWSSupport-ValidateFSxWindowsADConfig 519 AWS Systems Manager Automation runbook reference User Guide Example IAM Policy for the Automation Assume Role { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowDescribe", "Effect": "Allow", "Action": [ "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups", "ec2:DescribeImages", "ec2:DescribeInstances", "ec2:DescribeLaunchTemplates", "ec2:DescribeLaunchTemplateVersions", "ssm:DescribeInstanceInformation", "ssm:DescribeAutomationExecutions", "ssm:DescribeAutomationStepExecutions", "fsx:DescribeFileSystems", "ds:DescribeDirectories" ], "Resource": "*" }, { "Sid": "CloudFormation", "Effect": "Allow", "Action": [ "cloudformation:DescribeStacks", "cloudformation:DescribeStackResources", "cloudformation:DescribeStackEvents", "cloudformation:CreateStack", "cloudformation:DeleteStack" ], "Resource": "arn:*:cloudformation:*:*:stack/AWSSupport- ValidateFSxWindowsADConfig-*" }, { "Sid": "AllowCreateLaunchTemplate", "Effect": "Allow", "Action": [ "ec2:CreateLaunchTemplate", "ec2:CreateTags" ], AWSSupport-ValidateFSxWindowsADConfig 520
|
systems-manager-automation-runbook-guide-127
|
systems-manager-automation-runbook-guide.pdf
| 127 |
• ssm:DescribeAutomationStepExecutions • ssm:ListCommandInvocations • ssm:GetParameters • ssm:ListCommands • ssm:GetCommandInvocation • fsx:DescribeFileSystems • ds:DescribeDirectories • s3:GetEncryptionConfiguration • s3:GetBucketPublicAccessBlock • s3:GetAccountPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:GetBucketLocation AWSSupport-ValidateFSxWindowsADConfig 519 AWS Systems Manager Automation runbook reference User Guide Example IAM Policy for the Automation Assume Role { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowDescribe", "Effect": "Allow", "Action": [ "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups", "ec2:DescribeImages", "ec2:DescribeInstances", "ec2:DescribeLaunchTemplates", "ec2:DescribeLaunchTemplateVersions", "ssm:DescribeInstanceInformation", "ssm:DescribeAutomationExecutions", "ssm:DescribeAutomationStepExecutions", "fsx:DescribeFileSystems", "ds:DescribeDirectories" ], "Resource": "*" }, { "Sid": "CloudFormation", "Effect": "Allow", "Action": [ "cloudformation:DescribeStacks", "cloudformation:DescribeStackResources", "cloudformation:DescribeStackEvents", "cloudformation:CreateStack", "cloudformation:DeleteStack" ], "Resource": "arn:*:cloudformation:*:*:stack/AWSSupport- ValidateFSxWindowsADConfig-*" }, { "Sid": "AllowCreateLaunchTemplate", "Effect": "Allow", "Action": [ "ec2:CreateLaunchTemplate", "ec2:CreateTags" ], AWSSupport-ValidateFSxWindowsADConfig 520 AWS Systems Manager Automation runbook reference User Guide "Resource": [ "arn:aws:ec2:*:*:launch-template/*" ] }, { "Sid": "AllowEC2RunInstances", "Effect": "Allow", "Action": [ "ec2:RunInstances", "ec2:CreateTags" ], "Resource": [ "arn:aws:ec2:*::image/*", "arn:aws:ec2:*::snapshot/*", "arn:aws:ec2:*:*:subnet/*", "arn:aws:ec2:*:*:network-interface/*", "arn:aws:ec2:*:*:security-group/*", "arn:aws:ec2:*:*:key-pair/*", "arn:aws:ec2:*:*:launch-template/*" ] }, { "Sid": "AllowEC2RunInstancesWithTags", "Effect": "Allow", "Action": [ "ec2:RunInstances", "ec2:CreateTags" ], "Resource": [ "arn:aws:ec2:*:*:instance/*", "arn:aws:ec2:*:*:volume/*" ] }, { "Sid": "EC2SecurityGroup", "Effect": "Allow", "Action": [ "ec2:CreateSecurityGroup", "ec2:RevokeSecurityGroupEgress", "ec2:AuthorizeSecurityGroupEgress", "ec2:CreateTags" ], "Resource": [ "arn:*:ec2:*:*:security-group/*", AWSSupport-ValidateFSxWindowsADConfig 521 AWS Systems Manager Automation runbook reference User Guide "arn:*:ec2:*:*:vpc/*" ] }, { "Sid": "EC2Remove", "Effect": "Allow", "Action": [ "ec2:TerminateInstances", "ec2:DeleteLaunchTemplate", "ec2:DeleteSecurityGroup" ], "Resource": [ "arn:aws:ec2:*:*:instance/*", "arn:aws:ec2:*:*:launch-template/*", "arn:*:ec2:*:*:security-group/*" ] }, { "Sid": "IAMInstanceProfile", "Effect": "Allow", "Action": [ "iam:CreateInstanceProfile", "iam:DeleteInstanceProfile", "iam:GetInstanceProfile", "iam:AddRoleToInstanceProfile", "iam:RemoveRoleFromInstanceProfile" ], "Resource": "arn:*:iam::*:instance-profile/*" }, { "Sid": "IAM", "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:getRolePolicy", "iam:PutRolePolicy", "iam:DeleteRolePolicy", "iam:GetRole", "iam:TagRole" ], "Resource": "arn:*:iam::*:role/*" AWSSupport-ValidateFSxWindowsADConfig 522 AWS Systems Manager Automation runbook reference User Guide }, { "Sid": "SSM", "Effect": "Allow", "Action": [ "ssm:StartAutomationExecution", "ssm:GetDocument", "ssm:GetAutomationExecution", "ssm:ListCommandInvocations", "ssm:GetParameters", "ssm:ListCommands", "ssm:GetCommandInvocation" ], "Resource": "*" }, { "Sid": "SSMSendCommand", "Effect": "Allow", "Action": [ "ssm:SendCommand" ], "Resource": "arn:aws:ssm:*:*:document/AWS- RunPowerShellScript" }, { "Sid": "SSMSendCommandOnlyFsxInstance", "Effect": "Allow", "Action": [ "ssm:SendCommand" ], "Resource": [ "arn:aws:ec2:*:*:instance/*" ], "Condition": { "StringLike": { "ssm:resourceTag/CreatedBy": [ "AWSSupport-ValidateFSxWindowsADConfig" ] } } }, { "Effect": "Allow", "Action": "iam:PassRole", AWSSupport-ValidateFSxWindowsADConfig 523 AWS Systems Manager Automation runbook reference User Guide "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": [ "ec2.amazonaws.com" ] } } }, { "Effect": "Allow", "Action": [ "s3:GetEncryptionConfiguration", "s3:GetBucketPublicAccessBlock", "s3:GetAccountPublicAccessBlock", "s3:GetBucketPolicyStatus", "s3:GetBucketAcl", "s3:GetBucketLocation" ], "Resource": "*" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-ValidateFSxWindowsADConfig in Systems Manager under Documents. 2. Select Execute automation. 3. To validate self-managed AD with an existing failed or misconfigured Amazon FSx, enter the following parameters: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • FSxId (Conditional): AWSSupport-ValidateFSxWindowsADConfig 524 AWS Systems Manager Automation runbook reference User Guide The Amazon FSx for Windows File Server ID. This is required to validate existing failed or misconfigured Amazon FSx. • SecretArn (Required): The ARN of your Secrets Manager secret containing the Amazon FSx service account username and password. Make sure that the username and password are stored using a key/value pair in the format {"username":"EXAMPLE-USER","password":"EXAMPLE-PASSWORD"}. The CloudFormation stack creates the validation instance with permissions to perform GetSecretValue to this ARN. • FSxSecurityGroupId (Required): The security group ID for the Amazon FSx for Windows File Server. • BucketName (Required): The Amazon S3 bucket to upload the validation results to. Make sure that the bucket is configured with server-side encryption (SSE) and the bucket policy does not grant unnecessary read/write permissions to parties that do not need to access the logs. Also make sure that the Amazon EC2 Windows instance has necessary access to the Amazon S3 bucket. 4. To validate self-managed AD configuration for a new Amazon FSx creation, enter the following parameters: • AutomationAssumeRole (Optional): AWSSupport-ValidateFSxWindowsADConfig 525 AWS Systems Manager Automation runbook reference User Guide The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • SecretArn (Required): The ARN of your Secrets Manager secret containing the Amazon FSx service account username and password. Make sure that the username and password are stored using a key/value pair in the format {"username":"EXAMPLE-USER","password":"EXAMPLE-PASSWORD"}. The CloudFormation stack creates the validation instance with permissions to perform GetSecretValue to this ARN. • FSxSecurityGroupId (Required): The security group ID for the Amazon FSx for Windows File Server. • BucketName (Required): The Amazon S3 bucket to upload the validation results to. Make sure that the bucket is configured with server-side encryption (SSE) and the bucket policy does not grant unnecessary read/write permissions to parties that do not need to access the logs. Also make sure that the Amazon EC2 Windows instance has necessary access to the Amazon S3 bucket. • FSxPreferredSubnetId (Conditional): The Amazon FSx for Windows File Server preferred subnet. • DomainName
|
systems-manager-automation-runbook-guide-128
|
systems-manager-automation-runbook-guide.pdf
| 128 |
validation instance with permissions to perform GetSecretValue to this ARN. • FSxSecurityGroupId (Required): The security group ID for the Amazon FSx for Windows File Server. • BucketName (Required): The Amazon S3 bucket to upload the validation results to. Make sure that the bucket is configured with server-side encryption (SSE) and the bucket policy does not grant unnecessary read/write permissions to parties that do not need to access the logs. Also make sure that the Amazon EC2 Windows instance has necessary access to the Amazon S3 bucket. • FSxPreferredSubnetId (Conditional): The Amazon FSx for Windows File Server preferred subnet. • DomainName (Conditional): The fully qualified domain name of your self-managed Microsoft AD domain. • DnsIpAddresses (Conditional): A list of up to two DNS server or domain controller IP addresses in your self-managed AD domain. For up to two IPs, enter them separated by a comma. • FSxAdminsGroup (Conditional): The Amazon FSx for Windows File Server delegated file system administrators group. By default, this is Domain Admins. • FSxOrganizationalUnit (Conditional): AWSSupport-ValidateFSxWindowsADConfig 526 AWS Systems Manager Automation runbook reference User Guide The Organizational Unit (OU) within which you want to join your file system. Provide the distinguished path name of the OU. Example: OU=org,DC=example,DC=com. 5. Select Execute. 6. The automation initiates. 7. The document performs the following steps: • CheckBucketPublicStatus (aws:executeScript): Checks if the target Amazon S3 bucket potentially grants read and/or write public access to its objects. • BranchOnInputParameters (aws:branch): Branches on the provided input parameters such as Amazon FSx ID or Amazon FSx parameters. • AssertFileSystemTypeIsWindows (aws:assertAwsResourceProperty): If Amazon FSx ID is provided, validates the file system type is Amazon FSx for Windows File Server. • GetValidationInputs (aws:executeScript): AWSSupport-ValidateFSxWindowsADConfig 527 AWS Systems Manager Automation runbook reference User Guide Returns the self-managed Microsoft AD configuration required by the CloudFormation template to create the Amazon EC2 instance. • BranchOnInstanceId (aws:branch): Branches on the provided input InstanceId. If InstanceId is provided, the validation script runs on the target Amazon EC2 instance from automation step:RunValidationScript. • CreateEC2InstanceStack (aws:createStack): Creates the Amazon EC2 instance in the preferred subnet using AWS CloudFormation where the AmazonFSxADValidation tool will be executed • DescribeStackResources (aws:executeAwsApi): Describes the CloudFormation stack to get the temporary Amazon EC2 instance ID. • WaitForEC2InstanceToBeManaged (aws:waitForAwsResourceProperty): Waits until the Amazon EC2 instance is managed by Systems Manager in order to run the validation script using SSM Run Command. • GetAmazonFSxADValidationAttachment (aws:executeAwsApi): Gets the AmazonFSxADValidation tool URL from the runbook attachments. • RunValidationScript (aws:runCommand): Runs the AmazonFSxADValidation tool on the temporary Amazon EC2 instance and stores the result in the Amazon S3 bucket specified in the BucketName parameter. • DescribeErrorsFromStackEvents (aws:executeScript): Describes the CloudFormation stack events if the runbooks fails to create the stack. • BranchOnRetainCloudFormationStack (aws:branch): Branches on the RetainCloudFormationStack and InstanceId parameters to determine if the CloudFormation stack should be deleted. • DeleteCloudFormationStack (aws:deleteStack): Deletes the AWS CloudFormation stack. 8. After completed, review the Outputs section for the results of the execution: AWSSupport-ValidateFSxWindowsADConfig 528 AWS Systems Manager Automation runbook reference User Guide The runbook will upload the results of the validation script execution to the Amazon S3 bucket. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • What is Amazon FSx for Windows File Server? • Validating self-managed AD configuration for Amazon FSx for Windows File Server GuardDuty AWS Systems Manager Automation provides predefined runbooks for Amazon GuardDuty. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. GuardDuty 529 AWS Systems Manager Automation runbook reference User Guide Topics • AWSConfigRemediation-CreateGuardDutyDetector AWSConfigRemediation-CreateGuardDutyDetector Description The AWSConfigRemediation-CreateGuardDutyDetector runbook creates an Amazon GuardDuty (GuardDuty) detector in the AWS Region where you run the automation. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution AWSConfigRemediation-CreateGuardDutyDetector 530 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution • guardduty:CreateDetector • guardduty:GetDetector Document Steps • aws:executeAwsApi - Creates a GuardDuty detector. • aws:assertAwsResourceProperty - Verifies the Status of the detector is ENABLED . IAM AWS Systems Manager Automation provides predefined runbooks for AWS Identity and Access Management. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-TroubleshootIAMAccessDeniedEvents • AWS-AttachIAMToInstance • AWS-DeleteIAMInlinePolicy • AWSConfigRemediation-DeleteIAMRole • AWSConfigRemediation-DeleteIAMUser • AWSConfigRemediation-DeleteUnusedIAMGroup • AWSConfigRemediation-DeleteUnusedIAMPolicy • AWSConfigRemediation-DetachIAMPolicy • AWSConfigRemediation-EnableAccountAccessAnalyzer • AWSSupport-GrantPermissionsToIAMUser • AWSConfigRemediation-RemoveUserPolicies • AWSConfigRemediation-ReplaceIAMInlinePolicy • AWSConfigRemediation-RevokeUnusedIAMUserCredentials • AWSConfigRemediation-SetIAMPasswordPolicy • AWSSupport-ContainIAMPrincipal IAM 531 AWS Systems Manager Automation runbook reference
|
systems-manager-automation-runbook-guide-129
|
systems-manager-automation-runbook-guide.pdf
| 129 |
ssm:GetAutomationExecution • guardduty:CreateDetector • guardduty:GetDetector Document Steps • aws:executeAwsApi - Creates a GuardDuty detector. • aws:assertAwsResourceProperty - Verifies the Status of the detector is ENABLED . IAM AWS Systems Manager Automation provides predefined runbooks for AWS Identity and Access Management. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-TroubleshootIAMAccessDeniedEvents • AWS-AttachIAMToInstance • AWS-DeleteIAMInlinePolicy • AWSConfigRemediation-DeleteIAMRole • AWSConfigRemediation-DeleteIAMUser • AWSConfigRemediation-DeleteUnusedIAMGroup • AWSConfigRemediation-DeleteUnusedIAMPolicy • AWSConfigRemediation-DetachIAMPolicy • AWSConfigRemediation-EnableAccountAccessAnalyzer • AWSSupport-GrantPermissionsToIAMUser • AWSConfigRemediation-RemoveUserPolicies • AWSConfigRemediation-ReplaceIAMInlinePolicy • AWSConfigRemediation-RevokeUnusedIAMUserCredentials • AWSConfigRemediation-SetIAMPasswordPolicy • AWSSupport-ContainIAMPrincipal IAM 531 AWS Systems Manager Automation runbook reference User Guide AWSSupport-TroubleshootIAMAccessDeniedEvents Description The AWSSupport-TroubleshootIAMAccessDeniedEvents automation runbook helps troubleshooting AWS Identity and Access Management (IAM) access denied issues. The runbook queries CloudTrail for recent access denied events related to the specified IAM entity and AWS service event source. It analyzes events within a configurable time window of up to 24 hours, processing up to 10 events per execution. Each identified access denied event is examined to help understand the context of the denial and the attempted actions. The automation analyzes both identity-based and resource-based IAM policies. For identity-based policies, it examines inline and managed policies attached to the IAM entity. For resource-based policies, it evaluates policies across multiple AWS services including Amazon Simple Storage Service(Amazon S3), AWS Key Management Service (AWS KMS), AWS Lambda, Amazon Simple Notification Service (Amazon SNS), Amazon Elastic Container Registry (Amazon ECR), Amazon API Gateway, CodeArtifact, Amazon Elastic File System (Amazon EFS), Amazon Simple Queue Service (Amazon SQS), AWS Cloud9, Amazon OpenSearch Service, AWS Signer, AWS Serverless Application Repository, and AWS Secrets Manager. The runbook utilizes IAM policy simulation capabilities to evaluate these policies against the denied actions found in the CloudTrail events. The runbook leverages IAM's policy simulation capabilities through both SimulatePrincipalPolicy for IAM users and SimulateCustomPolicy for IAM roles to evaluate these policies against the denied actions found in the CloudTrail events. The automation outputs a report that helps identify the specific actions that were denied, differentiating between implicit and explicit denies, listing the policies responsible for access denials and provides explanations for each denial. The report also suggests potential resolutions, such as identifying missing allow statements or conflicting deny statements How does it work? The runbook performs the following steps: • Describes and validates RequesterARN (role or user) to get information such as IAM entity type, and IAM Id. • Fetches CloudTrail events associated with the RequesterARN, EventSource, and ResourceARN if provided. • Analyzes the CloudTrail events to get the action that was performed when the Access Denied error was returned, then examines all the IAM policies such as inline and managed policies AWSSupport-TroubleshootIAMAccessDeniedEvents 532 AWS Systems Manager Automation runbook reference User Guide attached to the IAM entity, as well as resource-based policies. It then simulates these policies against the actions found in the Access Denied errors from the CloudTrail events in question to determine the cause of the error. • Outputs a report determining the type of Access Denied error, the policies responsible for the errors, and gives suggestions for potential solution to the error. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • apigateway:GetRestApis • cloudtrail:LookupEvents • cloud9:GetEnvironment • codeartifact:GetRepositoryPermissionsPolicy • ecr:GetRepositoryPolicy • elasticfilesystem:GetFileSystemPolicy • es:DescribeDomain • iam:GetPolicy • iam:GetPolicyVersion • iam:GetRole • iam:GetRolePolicy • iam:GetUser AWSSupport-TroubleshootIAMAccessDeniedEvents 533 AWS Systems Manager Automation runbook reference User Guide • iam:GetUserPolicy • iam:ListAttachedRolePolicies • iam:ListAttachedUserPolicies • iam:ListRolePolicies • iam:ListUserPolicies • iam:SimulatePrincipalPolicy • iam:SimulateCustomPolicy • kms:GetKeyPolicy • lambda:GetPolicy • secretsmanager:GetResourcePolicy • serverlessrepo:GetApplication • signer:GetSigningProfile • sns:GetTopicAttributes • ssm:StartAutomationExecution • ssm:StopAutomationExecution • sqs:GetQueueAttributes • s3:GetBucketPolicy Example Policy: { "Version": "2012-10-17", "Statement": [ { "Action": [ "iam:GetUser", "iam:GetRole", "iam:SimulatePrincipalPolicy", "iam:ListUserPolicies", "iam:ListRolePolicies", "iam:GetRolePolicy", "iam:ListAttachedRolePolicies", "iam:GetPolicy", "iam:GetUserPolicy", AWSSupport-TroubleshootIAMAccessDeniedEvents 534 AWS Systems Manager Automation runbook reference User Guide "iam:GetPolicyVersion", "iam:ListAttachedUserPolicies", "ssm:StartAutomationExecution", "ssm:StopAutomationExecution", "cloudtrail:LookupEvents", "iam:SimulateCustomPolicy" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "s3:GetBucketPolicy", "kms:GetKeyPolicy", "lambda:GetPolicy", "sns:GetTopicAttributes", "ecr:GetRepositoryPolicy", "apigateway:GET", "codeartifact:GetRepositoryPermissionsPolicy", "elasticfilesystem:GetFileSystemPolicy", "sqs:GetQueueAttributes", "cloud9:GetEnvironment", "es:DescribeDomain", "signer:GetSigningProfile", "serverlessrepo:GetApplication", "secretsmanager:GetResourcePolicy" ], "Resource": "*", "Effect": "Allow" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-TroubleshootIAMAccessDeniedEvents in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: AWSSupport-TroubleshootIAMAccessDeniedEvents 535 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole (Optional): • Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows SSM Automation to perform the actions on your behalf. The role needs to be added to your Amazon EKS cluster access entry or RBAC permission to allow Kubernetes API calls. • Type: AWS::IAM::Role::Arn • RequesterARN (Required): • Description: (Required) The ARN of the IAM user or role for which you want to investigate the access permissions on a specific AWS resource. • Type: String •
|
systems-manager-automation-runbook-guide-130
|
systems-manager-automation-runbook-guide.pdf
| 130 |
enter the following: AWSSupport-TroubleshootIAMAccessDeniedEvents 535 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole (Optional): • Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows SSM Automation to perform the actions on your behalf. The role needs to be added to your Amazon EKS cluster access entry or RBAC permission to allow Kubernetes API calls. • Type: AWS::IAM::Role::Arn • RequesterARN (Required): • Description: (Required) The ARN of the IAM user or role for which you want to investigate the access permissions on a specific AWS resource. • Type: String • Allow Pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-iso(-[a-z])?):iam::[0-9] {12}:(role|user)\\/[\\w+\\/=,.@-]+$ • ResourceARN (Optional): • Description: (Optional) The ARN of AWS the resource for which the access denied is evaluated. The AWS target resource should exist in the same region where the automation runbook is executed. • Type: String • Allow Pattern: ^$|^arn:(aws|aws-cn|aws-us-gov|aws-iso(-[a-z])?):([a-zA- Z0-9\\-]{1,63}):([a-z0-9\\-]{0,63})?:(\\d{12})?:([a-zA-Z0-9\\-_/:.] {1,1024})$ • EventSource (Required): • Description: (Required) The Amazon API endpoint where the CloudTrail event originated. For example: s3.amazonaws.com. • Type: String • Allow Pattern: ^([a-zA-Z0-9.-]+)\\.amazonaws\\.com$ • EventName (Optional): • Description: (Optional) The Amazon API action name associated with the CloudTrail event. For example: s3:CreateBucket. • Type: String • Allow Pattern: ^$|^[a-z0-9]+:[A-Za-z0-9]+$ • LookBackHours (Optional): AWSSupport-TroubleshootIAMAccessDeniedEvents 536 AWS Systems Manager Automation runbook reference User Guide • Description: (Optional) The number of hours to look back in the CloudTrail events when searching for Access Denied events. Valid range: 1 to 24 hours. • Type: Integer • Allow Pattern: ^([1-9]|1[0-9]|2[0-4])$ • Default: 12 • MaxEvents (Optional): • Description: (Optional) The maximum number of CloudTrail Access Denied events returned when searching for events. Valid range: 1 to 5 events. • Type: Integer • Allow Pattern: ^([1-9]|1[0-9]|2[0-4])$ • Default: 3 • UseContextEntries (Optional): • Description: (Optional) If you specify true, the automation extracts details about the context of the API request from the CloudTrail event and include them for the IAM policy simulation. • Type: Boolean • Allow Pattern: ^([1-9]|1[0-9]|2[0-4])$ • Default: 3 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • ValidateRequesterArn Validates and deconstructs the RequesterArn ARN, retrieving information about the target IAM user or role. • GetCloudTrailEventsWithAccessDeniedError Queries the CloudTrail events for recent Access Denied events related to the specified IAM entity and AWS service EventSource. • EvaluateIAMRequesterPolicies Evaluates the IAM permissions of the requester IAM entity against the actions from CloudTrail AWSSupport-TroubleshootIAMAccessDeniedEvents events. This evaluation includes analyzing both identity-based and resource-based policies 537 AWS Systems Manager Automation runbook reference User Guide associated with the requester. The automation utilizes IAM's policy simulation capabilities to assess these policies in the context of the denied actions identified in the CloudTrail events. 7. After completed, review the Outputs section for the detailed results of the execution: • PermissionEvaluationResults Outputs a report that helps to identify the specific actions that were denied, differentiating between implicit and explicit denials. It also lists the policies responsible for access denials and provides explanations for each denial. The report also suggests potential resolutions, such as identifying missing allow statements or conflicting deny statements References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS-AttachIAMToInstance Description Attach an AWS Identity and Access Management (IAM) role to a managed instance. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWS-AttachIAMToInstance 538 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ForceReplace Type: Boolean Description: (Optional) Flag to specify whether to replace the existing IAM profile or not. Default: true • InstanceId Type: String Description: (Required) The ID of the instance on which you want to assign an IAM role. • RoleName Type: String Description: (Required) The IAM role name to add to the managed instance. Document Steps 1. aws:executeAwsApi - DescribeInstanceProfile - Find the IAM instance profile attached to the EC2 instance. 2. aws:branch - CheckInstanceProfileAssociations - Check the IAM instance profile attached to the EC2 instance. a. If an IAM instance profile is attached and ForceReplace is set to true : i. aws:executeAwsApi - DisassociateIamInstanceProfile - Disassociate the IAM instance profile from the EC2 instance. b. aws:executeAwsApi - ListInstanceProfilesForRole - List instance profiles for the IAM role provided. AWS-AttachIAMToInstance 539 AWS Systems Manager Automation runbook reference User Guide c. aws:branch - CheckInstanceProfileCreated - Check if the IAM role provided has an associated instance profile. i. If the IAM role has an associated instance profile: A. aws:executeAwsApi - AttachIAMProfileToInstance - Attach the IAM instance profile role to the EC2
|
systems-manager-automation-runbook-guide-131
|
systems-manager-automation-runbook-guide.pdf
| 131 |
IAM instance profile attached to the EC2 instance. a. If an IAM instance profile is attached and ForceReplace is set to true : i. aws:executeAwsApi - DisassociateIamInstanceProfile - Disassociate the IAM instance profile from the EC2 instance. b. aws:executeAwsApi - ListInstanceProfilesForRole - List instance profiles for the IAM role provided. AWS-AttachIAMToInstance 539 AWS Systems Manager Automation runbook reference User Guide c. aws:branch - CheckInstanceProfileCreated - Check if the IAM role provided has an associated instance profile. i. If the IAM role has an associated instance profile: A. aws:executeAwsApi - AttachIAMProfileToInstance - Attach the IAM instance profile role to the EC2 instance. i. If the IAM role does not have an associated instance profile: A. aws:executeAwsApi - CreateInstanceProfileForRole - Create an instance profile role for the specified IAM role. B. aws:executeAwsApi - AddRoleToInstanceProfile - Attach the instance profile role to the specified IAM role. C. aws:executeAwsApi - GetInstanceProfile - Get the instance profile data for the specified IAM role. D. aws:executeAwsApi - AttachIAMProfileToInstanceWithRetry - Attach the IAM instance profile role to the EC2 instance. Outputs AttachIAMProfileToInstanceWithRetry.AssociationId GetInstanceProfile.InstanceProfileName GetInstanceProfile.InstanceProfileArn AttachIAMProfileToInstance.AssociationId ListInstanceProfilesForRole.InstanceProfileName ListInstanceProfilesForRole.InstanceProfileArn AWS-DeleteIAMInlinePolicy Description The AWS-DeleteIAMInlinePolicy runbook deletes all AWS Identity and Access Management (IAM) inline policies attached to the IAM identities you specify. Run this Automation (console) AWS-DeleteIAMInlinePolicy 540 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • IamArns Type: String Description: (Required) A comma separated list of ARNs for the IAM identities you want to delete inline policies from. This list can include IAM users, groups, or roles. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • iam:DeleteGroupPolicy • iam:DeleteRolePolicy • iam:DeleteUserPolicy • iam:ListGroupPolicies • iam:ListRolePolicies AWS-DeleteIAMInlinePolicy 541 AWS Systems Manager Automation runbook reference User Guide • iam:ListUserPolicies Document Steps • aws:executeScript - Deletes the IAM inline policies attached to the targeted IAM identities. AWSConfigRemediation-DeleteIAMRole Description The AWSConfigRemediation-DeleteIAMRole runbook deletes the AWS Identity and Access Management (IAM) role you specify. This automation does not delete instance profiles associated with the IAM role, or service-linked roles. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMRoleID Type: String AWSConfigRemediation-DeleteIAMRole 542 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The ID of the IAM role you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:DeleteRole • iam:DeleteRolePolicy • iam:GetRole • iam:ListAttachedRolePolicies • iam:ListInstanceProfilesForRole • iam:ListRolePolicies • iam:ListRoles • iam:RemoveRoleFromInstanceProfile Document Steps • aws:executeScript - Gathers the name of the IAM role you specify in the IAMRoleID parameter. • aws:executeScript - Gathers policies and instance profiles associated with the IAM role. • aws:executeScript - Deletes attached policies. • aws:executeScript - Deletes the IAM role and verifies the role has been deleted. AWSConfigRemediation-DeleteIAMUser Description The AWSConfigRemediation-DeleteIAMUser runbook deletes the AWS Identity and Access Management (IAM) user you specify. This automation deletes or detaches the following resources associated with the IAM user: AWSConfigRemediation-DeleteIAMUser 543 AWS Systems Manager Automation runbook reference User Guide • Access keys • Attached managed policies • Git credentials • IAM group memberships • IAM user password • Inline policies • Multi-factor authentication (MFA) devices • Signing certificates • SSH public keys Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMUserId Type: String Description: (Required) The ID of the IAM user you want to delete. AWSConfigRemediation-DeleteIAMUser 544 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:DeactivateMFADevice • iam:DeleteAccessKey • iam:DeleteLoginProfile • iam:DeleteServiceSpecificCredential • iam:DeleteSigningCertificate • iam:DeleteSSHPublicKey • iam:DeleteVirtualMFADevice • iam:DeleteUser • iam:DeleteUserPolicy • iam:DetachUserPolicy • iam:GetUser • iam:ListAttachedUserPolicies • iam:ListAccessKeys • iam:ListGroupsForUser • iam:ListMFADevices • iam:ListServiceSpecificCredentials • iam:ListSigningCertificates • iam:ListSSHPublicKeys • iam:ListUserPolicies • iam:ListUsers • iam:RemoveUserFromGroup Document Steps • aws:executeScript - Gathers the user name of the IAM user you specify in the IAMUserId parameter. AWSConfigRemediation-DeleteIAMUser 545 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Gathers access keys, certificates, credentials, MFA devices, and SSH keys associated with the
|
systems-manager-automation-runbook-guide-132
|
systems-manager-automation-runbook-guide.pdf
| 132 |
requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:DeactivateMFADevice • iam:DeleteAccessKey • iam:DeleteLoginProfile • iam:DeleteServiceSpecificCredential • iam:DeleteSigningCertificate • iam:DeleteSSHPublicKey • iam:DeleteVirtualMFADevice • iam:DeleteUser • iam:DeleteUserPolicy • iam:DetachUserPolicy • iam:GetUser • iam:ListAttachedUserPolicies • iam:ListAccessKeys • iam:ListGroupsForUser • iam:ListMFADevices • iam:ListServiceSpecificCredentials • iam:ListSigningCertificates • iam:ListSSHPublicKeys • iam:ListUserPolicies • iam:ListUsers • iam:RemoveUserFromGroup Document Steps • aws:executeScript - Gathers the user name of the IAM user you specify in the IAMUserId parameter. AWSConfigRemediation-DeleteIAMUser 545 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Gathers access keys, certificates, credentials, MFA devices, and SSH keys associated with the IAM user. • aws:executeScript - Gathers group memberships and policies for the IAM user. • aws:executeScript - Deletes access keys, certificates, credentials, MFA devices, and SSH keys associated with the IAM user. • aws:executeScript - Deletes group memberships and policies for the IAM user. • aws:executeScript - Deletes the IAM user and verifies the user has been deleted. AWSConfigRemediation-DeleteUnusedIAMGroup Description The AWSConfigRemediation-DeleteUnusedIAMGroup runbook deletes an IAM group that does not contain any users. The AWSConfigRemediation-DeleteUnusedIAMGroup runbook deletes an IAM group that does not contain any users. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-DeleteUnusedIAMGroup 546 AWS Systems Manager Automation runbook reference User Guide • GroupName Type: String Description: (Required) The name of the IAM group that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:DeleteGroup • iam:DeleteGroupPolicy • iam:DetachGroupPolicy Document Steps • aws:executeScript - Removes managed and inline IAM policies attached to the target IAM group, and then deletes the IAM group. AWSConfigRemediation-DeleteUnusedIAMPolicy Description The AWSConfigRemediation-DeleteUnusedIAMPolicy runbook deletes an AWS Identity and Access Management (IAM) policy that is not attached to any users, groups, or roles. Run this Automation (console) Document type Automation Owner Amazon AWSConfigRemediation-DeleteUnusedIAMPolicy 547 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMResourceId Type: String Description: (Required) The resource identifier of the IAM policy that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • config:ListDiscoveredResources • iam:DeletePolicy • iam:DeletePolicyVersion • iam:GetPolicy • iam:ListEntitiesForPolicy • iam:ListPolicyVersions Document Steps • aws:executeScript - Deletes the policy you specify in the IAMResourceId parameter, and verifies the policy was deleted. AWSConfigRemediation-DeleteUnusedIAMPolicy 548 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-DetachIAMPolicy Description The AWSConfigRemediation-DetachIAMPolicy runbook detaches the AWS Identity and Access Management (IAM) policy you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMResourceId Type: String Description: (Required) The ID of the IAM policy you want to detach. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution AWSConfigRemediation-DetachIAMPolicy 549 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution • config:GetResourceConfigHistory • config:ListDiscoveredResources • iam:DetachGroupPolicy • iam:DetachRolePolicy • iam:DetachUserPolicy • iam:GetPolicy • iam:ListEntitiesForPolicy Document Steps • aws:executeScript - Detaches the IAM policy from all resources. AWSConfigRemediation-EnableAccountAccessAnalyzer Description The AWSConfigRemediation-EnableAccountAccessAnalyzer runbook creates an AWS Identity and Access Management (IAM) Access Analyzer in your AWS account. For information about Access Analyzer, see Using AWS IAM Access Analyzer in the IAM User Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AnalyzerName AWSConfigRemediation-EnableAccountAccessAnalyzer 550 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The name of the analyzer to create. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • access-analyzer:CreateAnalyzer • access-analyzer:GetAnalyzer Document Steps • aws:executeAwsApi - Creates an access analyzer for your account. • aws:waitForAwsResourceProperty - Waits for the status of the access analyzer to be ACTIVE . • aws:assertAwsResourceProperty - Confirms the status of the access analyzer is ACTIVE . AWSSupport-GrantPermissionsToIAMUser Description This runbook grants the specified permissions to an IAM group (new or existing), and adds the existing IAM user to it. Policies you can choose from: Billing or Support
|
systems-manager-automation-runbook-guide-133
|
systems-manager-automation-runbook-guide.pdf
| 133 |
perform the actions on your behalf. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • access-analyzer:CreateAnalyzer • access-analyzer:GetAnalyzer Document Steps • aws:executeAwsApi - Creates an access analyzer for your account. • aws:waitForAwsResourceProperty - Waits for the status of the access analyzer to be ACTIVE . • aws:assertAwsResourceProperty - Confirms the status of the access analyzer is ACTIVE . AWSSupport-GrantPermissionsToIAMUser Description This runbook grants the specified permissions to an IAM group (new or existing), and adds the existing IAM user to it. Policies you can choose from: Billing or Support . To enable billing access for IAM, remember to also activate IAM user and federated user access to the Billing and Cost Management pages . AWSSupport-GrantPermissionsToIAMUser 551 AWS Systems Manager Automation runbook reference User Guide Important If you provide an existing IAM group, all current IAM users in the group receive the new permissions. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • IAMGroupName Type: String Default: ExampleSupportAndBillingGroup Description: (Required) Can be a new or existing group. Must comply with IAM Entity Name Limits . • IAMUserName Type: String AWSSupport-GrantPermissionsToIAMUser 552 AWS Systems Manager Automation runbook reference User Guide Default: ExampleUser Description: (Required) Must be an existing user. • LambdaAssumeRole Type: String Description: (Optional) The ARN of the role assumed by lambda. • Permissions Type: String Valid values: SupportFullAccess | BillingFullAccess | SupportAndBillingFullAccess Default: SupportAndBillingFullAccess Description: (Required) Choose one of: SupportFullAccess grants full access to the Support center. BillingFullAccess grants full access to the Billing dashboard. SupportAndBillingFullAccess grants full access to both Support center and the Billing dashboard. More info on policies under Document details. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. The permissions required depend on how AWSSupport-GrantPermissionsToIAMUser is run. Running as the currently logged in user or role It is recommended you have the AmazonSSMAutomationRole Amazon managed policy attached, and the following additional permissions to be able to create the Lambda function and the IAM role to pass to Lambda: { "Version": "2012-10-17", "Statement": [ { "Action": [ "lambda:InvokeFunction", AWSSupport-GrantPermissionsToIAMUser 553 AWS Systems Manager Automation runbook reference User Guide "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource": "arn:aws:lambda:*:ACCOUNTID:function:AWSSupport-*", "Effect": "Allow" }, { "Effect" : "Allow", "Action" : [ "iam:CreateGroup", "iam:AddUserToGroup", "iam:ListAttachedGroupPolicies", "iam:GetGroup", "iam:GetUser" ], "Resource" : [ "arn:aws:iam::*:user/*", "arn:aws:iam::*:group/*" ] }, { "Effect" : "Allow", "Action" : [ "iam:AttachGroupPolicy" ], "Resource": "*", "Condition": { "ArnEquals": { "iam:PolicyArn": [ "arn:aws:iam::aws:policy/job-function/Billing", "arn:aws:iam::aws:policy/AWSSupportAccess" ] } } }, { "Effect" : "Allow", "Action" : [ "iam:ListAccountAliases", "iam:GetAccountSummary" ], "Resource" : "*" AWSSupport-GrantPermissionsToIAMUser 554 AWS Systems Manager Automation runbook reference User Guide } ] } Using AutomationAssumeRole and LambdaAssumeRole The user must have the ssm:StartAutomationExecution permissions on the runbook, and iam:PassRole on the IAM roles passed as AutomationAssumeRole and LambdaAssumeRole . Here are the permissions each IAM role needs: AutomationAssumeRole { "Version": "2012-10-17", "Statement": [ { "Action": [ "lambda:InvokeFunction", "lambda:CreateFunction", "lambda:DeleteFunction", "lambda:GetFunction" ], "Resource": "arn:aws:lambda:*:ACCOUNTID:function:AWSSupport-*", "Effect": "Allow" } ] } LambdaAssumeRole { "Version": "2012-10-17", "Statement": [ { "Effect" : "Allow", "Action" : [ "iam:CreateGroup", "iam:AddUserToGroup", "iam:ListAttachedGroupPolicies", "iam:GetGroup", "iam:GetUser" AWSSupport-GrantPermissionsToIAMUser 555 AWS Systems Manager Automation runbook reference User Guide ], "Resource" : [ "arn:aws:iam::*:user/*", "arn:aws:iam::*:group/*" ] }, { "Effect" : "Allow", "Action" : [ "iam:AttachGroupPolicy" ], "Resource": "*", "Condition": { "ArnEquals": { "iam:PolicyArn": [ "arn:aws:iam::aws:policy/job-function/Billing", "arn:aws:iam::aws:policy/AWSSupportAccess" ] } } }, { "Effect" : "Allow", "Action" : [ "iam:ListAccountAliases", "iam:GetAccountSummary" ], "Resource" : "*" } ] } Document Steps 1. aws:createStack - Run AWS CloudFormation Template to create a Lambda function. 2. aws:invokeLambdaFunction - Run Lambda to set IAM permissions. 3. aws:deleteStack - Delete CloudFormation Template. Outputs configureIAM.Payload AWSSupport-GrantPermissionsToIAMUser 556 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-RemoveUserPolicies Description The AWSConfigRemediation-RemoveUserPolicies runbook deletes the AWS Identity and Access Management (IAM) inline policies and detaches any managed policies attached to the user you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMUserID Type: String Description: (Required) The ID of the user you want to remove policies from. • PolicyType Type: String Valid values: All | Inline | Managed AWSConfigRemediation-RemoveUserPolicies 557 AWS Systems Manager Automation runbook reference User Guide Default: All Description: (Required) The type of IAM policies you want to remove from the user. Required IAM permissions The AutomationAssumeRole parameter requires the following actions
|
systems-manager-automation-runbook-guide-134
|
systems-manager-automation-runbook-guide.pdf
| 134 |
Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMUserID Type: String Description: (Required) The ID of the user you want to remove policies from. • PolicyType Type: String Valid values: All | Inline | Managed AWSConfigRemediation-RemoveUserPolicies 557 AWS Systems Manager Automation runbook reference User Guide Default: All Description: (Required) The type of IAM policies you want to remove from the user. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:DeleteUserPolicy • iam:DetachUserPolicy • iam:ListAttachedUserPolicies • iam:ListUserPolicies • iam:ListUsers Document Steps • aws:executeScript - Deletes and detaches IAM policies from the user you specify in the IAMUserID parameter. AWSConfigRemediation-ReplaceIAMInlinePolicy Description The AWSConfigRemediation-ReplaceIAMInlinePolicy runbook replaces an inline AWS Identity and Access Management (IAM) policy with a replicated managed IAM policy. For an inline policy attached to a user, group, or role, the inline policy permissions are cloned into a managed IAM policy. The managed IAM policy is added to the resource, and the inline policy is removed. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation AWSConfigRemediation-ReplaceIAMInlinePolicy 558 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • InlinePolicyName Type: StringList Description: (Required) The inline IAM policy you want to replace. • ResourceId Type: String Description: (Required) The ID of the IAM user, group, or role whose inline policy you want to replace. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:AttachGroupPolicy • iam:AttachRolePolicy • iam:AttachUserPolicy AWSConfigRemediation-ReplaceIAMInlinePolicy 559 AWS Systems Manager Automation runbook reference User Guide • iam:CreatePolicy • iam:CreatePolicyVersion • iam:DeleteGroupPolicy • iam:DeleteRolePolicy • iam:DeleteUserPolicy • iam:GetGroupPolicy • iam:GetRolePolicy • iam:GetUserPolicy • iam:ListGroupPolicies • iam:ListRolePolicies • iam:ListUserPolicies Document Steps • aws:executeScript - Replace the inline IAM policy with an AWS replicated policy on the resource that you specify. AWSConfigRemediation-RevokeUnusedIAMUserCredentials Description The AWSConfigRemediation-RevokeUnusedIAMUserCredentials runbook revokes unused AWS Identity and Access Management (IAM) passwords and active access keys. This runbook also deactivates expired access keys, and deletes expired login profiles. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation Owner Amazon AWSConfigRemediation-RevokeUnusedIAMUserCredentials 560 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • IAMResourceId Type: String Description: (Required) The ID of the IAM resource you want to revoke unused credentials from. • MaxCredentialUsageAge Type: String Default: 90 Description: (Required) The number of days within which the credential must have been used. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:ListDiscoveredResources • iam:DeleteAccessKey • iam:DeleteLoginProfile • iam:GetAccessKeyLastUsed • iam:GetLoginProfile AWSConfigRemediation-RevokeUnusedIAMUserCredentials 561 AWS Systems Manager Automation runbook reference User Guide • iam:GetUser • iam:ListAccessKeys • iam:UpdateAccessKey Document Steps • aws:executeScript - Revokes IAM credentials for the user specified in the IAMResourceId parameter. Expired access keys are deactivated, and expired login profiles are deleted. Note Make sure to configure the MaxCredentialUsageAgeparameter of this remediation action to match the maxAccessKeyAge parameter of the AWS Config rule you use to trigger this action: access-keys-rotated. AWSConfigRemediation-SetIAMPasswordPolicy Description The AWSConfigRemediation-SetIAMPasswordPolicy runbook sets the AWS Identity and Access Management (IAM) user password policy for your AWS account. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSConfigRemediation-SetIAMPasswordPolicy 562 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • AllowUsersToChangePassword Type: Boolean Default: false Description: (Optional) If set to true , all IAM users in your AWS account can use the AWS Management Console to change their passwords. • HardExpiry Type: Boolean Default: false Description: (Optional) If set to true , IAM users are prevented from resetting their passwords after their password expires. • MaxPasswordAge Type: Integer Default: 0 Description: (Optional) The number of days an IAM user's password is valid. • MinimumPasswordLength Type: Integer Default: 6 Description: (Optional) The minimum number of characters an IAM user's password can be. • PasswordReusePrevention Type: Integer Default: 0 AWSConfigRemediation-SetIAMPasswordPolicy 563 AWS Systems Manager Automation runbook
|
systems-manager-automation-runbook-guide-135
|
systems-manager-automation-runbook-guide.pdf
| 135 |
false Description: (Optional) If set to true , all IAM users in your AWS account can use the AWS Management Console to change their passwords. • HardExpiry Type: Boolean Default: false Description: (Optional) If set to true , IAM users are prevented from resetting their passwords after their password expires. • MaxPasswordAge Type: Integer Default: 0 Description: (Optional) The number of days an IAM user's password is valid. • MinimumPasswordLength Type: Integer Default: 6 Description: (Optional) The minimum number of characters an IAM user's password can be. • PasswordReusePrevention Type: Integer Default: 0 AWSConfigRemediation-SetIAMPasswordPolicy 563 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The number of previous passwords that an IAM user is prevented from reusing. • RequireLowercaseCharacters Type: Boolean Default: false Description: (Optional) If set to true , an IAM user's password must contain a lowercase character from the ISO basic Latin alphabet (a to z). • RequireNumbers Type: Boolean Default: false Description: (Optional) If set to true , an IAM user's password must contain a numeric character (0-9). • RequireSymbols Type: Boolean Default: false Description: (Optional) If set to true , an IAM user's password must contain a non-alphanumeric character (! @ # $ % ^ * ( ) _ + - = [ ] { } | '). • RequireUppercaseCharacters Type: Boolean Default: false Description: (Optional) If set to true , an IAM user's password must contain an uppercase character from the ISO basic Latin alphabet (A to Z). Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSConfigRemediation-SetIAMPasswordPolicy 564 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:GetAccountPasswordPolicy • iam:UpdateAccountPasswordPolicy Document Steps • aws:executeScript - Sets the IAM user password policy based on the values you specify for the runbook parameters for your AWS account. AWSSupport-ContainIAMPrincipal Description In the event of a security incident or a suspected compromise of an AWS Identity and Access Management (IAM) User/Role or AWS Identity Center (IDC) user, swift isolation of the affected identity is crucial while preserving its configuration for investigation. The AWSSupport- ContainIAMPrincipal runbook provides a structured, reversible approach to contain compromised IAM or IDC identities, effectively blocking their access to AWS resources and preventing potential spread of the compromise. This automated process enables investigation without permanent alteration of the identity's configuration, allowing for restoration of normal access when deemed appropriate. The containment process maintains the user or role within IAM or the user within IDC, while effectively isolating it from all network activities. This isolation prevents the contained identity resource from communicating with resources inside your Amazon Virtual Private Cloud or accessing internet resources. The containment is designed to be reversible, allowing for restoration of normal access when deemed appropriate. How does it work? The AWSSupport-ContainIAMPrincipal runbook implements a comprehensive containment process for IAM users, roles, and Identity Center users. When executed in Contain mode, it first validates all input parameters and performs security checks on the specified Amazon S3 bucket. It then gathers detailed information about the target IAM principal and applies appropriate containment measures based on the principal type. For IAM users, it disables access keys, removes console access, and attaches a deny policy. For IAM roles, it attaches a deny policy that revokes AWSSupport-ContainIAMPrincipal 565 AWS Systems Manager Automation runbook reference User Guide permissions for sessions created before containment. For Identity Center users, it removes permission sets, group memberships, and applies a deny policy. Throughout the process, the runbook backs up the original configuration to an Amazon S3 bucket for potential restoration. When executed in Restore mode, it attempts to revert the principal to its pre-containment state using the backed-up configuration. The runbook includes a DryRun option to preview changes without applying them, and provides comprehensive reporting on both successful operations and failure scenarios. Important • Use of Elevated Privileges: This SSM document performs various operations that require elevated privileges, such as modifying IAM and IDC identity policies and applying quarantine configurations. These actions could potentially lead to a privilege escalation or impact other workloads that depend on the targeted identities. You should review the permissions granted to the role specified by the AutomationAssumeRole parameter and ensure they are appropriate for the intended use case. You can refer to the following AWS documentation for more information on IAM permissions: • Identity and Access Management (IAM) Permissions • AWS Systems Manager Automation Permissions • Workload Unavailability Risks: This Systems Manager document performs isolation actions that could potentially cause unavailability or disruption to your workloads. When executed during a security event, it will restrict access to the affected resource by revoking AWS API permissions from the specified IAM and IDC identities, preventing them from making any AWS API calls or actions. This could impact any applications or services that depend on these identities. •
|
systems-manager-automation-runbook-guide-136
|
systems-manager-automation-runbook-guide.pdf
| 136 |
intended use case. You can refer to the following AWS documentation for more information on IAM permissions: • Identity and Access Management (IAM) Permissions • AWS Systems Manager Automation Permissions • Workload Unavailability Risks: This Systems Manager document performs isolation actions that could potentially cause unavailability or disruption to your workloads. When executed during a security event, it will restrict access to the affected resource by revoking AWS API permissions from the specified IAM and IDC identities, preventing them from making any AWS API calls or actions. This could impact any applications or services that depend on these identities. • Creation of Additional Resources: The automation document may conditionally create additional resources, such as an Amazon Simple Storage Service (Amazon S3) bucket and Amazon S3 objects stored in them, depending on the execution parameters. These resources will incur additional charges based on your AWS usage. • Restoration Risks: If the Action parameter is set to Restore, this SSM document attempts to restore the IAM or IDC identity configuration to its original state. However, there is a risk that the restoration process may fail, leaving the IAM or IDC identity in an inconsistent state. The document provides instructions for manual restoration in case of such failures, but you should be prepared to handle potential issues during the restoration process. AWSSupport-ContainIAMPrincipal 566 AWS Systems Manager Automation runbook reference User Guide It is recommended to review the runbook thoroughly, understand its potential impacts, and test it in a non-production environment before executing it in your production environment. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions The AutomationAssumeRole parameter requires the following permissions to successfully use the runbook: • s3:GetBucketLocation • s3:GetBucket • s3:ListBucket • s3:GetBucketPublicAccessBlocks • s3:GetAccountPublicAccessBlocks • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:GetObject • s3:CreateBucket • s3:PutObject • iam:GetUser • iam:GetUserPolicy • iam:GetRole AWSSupport-ContainIAMPrincipal 567 AWS Systems Manager Automation runbook reference User Guide • iam:ListUserPolicies • iam:ListAttachedUserPolicies • iam:ListAccessKeys • iam:ListMfaDevices • iam:ListVirtualMFADevices • iam:GetLoginProfile • iam:GetPolicy • iam:GetRolePolicy • iam:ListPolicies • iam:ListAttachedRolePolicies • iam:ListRolePolicies • iam:UpdateAccessKey • iam:CreateAccessKey • iam:DeleteLoginProfile • iam:DeleteAccessKey • iam:PutUserPolicy • iam:DeleteUserPolicy • iam:DeactivateMFADevice • iam:AttachRolePolicy • iam:AttachUserPolicy • iam:DeleteRolePolicy • iam:TagMFADevice • iam:PutRolePolicy • iam:TagPolicy • iam:TagRole • iam:TagUser • iam:UntagUser • iam:UntagRole • organizations:ListAccounts • sso:ListPermissionSetsProvisionedToAccount AWSSupport-ContainIAMPrincipal 568 AWS Systems Manager Automation runbook reference User Guide • sso:GetInlinePolicyForPermissionSet • sso:ListInstances • sso-directory:SearchUsers • sso:ListPermissionSets • sso:ListAccountAssignments • sso-directory:DescribeUser • identitystore:ListUsers • identitystore:ListGroups • identitystore:IsMemberInGroups • identitystore:ListGroupMemberships • secretsmanager:CreateSecret • secretsmanager:DeleteSecret • sso:DeleteAccountAssignment • sso:PutInlinePolicyToPermissionSet • sso:CreateAccountAssignment • sso:DeleteInlinePolicyFromPermissionSet • sso:TagResource • sso:UntagResource • identitystore:DeleteGroupMembership • identitystore:CreateGroupMembership Here is an example of an IAM policy that grants the necessary permissions for the AutomationAssumeRole: { "Version": "2012-10-17", "Statement": [ { "Sid": "S3Permissions", "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:GetBucket", "s3:ListBucket", AWSSupport-ContainIAMPrincipal 569 AWS Systems Manager Automation runbook reference User Guide "s3:GetBucketPublicAccessBlocks", "s3:GetAccountPublicAccessBlocks", "s3:GetBucketPolicyStatus", "s3:GetBucketAcl", "s3:GetObject", "s3:CreateBucket", "s3:PutObject" ], "Resource": "*" }, { "Sid": "IAMPermissions", "Effect": "Allow", "Action": [ "iam:GetUser", "iam:GetUserPolicy", "iam:GetRole", "iam:ListUserPolicies", "iam:ListAttachedUserPolicies", "iam:ListAccessKeys", "iam:ListMfaDevices", "iam:ListVirtualMFADevices", "iam:GetLoginProfile", "iam:GetPolicy", "iam:GetRolePolicy", "iam:ListPolicies", "iam:ListAttachedRolePolicies", "iam:ListRolePolicies", "iam:UpdateAccessKey", "iam:CreateAccessKey", "iam:DeleteLoginProfile", "iam:DeleteAccessKey", "iam:PutUserPolicy", "iam:DeleteUserPolicy", "iam:DeactivateMFADevice", "iam:AttachRolePolicy", "iam:AttachUserPolicy", "iam:DeleteRolePolicy", "iam:TagMFADevice", "iam:PutRolePolicy", "iam:TagPolicy", "iam:TagRole", "iam:TagUser", "iam:UntagUser", AWSSupport-ContainIAMPrincipal 570 AWS Systems Manager Automation runbook reference User Guide "iam:UntagRole" ], "Resource": "*" }, { "Sid": "OrganizationsPermissions", "Effect": "Allow", "Action": [ "organizations:ListAccounts" ], "Resource": "*" }, { "Sid": "SSOPermissions", "Effect": "Allow", "Action": [ "sso:ListPermissionSetsProvisionedToAccount", "sso:GetInlinePolicyForPermissionSet", "sso:ListInstances", "sso-directory:SearchUsers", "sso:ListPermissionSets", "sso:ListAccountAssignments", "sso-directory:DescribeUser", "sso:DeleteAccountAssignment", "sso:PutInlinePolicyToPermissionSet", "sso:CreateAccountAssignment", "sso:DeleteInlinePolicyFromPermissionSet", "sso:TagResource", "sso:UntagResource" ], "Resource": "*" }, { "Sid": "IdentityStorePermissions", "Effect": "Allow", "Action": [ "identitystore:ListUsers", "identitystore:ListGroups", "identitystore:IsMemberInGroups", "identitystore:ListGroupMemberships", "identitystore:DeleteGroupMembership", "identitystore:CreateGroupMembership" ], "Resource": "*" AWSSupport-ContainIAMPrincipal 571 AWS Systems Manager Automation runbook reference User Guide }, { "Sid": "SecretsManagerPermissions", "Effect": "Allow", "Action": [ "secretsmanager:CreateSecret", "secretsmanager:DeleteSecret" ], "Resource": "*" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-ContainIAMPrincipal in the AWS Systems Manager console. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): • Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • Type: AWS::IAM::Role::Arn • PrincipalType (Required): • Description: (Required) The AWS IAM principal type: IAM user, IAM role, or Identity Center user. • Type: String • Allowed Values: IAM user|IAM role|Identity Center user • PrincipalName (Required): • Description: (Required) The name of the IAM principal. For Identity Center users, provide the username. • Type: String • Allowed Pattern: ^[a-zA-Z0-9\\.\\-_\\\\!*'()/+=,@]{1,1024}$ AWSSupport-ContainIAMPrincipal 572 AWS Systems Manager Automation runbook reference User Guide • Action (Required): • Description: (Required) Select Contain to isolate the target IAM principal or Restore to try to restore the IAM principal to its original configuration from a previous backup. • Type: String • Allowed Values: Contain|Restore • DryRun (Optional): •
|
systems-manager-automation-runbook-guide-137
|
systems-manager-automation-runbook-guide.pdf
| 137 |
IAM principal type: IAM user, IAM role, or Identity Center user. • Type: String • Allowed Values: IAM user|IAM role|Identity Center user • PrincipalName (Required): • Description: (Required) The name of the IAM principal. For Identity Center users, provide the username. • Type: String • Allowed Pattern: ^[a-zA-Z0-9\\.\\-_\\\\!*'()/+=,@]{1,1024}$ AWSSupport-ContainIAMPrincipal 572 AWS Systems Manager Automation runbook reference User Guide • Action (Required): • Description: (Required) Select Contain to isolate the target IAM principal or Restore to try to restore the IAM principal to its original configuration from a previous backup. • Type: String • Allowed Values: Contain|Restore • DryRun (Optional): • Description: (Optional) When set to true, the automation will not make any changes to the target IAM principal, instead it will output on what it would have attempted to change, detailing out on each step. Default value: true. • Type: Boolean • Allowed Values: true|false • ActivateDisabledKeys (Conditional): • Description: (Conditional) If the input parameter Action is set to Restore and the PrincipalType is set to IAM user, this option determines if this automation should try to activate the associated access keys if deactivated. Please note that the integrity of a compromised access key cannot be verified. AWS strongly recommends against reactivating a compromised key. Instead, it is advisable to generate new keys. Default value: false. • Type: Boolean • Allowed Values: true|false • BackupS3BucketName (Conditional): • Description: (Conditional) The Amazon Amazon S3 bucket to backup the IAM principal configuration when the Action is set to Contain or to restore the configuration from when the Action is Restore. Note that if the specified Action is Contain and the runbook is not able to access the bucket or a value is not provided, a new bucket is created in your account with the name awssupport-containiamprincipal-<random-string>. If DryRun is set to true this parameter is required. • Type: AWS::S3::Bucket::Name • BackupS3KeyName (Conditional): • Description: (Conditional) If Action is set to Restore, this specifies the Amazon Amazon S3 key the automation will use to try to restore the IAM principal configuration. The Amazon Amazon S3 key typically follows this format: {year}/{month}/{day}/{hour}/ {minute}/{automation_execution_id}.json. The key can be obtained from the output of a previous containment automation execution. 573 AWSSupport-ContainIAMPrincipal AWS Systems Manager Automation runbook reference User Guide • Type: String • Allowed Pattern: ^[a-zA-Z0-9\\.\\-_\\\\!*'()/]{0,1024}$ • BackupS3BucketAccess (Conditional): • Description: (Conditional) The ARN of the IAM users or roles that will be allowed access to the backup Amazon Amazon S3 bucket after running the containment actions. This parameter is required when Action is Contain. The AutomationAssumeRole, or in its absence the user under whose context the automation is running is automatically added to the list. • Type: StringList • Allowed Pattern: ^$|^arn:(aws|aws-cn|aws-us-gov|aws-iso(-[a-z])?):iam:: [0-9]{12}:(role|user)\\/[\\w+\\/=,.@-]+$ • TagIdentifier (Optional): • Description: (Optional) Tag the IAM principal with a tag of your choice using the following format: Key=<EXAMPLE_KEY>,Value=<EXAMPLE_VALUE>. This option allows you to track the IAM principals that have been targeted by this runbook. Note: Tag keys and values are case-sensitive. • Type: String • Allowed Pattern: ^$|^[Kk][Ee][Yy]=[\\+\\-\\=\\.\\_\\:\\/@a-zA-Z0-9] {1,128},[Vv][Aa][Ll][Uu][Ee]=[\\+\\-\\=\\.\\_\\:\\/@a-zA-Z0-9] {0,128}$ 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • ValidateRequiredInputs Validates the required automation input parameters based on the Action specified. • CheckBackupS3BucketName Checks if the target Amazon Amazon S3 bucket potentially grants read or write public access to its objects. In case of containment workflow, a new Amazon Amazon S3 bucket is created if the BackupS3BucketName bucket doesn't exist. • BranchOnAction Branches the automation based on the value of the specified Action. AWSSupport-ContainIAMPrincipal 574 AWS Systems Manager Automation runbook reference User Guide • BranchOnPrincipalTypeAndDryRun Branches the automation based on the type of IAM principal (IAM user, IAM role, or Identity Center user) and if it is running in DryRun mode. • BranchOnPrincipalTypeForContain Branches the automation for the Contain action based and the IAM principal type (IAM user, IAM role, or Identity Center user) specified in the input. • GetIAMUser Gets the creation time and username of the target IAM user. • GetIAMUserDetails Gets and stores the configuration of the target IAM user, including inline policies, managed policies, access keys, MFA devices, and login profile. • UpdateS3KeyForUser Updates the automation 'S3Key' variable from output of the step GetIAMUserDetails. • GetIAMRole Gets the creation time, role name, and path of the target IAM role. • GetIAMRoleDetails Gets and stores the configuration of the target IAM role, including inline policies and managed policies attached to the role. • UpdateS3KeyForRole Updates the automation 'S3Key' variable from output of the step GetIAMRoleDetails. • GetIdentityStoreId Gets the ID of the AWS IAM Identity Center instance associated with the AWS account. • GetIDCUser Gets the user ID of the target Identity Center user using the Identity Store ID. • GatherIDCUserDetails Gets and stores the configuration of the target Identity Center user, including account AWSSupport-ContainIAMPrincipal assignments, associated permission sets, and
|
systems-manager-automation-runbook-guide-138
|
systems-manager-automation-runbook-guide.pdf
| 138 |
time, role name, and path of the target IAM role. • GetIAMRoleDetails Gets and stores the configuration of the target IAM role, including inline policies and managed policies attached to the role. • UpdateS3KeyForRole Updates the automation 'S3Key' variable from output of the step GetIAMRoleDetails. • GetIdentityStoreId Gets the ID of the AWS IAM Identity Center instance associated with the AWS account. • GetIDCUser Gets the user ID of the target Identity Center user using the Identity Store ID. • GatherIDCUserDetails Gets and stores the configuration of the target Identity Center user, including account AWSSupport-ContainIAMPrincipal assignments, associated permission sets, and inline policies. 575 AWS Systems Manager Automation runbook reference User Guide • UpdateS3KeyForIDCUser Updates the automation 'S3Key' variable from output of the step GatherIDCUserDetails. • BranchOnIdentityContain Branches the automation based on the value of DryRun and the IAM principal type for the Contain action. • BranchOnDisableAccessKeys Branches the automation based on whether the IAM user has access keys that need to be disabled. • DisableAccessKeys Disables the active IAM user access keys. • BranchOnDisableConsoleAccess Branches based on whether the IAM user has AWS Management Console access enabled or not. • DisableConsoleAccess Removes the IAM user's password-based access to the AWS Management Console. • AttachInlineDenyPolicyToUser Attaches a deny policy to the IAM user to revoke permissions for older session tokens. • AttachInlineDenyPolicyToRole Attaches a deny policy to the IAM role to revoke permissions for older session tokens. • RemovePermissionSets Removes permission sets associated with the Identity Center user. • RemoveIDCUserFromIDCGroups Removes the Identity Center user from Identity Center groups. • AttachInlineDenyPolicyToPermissionSet Attaches a deny policy to the permission sets associated with the Identity Center user. • BranchOnReactivateKeys AWSSupport-ContainIAMPrincipal 576 AWS Systems Manager Automation runbook reference User Guide Branches the automation based on the ActivateDisabledKeys parameter during the restore process. • DetachInlineDenyPolicy Removes the deny policy attached to the IAM role during the containment process. • DetachInlineDenyPolicyFromPermissionSet Removes the deny policy attached to the permission sets during the containment process. • ReportContain Outputs detailed information about the containment actions that would be performed when DryRun is set to True. • ReportRestore Outputs detailed information about the restoration actions that would be performed when DryRun is set to True. • ReportContainFailure Provides comprehensive instructions to manually restore the IAM principal's original configuration during a containment workflow failure scenario. • ReportRestoreFailure Provides detailed instructions to manually complete the restoration of the IAM principal's original configuration during a restore workflow failure scenario. 7. After the execution completes, review the Outputs section for the detailed results of the execution: • ContainIAMPrincipal.Output Provides detailed information about the containment actions performed when Action is set to Contain and DryRun is set to False. Includes information about the backup location, applied deny policies, and modified configurations. • RestoreIAMPrincipal.Output Provides detailed information about the restoration actions performed when Action is set to Restore and DryRun is set to False. Includes information about the restored configurations and any issues encountered during restoration. AWSSupport-ContainIAMPrincipal 577 AWS Systems Manager Automation runbook reference User Guide • ReportContain.Output Outputs detailed information about the containment actions that would be performed when Action is set to Contain and DryRun is set to True. Includes a comparison of current and post- containment configurations. • ReportRestore.Output Outputs detailed information about the restoration actions that would be performed when Action is set to Restore and DryRun is set to True. Shows the current configuration and the original configuration that would be restored. • ReportContainFailure.Output Provides comprehensive instructions to manually restore the IAM principal's original configuration during a containment workflow failure scenario. • ReportRestoreFailure.Output Provides detailed instructions to manually complete the restoration of the IAM principal's original configuration during a restore workflow failure scenario. Outputs After the execution completes, review the Outputs section for the detailed results: • ContainIAMPrincipal.Output Provides detailed information about the containment actions performed when Action is set to Contain and DryRun is set to False. Includes information about the backup location, applied deny policies, and modified configurations. • RestoreIAMPrincipal.Output Provides detailed information about the restoration actions performed when Action is set to Restore and DryRun is set to False. Includes information about the restored configurations and any issues encountered during restoration. • ReportContain.Output Outputs detailed information about the containment actions that would be performed when Action is set to Contain and DryRun is set to True. Includes a comparison of current and post- containment configurations. AWSSupport-ContainIAMPrincipal 578 AWS Systems Manager Automation runbook reference User Guide • ReportRestore.Output Outputs detailed information about the restoration actions that would be performed when Action is set to Restore and DryRun is set to True. Shows the current configuration and the original configuration that would be restored. • ReportContainFailure.Output Provides comprehensive instructions to manually restore the IAM principal's original configuration during a containment workflow failure scenario. • ReportRestoreFailure.Output Provides detailed instructions to
|
systems-manager-automation-runbook-guide-139
|
systems-manager-automation-runbook-guide.pdf
| 139 |
the containment actions that would be performed when Action is set to Contain and DryRun is set to True. Includes a comparison of current and post- containment configurations. AWSSupport-ContainIAMPrincipal 578 AWS Systems Manager Automation runbook reference User Guide • ReportRestore.Output Outputs detailed information about the restoration actions that would be performed when Action is set to Restore and DryRun is set to True. Shows the current configuration and the original configuration that would be restored. • ReportContainFailure.Output Provides comprehensive instructions to manually restore the IAM principal's original configuration during a containment workflow failure scenario. • ReportRestoreFailure.Output Provides detailed instructions to manually complete the restoration of the IAM principal's original configuration during a restore workflow failure scenario. References Systems Manager Automation • Run this Automation (console) • Running a simple automation • Setting up Automation • Support Automation Workflows Amazon Kinesis Data Streams AWS Systems Manager Automation provides predefined runbooks for Amazon Kinesis Data Streams. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-EnableKinesisStreamEncryption AWS-EnableKinesisStreamEncryption Description Amazon Kinesis Data Streams 579 AWS Systems Manager Automation runbook reference User Guide The AWS-EnableKinesisStreamEncryption runbook enables encryption on an Amazon Kinesis Data Streams (Kinesis Data Streams). Producer applications writing to an encrypted stream will encounter errors if they do not have access to the AWS Key Management Service (AWS KMS) key. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • KinesisStreamName Type: String Description: (Required) The name of the stream you want to enable encryption on. • KeyId Type: String Default: alias/aws/kinesis Description: (Required) The customer-managed AWS KMS key you want to use for encryption. This value can be a globally unique identifier, an ARN to either an alias or a key, or an alias name AWS-EnableKinesisStreamEncryption 580 AWS Systems Manager Automation runbook reference User Guide prefixed by "alias/". You can also use the AWS managed key by using the default value for the parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • kinesis:DescribeStream • kinesis:StartStreamEncryption • kms:DescribeKey Document Steps • VerifyKinesisStreamStatus (aws:waitforAwsResourceProperty) - Checks the status of the Kinesis Data Streams. • EnableKinesisStreamEncryption (aws:executeAwsApi) - Enables encryption for the Kinesis Data Streams. • VerifyKinesisStreamUpdateComplete (aws:waitForAwsResourceProperty) - Waits for the Kinesis Data Streams status to return to ACTIVE. • VerifyKinesisStreamEncryption (aws:assertAwsResourceProperty) - Verifies encryption is enabled for the Kinesis Data Streams. AWS KMS AWS Systems Manager Automation provides predefined runbooks for AWS Key Management Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-CancelKeyDeletion • AWSConfigRemediation-EnableKeyRotation AWS KMS 581 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-CancelKeyDeletion Description The AWSConfigRemediation-CancelKeyDeletion runbook cancels deletion of the AWS Key Management Service (AWS KMS) customer managed key that you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • KeyId Type: String Description: (Required) The ID of the customer managed key that you want to cancel deletion for. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution AWSConfigRemediation-CancelKeyDeletion 582 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution • kms:CancelKeyDeletion • kms:DescribeKey Document Steps • aws:executeAwsApi - Cancels deletion for the customer managed key you specify in the KeyId parameter. • aws:assertAwsResourceProperty - Confirms key deletion is disabled on your customer managed key. AWSConfigRemediation-EnableKeyRotation Description The AWSConfigRemediation-EnableKeyRotation runbook enables automatic key rotation for the symmetric AWS Key Management Service (AWS KMS) customer managed key. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-EnableKeyRotation 583 AWS Systems Manager Automation runbook reference User Guide • KeyId Type: String Description: (Required) The ID of the customer managed key you want to enable automatic key rotation on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • kms:EnableKeyRotation • kms:GetKeyRotationStatus Document Steps • aws:executeAwsApi - Enables automatic key rotation on the customer managed key you specify in
|
systems-manager-automation-runbook-guide-140
|
systems-manager-automation-runbook-guide.pdf
| 140 |
String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-EnableKeyRotation 583 AWS Systems Manager Automation runbook reference User Guide • KeyId Type: String Description: (Required) The ID of the customer managed key you want to enable automatic key rotation on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • kms:EnableKeyRotation • kms:GetKeyRotationStatus Document Steps • aws:executeAwsApi - Enables automatic key rotation on the customer managed key you specify in the KeyId parameter. • aws:assertAwsResourceProperty - Confirms that automatic key rotation is enabled on your customer managed key. Lambda AWS Systems Manager Automation provides predefined runbooks for AWS Lambda. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-ConfigureLambdaFunctionXRayTracing • AWSConfigRemediation-DeleteLambdaFunction • AWSConfigRemediation-EncryptLambdaEnvironmentVariablesWithCMK • AWSConfigRemediation-MoveLambdaToVPC Lambda 584 AWS Systems Manager Automation runbook reference User Guide • AWSSupport-RemediateLambdaS3Event • AWSSupport-TroubleshootLambdaInternetAccess • AWSSupport-TroubleshootLambdaS3Event AWSConfigRemediation-ConfigureLambdaFunctionXRayTracing Description The AWSConfigRemediation-ConfigureLambdaFunctionXRayTracing runbook enables AWS X-Ray live tracing on the AWS Lambda function you specify in the FunctionName parameter. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • FunctionName Type: String Description: (Required) The name or ARN of the Lambda function to enable tracing on. AWSConfigRemediation-ConfigureLambdaFunctionXRayTracing 585 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • lambda:UpdateFunctionConfiguration • ssm:StartAutomationExecution • ssm:GetAutomationExecution Document Steps • aws:executeAwsApi - Enables X-Ray tracing on the Lambda function you specify in the FunctionName parameter. • aws:assertAwsResourceProperty - Verifies that X-Ray tracing has been enabled on the Lambda function. Outputs UpdateLambdaConfig.UpdateFunctionConfigurationResponse - Response from the UpdateFunctionConfiguration API call. AWSConfigRemediation-DeleteLambdaFunction Description The AWSConfigRemediation-DeleteLambdaFunction runbook deletes the AWS Lambda function you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-DeleteLambdaFunction 586 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LambdaFunctionName Type: String Description: (Required) The name of the Lambda function that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • lambda:DeleteFunction • lambda:GetFunction Document Steps • aws:executeAwsApi - Deletes the Lambda function specified in the LambdaFunctionName parameter. • aws:executeScript - Verifies the Lambda function has been deleted. AWSConfigRemediation- EncryptLambdaEnvironmentVariablesWithCMK Description AWSConfigRemediation-EncryptLambdaEnvironmentVariablesWithCMK 587 AWS Systems Manager Automation runbook reference User Guide The AWSConfigRemediation-EncryptLambdaEnvironmentVariablesWithCMK runbook encrypts, at rest, the environment variables for the AWS Lambda (Lambda) function you specify using an AWS Key Management Service (AWS KMS) customer managed key. This runbook should only be used as a baseline to ensure that your Lambda function's environment variables are encrypted according to minimum recommended security best practices. We recommend encrypting multiple functions with different customer managed keys. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • FunctionName Type: String Description: (Required) The name or ARN of the Lambda function whose environment variables you want to encrypt. • KMSKeyArn Type: String Description: (Required) The ARN of the AWS KMS customer managed key you want to use to encrypt your Lambda function's environment variables. AWSConfigRemediation-EncryptLambdaEnvironmentVariablesWithCMK 588 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • lambda:GetFunctionConfiguration • lambda:UpdateFunctionConfiguration Document Steps • aws:waitForAwsResourceProperty - Waits for the LastUpdateStatus property to be Successful . • aws:executeAwsApi - Encrypts the environment variables for the Lambda function you specify in the FunctionName parameter using the AWS KMS customer managed key you specify in the KMSKeyArn parameter. • aws:assertAwsResourceProperty - Confirms encryption is enabled on the environment variables for your Lambda function. AWSConfigRemediation-MoveLambdaToVPC Description The AWSConfigRemediation-MoveLambdaToVPC runbook moves an AWS Lambda (Lambda) function to an Amazon Virtual Private Cloud (Amazon VPC). Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-MoveLambdaToVPC 589 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your
|
systems-manager-automation-runbook-guide-141
|
systems-manager-automation-runbook-guide.pdf
| 141 |
AWS KMS customer managed key you specify in the KMSKeyArn parameter. • aws:assertAwsResourceProperty - Confirms encryption is enabled on the environment variables for your Lambda function. AWSConfigRemediation-MoveLambdaToVPC Description The AWSConfigRemediation-MoveLambdaToVPC runbook moves an AWS Lambda (Lambda) function to an Amazon Virtual Private Cloud (Amazon VPC). Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-MoveLambdaToVPC 589 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • FunctionName Type: String Description: (Required) The name of the Lambda function to move to an Amazon VPC. • SecurityGroupIds Type: String Description: (Required) The security group IDs you want to assign to the elastic network interfaces (ENIs) associated with your Lambda function. • SubnetIds Type: String Description: (Required) The subnet IDs you want to create the elastic network interfaces (ENIs) associated with your Lambda function. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • lambda:GetFunction • lambda:GetFunctionConfiguration • lambda:UpdateFunctionConfiguration AWSConfigRemediation-MoveLambdaToVPC 590 AWS Systems Manager Automation runbook reference User Guide Document Steps • aws:executeAwsApi - Updates the Amazon VPC configuration for the Lambda function you specify in the FunctionName parameter. • aws:waitForAwsResourceProperty - Waits for the Lambda function LastUpdateStatus to be successful . • aws:executeScript - Verifies the Lambda function Amazon VPC configuration has been successfully updated. AWSSupport-RemediateLambdaS3Event Description The AWSSupport-TroubleshootLambdaS3Event runbook provides an automated solution for the procedures outlined in the AWS Knowledge Center articles Why doesn't my Amazon S3 event notification trigger my Lambda function? and Why do I get the error "Unable to validate the following destination configurations" when creating an Amazon S3 event notification to trigger my Lambda function? This runbook helps you identify and remediate why an Amazon Simple Storage Service (Amazon S3) event notification failed to trigger the AWS Lambda function you specified. If the runbook output suggests validating and configuring your Lambda function concurrency, see Asynchronous invocation and AWS Lambda Function scaling . Note "Unable to validate the following destination configurations" errors can also occur due to incorrect Amazon Simple Notification Service (Amazon SNS) and Amazon Simple Queue Service (Amazon SQS) Amazon S3 event configurations. This runbook only checks Lambda function configurations. If after using the runbook, you are still receiving the "Unable to validate the following destination configurations" error, please review any existing Amazon SNS and Amazon SQS Amazon S3 event configurations. Run this Automation (console) Document type Automation Owner AWSSupport-RemediateLambdaS3Event 591 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LambdaFunctionArn Type: String Description: (Required) The ARN of the Lambda function. • S3BucketName Type: String Description: (Required) The name of the Amazon S3 bucket whose event notifications triggers the Lambda function. • Action Type: String Valid values: Troubleshoot | Remediate Description: (Required) The action you want the runbook to perform. The Troubleshoot option helps identify any issues, but does not perform any mutating actions to resolve the issue. The Remediate option helps identify and attempts to resolve issues for you. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSSupport-RemediateLambdaS3Event 592 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetDocument • ssm:ListDocuments • ssm:DescribeAutomationExecutions • ssm:DescribeAutomationStepExecutions • ssm:GetAutomationExecution • lambda:GetPolicy • lambda:AddPermission • s3:GetBucketNotification Document Steps • aws:branch - Branches based on the input specified for the Action parameter. If the value specified is Troubleshoot : • aws:executeAutomation - Runs the AWSSupport-TroubleshootLambdaS3Event runbook. • aws:executeAwsApi - Checks the output of the AWSSupport- TroubleshootLambdaS3Event runbook that ran in the previous step. If the value specified is Remediate : • aws:executeScript - Runs a script to remediate the issues outlined in the Why doesn't my Amazon S3 event notification trigger my Lambda function? and Why do I get the error "Unable to validate the following destination configurations" when creating an Amazon S3 event notification to trigger my Lambda function? Knowledge Center articles. Outputs checkoutput.Output remediatelambdas3event.Output AWSSupport-TroubleshootLambdaInternetAccess Description AWSSupport-TroubleshootLambdaInternetAccess 593 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-TroubleshootLambdaInternetAccess runbook helps you troubleshoot internet access issues for a AWS Lambda function that was launched into Amazon Virtual Private Cloud (Amazon VPC). Resources such as subnet routes, security groups rules, and network access control list (ACL) rules are reviewed to confirm outbound internet access is allowed. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux,
|
systems-manager-automation-runbook-guide-142
|
systems-manager-automation-runbook-guide.pdf
| 142 |
I get the error "Unable to validate the following destination configurations" when creating an Amazon S3 event notification to trigger my Lambda function? Knowledge Center articles. Outputs checkoutput.Output remediatelambdas3event.Output AWSSupport-TroubleshootLambdaInternetAccess Description AWSSupport-TroubleshootLambdaInternetAccess 593 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-TroubleshootLambdaInternetAccess runbook helps you troubleshoot internet access issues for a AWS Lambda function that was launched into Amazon Virtual Private Cloud (Amazon VPC). Resources such as subnet routes, security groups rules, and network access control list (ACL) rules are reviewed to confirm outbound internet access is allowed. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • FunctionName Type: String Description: (Required) The name of the Lambda function you want to troubleshoot internet access for. • destinationIp Type: String Description: (Required) The destination IP address you want to establish an outbound connection to. • destinationPort AWSSupport-TroubleshootLambdaInternetAccess 594 AWS Systems Manager Automation runbook reference User Guide Type: String Default: 443 Description: (Optional) The destination port you want to establish an outbound connection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • lambda:GetFunction • ec2:DescribeRouteTables • ec2:DescribeNatGateways • ec2:DescribeSecurityGroups • ec2:DescribeNetworkAcls Document Steps • aws:executeScript - Verifies the configuration of various resources in your VPC where the Lambda function was launched. • aws:branch - Branches based on whether the Lambda function specified is in a VPC or not. • aws:executeScript - Reviews the route table routes for the subnet where the Lambda function was launched, and verifies that routes to a network address translation (NAT) gateway, and internet gateway are present. Confirms the Lambda function is not in a public subnet. • aws:executeScript - Verifies the security group associated with the Lambda function allows outbound internet access based on the values specified for the destinationIp and destinationPort parameters. • aws:executeScript - Verifies the ACL rules associated with the subnets of the Lambda function and the NAT gateway allow outbound internet access based on the values specified for the destinationIp and destinationPort parameters. Outputs checkVpc.vpc - The ID of the VPC where your Lambda function was launched. AWSSupport-TroubleshootLambdaInternetAccess 595 AWS Systems Manager Automation runbook reference User Guide checkVpc.subnet - The IDs of the subnets where your Lambda function was launched. checkVpc.securityGroups - Security groups associated with the Lambda function. checkNACL.NACL - Analysis message with resource names. LambdaIp refers to the private IP address of the elastic network interface for your Lambda function. The LambdaIpRules object is only generated for subnets that have a route to a NAT gateway. The following content is an example of the output. { "subnet-1234567890":{ "NACL":"acl-1234567890", "destinationIp_Egress":"Allowed", "destinationIp_Ingress":"notAllowed", "Analysis":"This NACL has an allow rule for Egress traffic but there is no Ingress rule. Please allow the destination IP / destionation port in Ingress rule", "LambdaIpRules":{ "{LambdaIp}":{ "Egress":"notAllowed", "Ingress":"notAllowed", "Analysis":"This is a NAT subnet NACL. It does not have ingress or egress rule allowed in it for Lambda's corresponding private ip {LambdaIp} Please allow this IP in your egress and ingress NACL rules" } } }, "subnet-0987654321":{ "NACL":"acl-0987654321", "destinationIp_Egress":"Allowed", "destinationIp_Ingress":"notAllowed", "Analysis":"This NACL has an allow rule for Egress traffic but there is no Ingress rule. Please allow the destination IP / destionation port in Ingress rule" } } checkSecurityGroups.secgrps - Analysis for the security group associated with your Lambda function. The following content is an example of the output. { "sg-123456789":{ "Status":"Allowed", "Analysis":"This security group has allowed destintion IP and port in its outbuond rule." AWSSupport-TroubleshootLambdaInternetAccess 596 AWS Systems Manager Automation runbook reference User Guide } } checkSubnet.subnets - Analysis for the subnets in your VPC associated with your Lambda function. The following content is an example of the output. { "subnet-0c4ee6cdexample15":{ "Route":{ "DestinationCidrBlock":"8.8.8.0/26", "NatGatewayId":"nat-00f0example69fdec", "Origin":"CreateRoute", "State":"active" }, "Analysis":"This Route Table has an active NAT gateway path. Also, The NAT gateway is launched in public subnet", "RouteTable":"rtb-0b1fexample16961b" } } AWSSupport-TroubleshootLambdaS3Event Description The AWSSupport-TroubleshootLambdaS3Event runbook provides an automated solution for the procedures outlined in the AWS Knowledge Center articles Why doesn't my Amazon S3 event notification trigger my Lambda function? and Why do I get the error "Unable to validate the following destination configurations" when creating an Amazon S3 event notification to trigger my Lambda function? This runbook helps you identify why an Amazon Simple Storage Service (Amazon S3) event notification failed to trigger the AWS Lambda function you specified. If the runbook output suggests validating and configuring your Lambda function concurrency, see Asynchronous invocation and AWS Lambda Function scaling . Run this Automation (console) Document type Automation Owner Amazon AWSSupport-TroubleshootLambdaS3Event 597 AWS Systems Manager Automation
|
systems-manager-automation-runbook-guide-143
|
systems-manager-automation-runbook-guide.pdf
| 143 |
Knowledge Center articles Why doesn't my Amazon S3 event notification trigger my Lambda function? and Why do I get the error "Unable to validate the following destination configurations" when creating an Amazon S3 event notification to trigger my Lambda function? This runbook helps you identify why an Amazon Simple Storage Service (Amazon S3) event notification failed to trigger the AWS Lambda function you specified. If the runbook output suggests validating and configuring your Lambda function concurrency, see Asynchronous invocation and AWS Lambda Function scaling . Run this Automation (console) Document type Automation Owner Amazon AWSSupport-TroubleshootLambdaS3Event 597 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LambdaFunctionArn Type: String Description: (Required) The ARN of the Lambda function that the Amazon S3 event notification triggers. • S3BucketName Type: String Description: (Required) The name of the Amazon S3 bucket whose event notifications triggers the Lambda function. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • lambda:GetPolicy • s3:GetBucketNotification Document Steps • aws:executeScript - Runs the script to validate configuration settings for the Amazon S3 event notification. Validates the resource-based IAM policy for your Lambda function, and generates an AWS Command Line Interface (AWS CLI) command to add the needed permissions AWSSupport-TroubleshootLambdaS3Event 598 AWS Systems Manager Automation runbook reference User Guide if the required permissions are missing from the policy. Validates other Lambda functions resource policies which are part of event notifications for the same S3 bucket and generates an AWS CLI command as output if the required permissions are missing. Outputs lambdaS3Event.output Amazon Managed Workflows for Apache Airflow AWS Systems Manager Automation provides predefined runbooks for Amazon Managed Workflows for Apache Airflow. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-TroubleshootMWAAEnvironmentCreation AWSSupport-TroubleshootMWAAEnvironmentCreation Description The AWSSupport-TroubleshootMWAAEnvironmentCreation runbook provides information to debug Amazon Managed Workflows for Apache Airflow (Amazon MWAA) environment creation issues, and perform checks along with the documented reasons on a best effort basis to help identify the failure. How does it work? The runbook performs the following steps: • Retrieves the details of the Amazon MWAA environment. • Verifies the execution role permissions. • Checks if the environment has permissions to use the provided AWS KMS key for logging, and if the required CloudWatch log group exists. • Parses the logs in the provided log group to locate any errors. • Checks the network configuration to verify if the Amazon MWAA environment has access to the required endpoints. Amazon Managed Workflows for Apache Airflow 599 AWS Systems Manager Automation runbook reference User Guide • Generates a report with the findings. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • airflow:GetEnvironment • cloudtrail:LookupEvents • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcEndpoints • iam:GetPolicy • iam:GetPolicyVersion • iam:GetRolePolicy • iam:ListAttachedRolePolicies • iam:ListRolePolicies • iam:SimulateCustomPolicy • kms:GetKeyPolicy AWSSupport-TroubleshootMWAAEnvironmentCreation 600 AWS Systems Manager Automation runbook reference User Guide • kms:ListAliases • logs:DescribeLogGroups • logs:FilterLogEvents • s3:GetBucketAcl • s3:GetBucketPolicyStatus • s3:GetPublicAccessBlock • s3control:GetPublicAccessBlock • ssm:StartAutomationExecution • ssm:GetAutomationExecution Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-TroubleshootMWAAEnvironmentCreation in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • EnvironmentName (Required): Name of the Amazon MWAA environment you wish to evaluate. 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • GetMWAAEnvironmentDetails: AWSSupport-TroubleshootMWAAEnvironmentCreation 601 AWS Systems Manager Automation runbook reference User Guide Retrieves the details of the Amazon MWAA environment. If this step fails, the automation process will halt and show as Failed. • CheckIAMPermissionsOnExecutionRole: Verifies that the execution role has the required permissions for Amazon MWAA, Amazon S3, CloudWatch Logs, CloudWatch, and Amazon SQS resources. If it detects a customer managed AWS Key Management Service (AWS KMS) key, the automation validates the key's required permissions. This step employs the iam:SimulateCustomPolicy API to ascertain if the automation execution role meets all required permissions. • CheckKMSPolicyOnKMSKey: Checks if the AWS KMS key policy allows the Amazon MWAA environment to use the key for encrypting CloudWatch Logs.
|
systems-manager-automation-runbook-guide-144
|
systems-manager-automation-runbook-guide.pdf
| 144 |
of the Amazon MWAA environment. If this step fails, the automation process will halt and show as Failed. • CheckIAMPermissionsOnExecutionRole: Verifies that the execution role has the required permissions for Amazon MWAA, Amazon S3, CloudWatch Logs, CloudWatch, and Amazon SQS resources. If it detects a customer managed AWS Key Management Service (AWS KMS) key, the automation validates the key's required permissions. This step employs the iam:SimulateCustomPolicy API to ascertain if the automation execution role meets all required permissions. • CheckKMSPolicyOnKMSKey: Checks if the AWS KMS key policy allows the Amazon MWAA environment to use the key for encrypting CloudWatch Logs. If the AWS KMS key is AWS-managed, the automation skips this check. • CheckIfRequiredLogGroupsExists: Checks if the required CloudWatch log groups for the Amazon MWAA environment exist. If not, the automation checks CloudTrail for CreateLogGroup and DeleteLogGroup events. This step also checks for CreateLogGroup events. • BranchOnLogGroupsFindings: Branches based on the existence of CloudWatch log groups related to the Amazon MWAA environment. If at least one log group exists, the automation parses it to locate errors. If no log groups are present, the automation skips the next step. • CheckForErrorsInLogGroups: Parses the CloudWatch log groups to locate errors. • GetRequiredEndPointsDetails: Retrieves the service endpoints utilized by the Amazon MWAA environment. • CheckNetworkConfiguration: Verifies that the Amazon MWAA environment's network configuration meets the requirements, including checks on security groups, network ACLs, subnets, and route table configurations. • CheckEndpointsConnectivity: AWSSupport-TroubleshootMWAAEnvironmentCreation 602 AWS Systems Manager Automation runbook reference User Guide Invokes the AWSSupport-ConnectivityTroubleshooter child automation to validate the Amazon MWAA's connectivity to the required endpoints. • CheckS3BlockPublicAccess: Checks whether the Amazon MWAA environment's Amazon S3 bucket has Block Public Access enabled and also reviews the account's overall Amazon S3 Block Public Access settings. • GenerateReport: Gathers information from the automation and prints the result or output of each step. 7. After completed, review the Outputs section for the detailed results of the execution: • Checking the Amazon MWAA environment execution role permissions: Verifies if the execution role has the required permissions for Amazon MWAA, Amazon S3, CloudWatch Logs, CloudWatch, and Amazon SQS resources. If a Customer Managed AWS KMS key is detected, the automation validates the key's required permissions. • Checking the Amazon MWAA environment AWS KMS key policy: Verifies whether the execution role possesses the necessary permissions for Amazon MWAA, Amazon S3, CloudWatch Logs, CloudWatch, and Amazon SQS resources. Additionally, if a Customer Managed AWS KMS key is detected, the automation checks for the key's required permissions. • Checking the Amazon MWAA environment CloudWatch logs groups: Checks whether the required CloudWatch Log Groups for the Amazon MWAA environment exist. If they do not, the automation then checks CloudTrail to locate CreateLogGroup and DeleteLogGroup events. • Checking the Amazon MWAA environment Route Tables: Checks whether the Amazon VPC route tables in the Amazon MWAA environment are properly configured. • Checking the Amazon MWAA environment Security Groups: Checks if the Amazon MWAA environment Amazon VPC security groups are properly configured. • Checking the Amazon MWAA environment Network ACLs: AWSSupport-TroubleshootMWAAEnvironmentCreation 603 AWS Systems Manager Automation runbook reference User Guide Checks whether the Amazon VPC security groups in the Amazon MWAA environment are properly configured. • Checking the Amazon MWAA environment Subnets: Verifies whether the Amazon MWAA environment's subnets are private. • Checking the Amazon MWAA environment required endpoints connectivity: Verifies whether the Amazon MWAA environment can access the required endpoints. For this purpose, the automation invokes the AWSSupport-ConnectivityTroubleshooter automation. • Checking the Amazon MWAA environment Amazon S3 bucket: Checks whether the Amazon MWAA environment's Amazon S3 bucket has Block Public Access enabled and also reviews the account's Amazon S3 Block Public Access settings. • Checking the Amazon MWAA environment CloudWatch logs groups errors: Parses the existing CloudWatch log groups of the Amazon MWAA environment to locate errors. AWSSupport-TroubleshootMWAAEnvironmentCreation 604 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWSSupport-TroubleshootMWAAEnvironmentCreation 605 AWS Systems Manager Automation runbook reference User Guide Neptune AWS Systems Manager Automation provides predefined runbooks for Amazon Neptune. For more information about runbooks, see Working with runbooks . For information about how to view runbook content, see View runbook content . Topics • AWS-EnableNeptuneDbAuditLogsToCloudWatch • AWS-EnableNeptuneDbBackupRetentionPeriod • AWS-EnableNeptuneClusterDeletionProtection AWS-EnableNeptuneDbAuditLogsToCloudWatch Description The AWS-EnableNeptuneDbAuditLogsToCloudWatch runbook helps you send audit logs for an Amazon Neptune DB cluster to Amazon CloudWatch Logs. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on Neptune 606 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager
|
systems-manager-automation-runbook-guide-145
|
systems-manager-automation-runbook-guide.pdf
| 145 |
how to view runbook content, see View runbook content . Topics • AWS-EnableNeptuneDbAuditLogsToCloudWatch • AWS-EnableNeptuneDbBackupRetentionPeriod • AWS-EnableNeptuneClusterDeletionProtection AWS-EnableNeptuneDbAuditLogsToCloudWatch Description The AWS-EnableNeptuneDbAuditLogsToCloudWatch runbook helps you send audit logs for an Amazon Neptune DB cluster to Amazon CloudWatch Logs. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on Neptune 606 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DbClusterResourceId Type: String Description: (Required) The resource ID of the Neptune DB cluster you want to enable audit logs for. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • neptune:DescribeDBCluster • neptune:ModifyDBCluster • rds:DescribeDBClusters • rds:ModifyDBCluster Document Steps • GetNeptuneDbClusterIdentifier (aws:executeAwsApi) - Returns the ID of the Neptune DB cluster. • VerifyNeptuneDbEngine (aws:assertAwsResourceProperty) - Verifies the Neptune DB engine type is neptune. • EnableNeptuneDbAuditLogs (aws:executeAwsApi) - Enables audit logs for the Neptune DB cluster to be sent CloudWatch Logs. • VerifyNeptuneDbStatus (aws:waitAwsResourceProperty) - Verifies the Neptune DB cluster status is available. • VerifyNeptuneDbAuditLogs (aws:executeScript) - Verifies that audit logs were successfully configured to send to CloudWatch Logs. AWS-EnableNeptuneDbAuditLogsToCloudWatch 607 AWS Systems Manager Automation runbook reference User Guide AWS-EnableNeptuneDbBackupRetentionPeriod Description The AWS-EnableNeptuneDbBackupRetentionPeriod runbook helps you enable automated backups with a backup retention period between 7 and 35 days for an Amazon Neptune DB cluster. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DbClusterResourceId Type: String Description: (Required) The resource ID of the Neptune DB cluster you want to enable backups for. • BackupRetentionPeriod Type: Integer AWS-EnableNeptuneDbBackupRetentionPeriod 608 AWS Systems Manager Automation runbook reference User Guide Valid values: 7-35 Description: (Required) The number of days backups are retained. • PreferredBackupWindow Type: String Description: (Optional) A daily time period of at least 30 minutes when backups are made. The value must be in Universal Time Coordinated (UTC) and use the format: hh24:mm-hh24:mm. The backup retention period can't conflict with the preferred maintenance window. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • neptune:DescribeDBCluster • neptune:ModifyDBCluster • rds:DescribeDBClusters • rds:ModifyDBCluster Document Steps • GetNeptuneDbClusterIdentifier (aws:executeAwsApi) - Returns the ID of the Neptune DB cluster. • VerifyNeptuneDbEngine (aws:assertAwsResourceProperty) - Verifies the Neptune DB engine type is neptune. • VerifyNeptuneDbStatus (aws:waitAwsResourceProperty) - Verifies the Neptune DB cluster status is available. • ModifyNeptuneDbRetentionPeriod (aws:executeAwsApi) - Sets the retention period for the Neptune DB cluster. • VerifyNeptuneDbBackupsEnabled (aws:executeScript) - Verifies the retention period and backup window were successfully set. AWS-EnableNeptuneDbBackupRetentionPeriod 609 AWS Systems Manager Automation runbook reference User Guide AWS-EnableNeptuneClusterDeletionProtection Description The AWS-EnableNeptuneClusterDeletionProtection runbook enables deletion protection for the Amazon Neptune cluster you specify. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DbClusterResourceId Type: String Description: (Required) The ID of the Neptune cluster you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution AWS-EnableNeptuneClusterDeletionProtection 610 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • neptune:DescribeDBCluster • neptune:ModifyDBCluster • rds:DescribeDBClusters • rds:ModifyDBCluster Document Steps • GetNeptuneDbClusterIdentifier (aws:executeAwsApi) - Returns the ID of the Neptune DB cluster. • VerifyNeptuneDbEngine (aws:assertAwsResourceProperty) - Verifies the engine type of the specified DB cluster is neptune. • VerifyNeptuneStatus (aws:waitForAwsResourceProperty) - Verifies that status of the cluster is available. • EnableNeptuneDbDeletionProtection (aws:executeAwsApi) - Enables deletion protection on the Neptune DB cluster. • VerifyNeptuneDbDeletionProtection (aws:assertAwsResourceProperty) - Verifies deletion protection is enabled on the DB cluster. Outputs • EnableNeptuneDbDeletionProtection.EnableNeptuneDbDeletionProtectionResponse - The output from the API operation. Amazon RDS AWS Systems Manager Automation provides predefined runbooks for Amazon Relational Database Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CreateEncryptedRdsSnapshot • AWS-CreateRdsSnapshot • AWSConfigRemediation-DeleteRDSCluster Amazon RDS 611 AWS Systems Manager Automation runbook reference User Guide • AWSConfigRemediation-DeleteRDSClusterSnapshot • AWSConfigRemediation-DeleteRDSInstance • AWSConfigRemediation-DeleteRDSInstanceSnapshot • AWSConfigRemediation-DisablePublicAccessToRDSInstance • AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSCluster • AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSDBInstance • AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance • AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS • AWSConfigRemediation-EnableMultiAZOnRDSInstance
|
systems-manager-automation-runbook-guide-146
|
systems-manager-automation-runbook-guide.pdf
| 146 |
protection on the Neptune DB cluster. • VerifyNeptuneDbDeletionProtection (aws:assertAwsResourceProperty) - Verifies deletion protection is enabled on the DB cluster. Outputs • EnableNeptuneDbDeletionProtection.EnableNeptuneDbDeletionProtectionResponse - The output from the API operation. Amazon RDS AWS Systems Manager Automation provides predefined runbooks for Amazon Relational Database Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CreateEncryptedRdsSnapshot • AWS-CreateRdsSnapshot • AWSConfigRemediation-DeleteRDSCluster Amazon RDS 611 AWS Systems Manager Automation runbook reference User Guide • AWSConfigRemediation-DeleteRDSClusterSnapshot • AWSConfigRemediation-DeleteRDSInstance • AWSConfigRemediation-DeleteRDSInstanceSnapshot • AWSConfigRemediation-DisablePublicAccessToRDSInstance • AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSCluster • AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSDBInstance • AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance • AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS • AWSConfigRemediation-EnableMultiAZOnRDSInstance • AWSConfigRemediation-EnablePerformanceInsightsOnRDSInstance • AWSConfigRemediation-EnableRDSClusterDeletionProtection • AWSConfigRemediation-EnableRDSInstanceBackup • AWSConfigRemediation-EnableRDSInstanceDeletionProtection • AWSConfigRemediation-ModifyRDSInstancePortNumber • AWSSupport-ModifyRDSSnapshotPermission • AWSPremiumSupport-PostgreSQLWorkloadReview • AWS-RebootRdsInstance • AWSSupport-ShareRDSSnapshot • AWS-StartRdsInstance • AWS-StartStopAuroraCluster • AWS-StopRdsInstance • AWSSupport-TroubleshootConnectivityToRDS • AWSSupport-TroubleshootRDSIAMAuthentication • AWSSupport-ValidateRdsNetworkConfiguration AWS-CreateEncryptedRdsSnapshot Description The AWS-CreateEncryptedRdsSnapshot runbook creates an encrypted snapshot from an unencrypted Amazon Relational Database Service (Amazon RDS) instance. AWS-CreateEncryptedRdsSnapshot 612 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier Type: String Description: (Required) The ID of the Amazon RDS instance you want to create a snapshot of. • DBSnapshotIdentifier Type: String Description: (Optional) The name template for the Amazon RDS snapshot. The default name template is DBInstanceIdentifier-yyyymmddhhmmss. • EncryptedDBSnapshotIdentifier Type: String Description: (Optional) The name for the encrypted snapshot. The default name is the value you specify for the DBSnapshotIdentifier parameter appended with -encrypted. AWS-CreateEncryptedRdsSnapshot 613 AWS Systems Manager Automation runbook reference User Guide • InstanceTags Type: String Description: (Optional) Tags to add to the DB instance. (Example: Key=tagKey1,Value=tagValue1;Key=tagKey2,Value=tagValue2)' • KmsKeyId Type: String Default: alias/aws/rds Description: (Optional) The ARN, key ID, or the key alias of the of the customer managed key you want to use to encrypt the snapshot. • SnapshotTags Type: String Description: (Optional) Tags to add to the snapshot. (Example: Key=tagKey1,Value=tagValue1;Key=tagKey2,Value=tagValue2)' Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • rds:AddTagsToResource • rds:CopyDBSnapshot • rds:CreateDBSnapshot • rds:DeleteDBSnapshot • rds:DescribeDBSnapshots Document Steps • aws:executeScript - Creates a snapshot of the DB instance you specify in the DBInstanceIdentifier parameter. • aws:executeScript - Verifies the snapshot created in the previous step exists and is available. AWS-CreateEncryptedRdsSnapshot 614 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Copies the previously created snapshot to an encrypted snapshot. • aws:executeScript - Verifies the encrypted snapshot created in the previous step exists. Outputs CopyRdsSnapshotToEncryptedRdsSnapshot.EncryptedSnapshotId - The ID of the encrypted Amazon RDS snapshot. AWS-CreateRdsSnapshot Description Create an Amazon Relational Database Service (Amazon RDS) snapshot for an Amazon RDS instance. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier Type: String AWS-CreateRdsSnapshot 615 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The DBInstanceId ID of the RDS Instance to create Snapshot from. • DBSnapshotIdentifier Type: String Description: (Optional) The DBSnapshotIdentifier ID of the RDS snapshot to create. • InstanceTags Type: String Description: (Optional) Tags to create for instance. • SnapshotTags Type: String Description: (Optional) Tags to create for snapshot. Document Steps createRDSSnapshot – Creates the RDS snapshot and returns the snapshot ID. verifyRDSSnapshot – Checks that the snapshot created in the previous step exists. Outputs createRDSSnapshot.SnapshotId – The ID of the created snapshot. AWSConfigRemediation-DeleteRDSCluster Description The AWSConfigRemediation-DeleteRDSCluster runbook deletes the Amazon Relational Database Service (Amazon RDS) cluster you specify. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation AWSConfigRemediation-DeleteRDSCluster 616 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DBClusterId Type: String Description: (Required) The resource identifier for the DB cluster you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DeleteDBCluster • rds:DeleteDBInstance • rds:DescribeDBClusters Document Steps • aws:executeScript - Deletes the DB cluster you specify in the DBClusterId parameter. AWSConfigRemediation-DeleteRDSCluster 617 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-DeleteRDSClusterSnapshot Description The AWSConfigRemediation-DeleteRDSClusterSnapshot runbook deletes
|
systems-manager-automation-runbook-guide-147
|
systems-manager-automation-runbook-guide.pdf
| 147 |
(ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DBClusterId Type: String Description: (Required) The resource identifier for the DB cluster you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DeleteDBCluster • rds:DeleteDBInstance • rds:DescribeDBClusters Document Steps • aws:executeScript - Deletes the DB cluster you specify in the DBClusterId parameter. AWSConfigRemediation-DeleteRDSCluster 617 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-DeleteRDSClusterSnapshot Description The AWSConfigRemediation-DeleteRDSClusterSnapshot runbook deletes the given Amazon Relational Database Service (Amazon RDS) cluster snapshot. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DBClusterSnapshotId Type: String Description: (Required) The Amazon RDS cluster snapshot identifier to be deleted. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution AWSConfigRemediation-DeleteRDSClusterSnapshot 618 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution • rds:DeleteDBClusterSnapshot • rds:DescribeDBClusterSnapshots Document Steps • aws:branch - Checks if the cluster snapshot is in the available state. If it is not available, the flow ends. • aws:executeAwsApi - Deletes the given Amazon RDS cluster snapshot using the database (DB) cluster snapshot identifier. • aws:executeScript - Verifies that the given Amazon RDS cluster snapshot was deleted. AWSConfigRemediation-DeleteRDSInstance Description The AWSConfigRemediation-DeleteRDSInstance runbook deletes the Amazon Relational Database Service (Amazon RDS) instance you specify. When you delete a database (DB) instance, all automated backups for that instance are deleted and can't be recovered. Manual DB snapshots are not deleted. If the DB instance you want to delete is in the failed , incompatible-network , or incompatible-restore state, you must set the SkipFinalSnapshot parameter to true . Note If the DB instance you want to delete is in an Amazon Aurora DB cluster, the runbook will not delete the DB instance if it is a read replica and the only instance in the DB cluster. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-DeleteRDSInstance 619 AWS Systems Manager Automation runbook reference User Guide Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to delete. • SkipFinalSnapshot Type: Boolean Default: false Description: (Optional) If set to true , a final snapshot is not created before the DB instance is deleted. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DeleteDBInstance • rds:DescribeDBInstances Document Steps • aws:executeAwsApi - Gathers the DB instance name from the value you specify in the DbiResourceId parameter. AWSConfigRemediation-DeleteRDSInstance 620 AWS Systems Manager Automation runbook reference User Guide • aws:branch - Branches based on the value you specify in the SkipFinalSnapshot parameter. • aws:executeAwsApi - Deletes the DB instance you specify in the DbiResourceId parameter. • aws:executeAwsApi - Deletes the DB instance you specify in the DbiResourceId parameter after the final snapshot is created. • aws:assertAwsResourceProperty - Verifies the DB instance was deleted. AWSConfigRemediation-DeleteRDSInstanceSnapshot Description The AWSConfigRemediation-DeleteRDSInstanceSnapshot runbook deletes the Amazon Relational Database Service (Amazon RDS) instance snapshot you specify. Only snapshots in the available state are deleted. This runbook does not support deleting snapshots from Amazon Aurora database instances. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbSnapshotId AWSConfigRemediation-DeleteRDSInstanceSnapshot 621 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The ID of the snapshot you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DeleteDBSnapshot • rds:DescribeDBSnapshots Document Steps • aws:executeAwsApi - Gathers the state of the snapshot specified in the DbSnapshotId parameter. • aws:assertAwsResourceProperty - Confirms the state of the snapshot is available . • aws:executeAwsApi - Deletes the snapshot specified in the DbSnapshotId parameter. • aws:executeScript - Verifies the snapshot has been deleted. AWSConfigRemediation-DisablePublicAccessToRDSInstance Description The AWSConfigRemediation-DisablePublicAccessToRDSInstance runbook disables public accessibility for the Amazon Relational Database Service (Amazon RDS) database (DB) instance that you specify. Run this Automation (console) Document type Automation Owner AWSConfigRemediation-DisablePublicAccessToRDSInstance 622 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the
|
systems-manager-automation-runbook-guide-148
|
systems-manager-automation-runbook-guide.pdf
| 148 |
Gathers the state of the snapshot specified in the DbSnapshotId parameter. • aws:assertAwsResourceProperty - Confirms the state of the snapshot is available . • aws:executeAwsApi - Deletes the snapshot specified in the DbSnapshotId parameter. • aws:executeScript - Verifies the snapshot has been deleted. AWSConfigRemediation-DisablePublicAccessToRDSInstance Description The AWSConfigRemediation-DisablePublicAccessToRDSInstance runbook disables public accessibility for the Amazon Relational Database Service (Amazon RDS) database (DB) instance that you specify. Run this Automation (console) Document type Automation Owner AWSConfigRemediation-DisablePublicAccessToRDSInstance 622 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance that you want to disable public accessibility for. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Verifies the DB instances is in an AVAILABLE state. • aws:executeAwsApi - Disables public accessibility on your DB instance. AWSConfigRemediation-DisablePublicAccessToRDSInstance 623 AWS Systems Manager Automation runbook reference User Guide • aws:waitForAwsResourceProperty - Waits for the DB instance to change to a MODIFYING state. • aws:waitForAwsResourceProperty - Waits for the DB instance to change to an AVAILABLE state. • aws:assertAwsResourceProperty - Confirms public accessibility is disabled on the DB instance. AWSConfigRemediation- EnableCopyTagsToSnapshotOnRDSCluster Description The AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSCluster runbook enables the CopyTagsToSnapshot setting on the Amazon Relational Database Service (Amazon RDS) cluster you specify. Enabling this setting copies all tags from the DB cluster to snapshots of the DB cluster. The default is not to copy them. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • ApplyImmediately Type: Boolean Default: false AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSCluster 624 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) If you specify true for this parameter, the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB cluster. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbClusterResourceId Type: String Description: (Required) The resource identifier for the DB cluster you want to enable the CopyTagsToSnapshot setting on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DescribeDBClusters • rds:ModifyDBCluster Document Steps • aws:executeAwsApi - Gathers the DB cluster identifier from the DB cluster resource identifier. • aws:assertAwsResourceProperty - Confirms the DB cluster is in an AVAILABLE state. • aws:executeAwsApi - Enables the CopyTagsToSnapshot setting on your DB cluster. • aws:assertAwsResourceProperty - Confirms the CopyTagsToSnapshot setting is enabled on your DB cluster. AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSCluster 625 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation- EnableCopyTagsToSnapshotOnRDSDBInstance Description The AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSDBInstance runbook enables the CopyTagsToSnapshot setting on the Amazon Relational Database Service (Amazon RDS) instance you specify. Enabling this setting copies all tags from the DB instance to snapshots of the DB instance. The default is not to copy them. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • ApplyImmediately Type: Boolean Default: false Description: (Optional) If you specify true for this parameter, the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. • AutomationAssumeRole Type: String AWSConfigRemediation-EnableCopyTagsToSnapshotOnRDSDBInstance 626 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable the CopyTagsToSnapshot setting on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Confirms the DB instance is in an AVAILABLE state. • aws:executeAwsApi - Enables the CopyTagsToSnapshot setting on your DB instance. • aws:assertAwsResourceProperty - Confirms the CopyTagsToSnapshot setting is enabled on your DB instance. AWSConfigRemediation- EnableEnhancedMonitoringOnRDSInstance Description AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance 627 AWS Systems Manager Automation runbook reference User Guide The AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance runbook enables Enhanced Monitoring on the Amazon RDS database instance you specify. For information on Enhanced Monitoring, see Enhanced Monitoring in the Amazon RDS
|
systems-manager-automation-runbook-guide-149
|
systems-manager-automation-runbook-guide.pdf
| 149 |
ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Confirms the DB instance is in an AVAILABLE state. • aws:executeAwsApi - Enables the CopyTagsToSnapshot setting on your DB instance. • aws:assertAwsResourceProperty - Confirms the CopyTagsToSnapshot setting is enabled on your DB instance. AWSConfigRemediation- EnableEnhancedMonitoringOnRDSInstance Description AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance 627 AWS Systems Manager Automation runbook reference User Guide The AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance runbook enables Enhanced Monitoring on the Amazon RDS database instance you specify. For information on Enhanced Monitoring, see Enhanced Monitoring in the Amazon RDS User Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • MonitoringInterval Type: Integer Valid values: 1 | 5 | 10 | 15 | 30 | 60 Description: (Required) The interval in seconds when Enhanced Monitoring metrics are collected from the DB instance. • MonitoringRoleArn Type: String Description: (Required) The Amazon Resource Name (ARN) of the IAM role that allows Amazon RDS to send Enhanced Monitoring metrics to Amazon CloudWatch Logs. AWSConfigRemediation-EnableEnhancedMonitoringOnRDSInstance 628 AWS Systems Manager Automation runbook reference User Guide • ResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable Enhanced Monitoring on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Confirms the DB Instance is in an AVAILABLE state. • aws:executeAwsApi - Enables Enhanced Monitoring on your DB instance. • aws:executeScript - Confirms that Enhanced Monitoring is enabled on your DB instance. AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS Description The AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS runbook enables the AutoMinorVersionUpgrade setting on the Amazon RDS database instance you specify. Enabling this setting means that minor version upgrades are applied automatically to the DB instance during the maintenance window. Run this Automation (console) Document type AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS 629 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to the AutoMinorVersionUpgrade setting on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. AWSConfigRemediation-EnableMinorVersionUpgradeOnRDS 630 AWS Systems Manager Automation runbook reference User Guide • aws:assertAwsResourceProperty - Confirms the DB Instance is in an AVAILABLE state. • aws:executeAwsApi - Enables the AutoMinorVersionUpgrade setting on your DB instance. • aws:executeScript - Confirms that the AutoMinorVersionUpgrade setting is enabled on your DB instance. AWSConfigRemediation-EnableMultiAZOnRDSInstance Description The AWSConfigRemediation-EnableMultiAZOnRDSInstance runbook changes your Amazon Relational Database Service (Amazon RDS) database (DB) instance to a Multi-AZ deployment. Changing this setting doesn't result in an outage. The change is applied during the next maintenance window unless you set the ApplyImmediately parameter to true . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • ApplyImmediately Type: Boolean Default: false Description: (Optional) If you specify true for this parameter, the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. AWSConfigRemediation-EnableMultiAZOnRDSInstance 631 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The AWS Region-unique, immutable identifier for the DB instance to enable the MultiAZ setting. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • rds:DescribeDBInstances • rds:ModifyDBInstance • ssm:StartAutomationExecution • ssm:GetAutomationExecution Document Steps • aws:executeAwsApi - Retrieves the DB instance name using the value provided in the DBInstanceId parameter. • aws:executeAwsApi - Verifies the DBInstanceStatus is available . • aws:branch - Checks whether the MultiAZ is already set to true on the DB instance you specify in the DbiResourceId parameter. • aws:executeAwsApi - Changes the MultiAZ setting to true on the DB instance you specify in the DbiResourceId parameter. • aws:assertAwsResourceProperty - Verifies the MultiAZ is set to true on the DB instance you specify in the DbiResourceId parameter. AWSConfigRemediation-EnableMultiAZOnRDSInstance 632 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation- EnablePerformanceInsightsOnRDSInstance Description The AWSConfigRemediation-EnablePerformanceInsightsOnRDSInstance runbook enables Performance Insights
|
systems-manager-automation-runbook-guide-150
|
systems-manager-automation-runbook-guide.pdf
| 150 |
DB instance name using the value provided in the DBInstanceId parameter. • aws:executeAwsApi - Verifies the DBInstanceStatus is available . • aws:branch - Checks whether the MultiAZ is already set to true on the DB instance you specify in the DbiResourceId parameter. • aws:executeAwsApi - Changes the MultiAZ setting to true on the DB instance you specify in the DbiResourceId parameter. • aws:assertAwsResourceProperty - Verifies the MultiAZ is set to true on the DB instance you specify in the DbiResourceId parameter. AWSConfigRemediation-EnableMultiAZOnRDSInstance 632 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation- EnablePerformanceInsightsOnRDSInstance Description The AWSConfigRemediation-EnablePerformanceInsightsOnRDSInstance runbook enables Performance Insights on the Amazon RDS DB instance you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable Performance Insights on. • PerformanceInsightsKMSKeyId Type: String Default: alias/aws/rds AWSConfigRemediation-EnablePerformanceInsightsOnRDSInstance 633 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN), key ID, or the key alias of the AWS Key Management Service (AWS KMS) customer managed key you want Performance Insights to use to encrypt all potentially sensitive data. If you enter the key alias for this parameter, prefix the value with alias/ . If you do not specify a value for this parameter, the AWS managed key is used. • PerformanceInsightsRetentionPeriod Type: Integer Valid values: 7, 731 Default: 7 Description: (Optional) The number of days you want to retain Performance Insights data. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • kms:CreateGrant • kms:DescribeKey • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Confirms the DB instance status is available . • aws:executeAwsApi - Gathers the ARN of the AWS KMS customer managed key specified in the PerformanceInsightsKMSKeyId parameter. • aws:branch - Checks whether a value is already assigned to the PerformanceInsightsKMSKeyId property of the DB instance. AWSConfigRemediation-EnablePerformanceInsightsOnRDSInstance 634 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Enables Performance Insights on the DB instance you specify in the DbiResourceId parameter. • aws:assertAwsResourceProperty - Confirms the value specified for the PerformanceInsightsKMSKeyId parameter was used to enable encryption for Performance Insights on the DB instance. • aws:assertAwsResourceProperty - Confirms Performance Insights is enabled on the DB instance. AWSConfigRemediation-EnableRDSClusterDeletionProtection Description The AWSConfigRemediation-EnableRDSClusterDeletionProtection runbook enables deletion protection on the Amazon Relational Database Service (Amazon RDS) cluster you specify. AWS Config must be enabled in the AWS Region where you run this automation. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterId AWSConfigRemediation-EnableRDSClusterDeletionProtection 635 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The resource identifier for the DB cluster you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • config:GetResourceConfigHistory • rds:DescribeDBClusters • rds:ModifyDBCluster Document Steps • aws:executeAwsApi - Gathers the DB cluster name from the DB cluster resource identifier. • aws:assertAwsResourceProperty - Verifies the DB cluster status is available . • aws:executeAwsApi - Enables deletion protection on the DB cluster you specify in the ClusterId parameter. • aws:assertAwsResourceProperty - Verifies deletion protection has been enabled on the DB cluster. AWSConfigRemediation-EnableRDSInstanceBackup Description The AWSConfigRemediation-EnableRDSInstanceBackup runbook enables backups for the Amazon Relational Database Service (Amazon RDS) database instance you specify. This runbook does not support enabling backups for Amazon Aurora database instances. Run this Automation (console) Document type AWSConfigRemediation-EnableRDSInstanceBackup 636 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Databases Parameters • ApplyImmediately Type: Boolean Default: false Description: (Optional) If you specify true for this parameter, the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BackupRetentionPeriod Type: Integer Valid values: 1-35 Description: (Required) The number of days that backups are retained. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable backups for. • PreferredBackupWindow AWSConfigRemediation-EnableRDSInstanceBackup 637 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The daily time range (in UTC)
|
systems-manager-automation-runbook-guide-151
|
systems-manager-automation-runbook-guide.pdf
| 151 |
possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BackupRetentionPeriod Type: Integer Valid values: 1-35 Description: (Required) The number of days that backups are retained. • DbiResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable backups for. • PreferredBackupWindow AWSConfigRemediation-EnableRDSInstanceBackup 637 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The daily time range (in UTC) during which backups are created. Constraints: • Must be in the format hh24:mi-hh24:mi • Must be in Coordinated Universal Time (UTC) • Must not conflict with the preferred maintenance window • Must be at least 30 minutes Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeScript - Gathers the DB instance identifier from the DB instance resource identifier. Enables backups for your DB instance. Confirms backups are enabled on the DB instance. AWSConfigRemediation-EnableRDSInstanceDeletionProtection Description The AWSConfigRemediation-EnableRDSInstanceDeletionProtection runbook enables deletion protection on the Amazon RDS database instance you specify. Run this Automation (console) Document type AWSConfigRemediation-EnableRDSInstanceDeletionProtection 638 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Databases Parameters • ApplyImmediately Type: Boolean Default: false Description: (Optional) If you specify true for this parameter, the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB instance. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DbInstanceResourceId Type: String Description: (Required) The resource identifier for the DB instance you want to enable deletion protection on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution AWSConfigRemediation-EnableRDSInstanceDeletionProtection 639 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:executeAwsApi - Enables deletion protection on your DB instance. • aws:assertAwsResourceProperty - Confirms deletion protection is enabled on the DB instance. AWSConfigRemediation-ModifyRDSInstancePortNumber Description The AWSConfigRemediation-ModifyRDSInstancePortNumber runbook modifies the port number on which the Amazon Relational Database Service (Amazon RDS) instance accepts connections. Running this automation will restart the database. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String AWSConfigRemediation-ModifyRDSInstancePortNumber 640 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • PortNumber Type: String Description: (Optional) The port number you want the DB instance to accept connections on. • RDSDBInstanceResourceId Type: String Description: (Required) The resource identifier for the DB instance whose inbound port number you want to modify. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBInstances • rds:ModifyDBInstance Document Steps • aws:executeAwsApi - Gathers the DB instance identifier from the DB instance resource identifier. • aws:assertAwsResourceProperty - Confirms the DB Instance is in an AVAILABLE state. • aws:executeAwsApi - Modifies the inbound port number on which your DB instance accepts connections. • aws:waitForAwsResourceProperty - Waits for the DB Instance to be in a MODIFYING state. • aws:waitForAwsResourceProperty - Waits for the DB Instance to be in in an AVAILABLE state. AWSConfigRemediation-ModifyRDSInstancePortNumber 641 AWS Systems Manager Automation runbook reference User Guide AWSSupport-ModifyRDSSnapshotPermission Description The AWSSupport-ModifyRDSSnapshotPermission runbook helps you modify permissions for multiple Amazon Relational Database Service (Amazon RDS) snapshots. Using this runbook, you can make snapshots Public or Private and share them with other AWS accounts. Snapshots encrypted with a default KMS key can't be shared with other accounts using this runbook. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AccountIds Type: StringList Default: none Description: (Optional) The IDs of the accounts you want to share snapshots with. This parameter is required if you enter No for the value of the Private parameter. AWSSupport-ModifyRDSSnapshotPermission 642 AWS Systems Manager Automation runbook reference User Guide • AccountPermissionOperation Type: String Valid values: add | remove Default: none Description: (Optional) The type of operation to perform. • Private Type: String Valid
|
systems-manager-automation-runbook-guide-152
|
systems-manager-automation-runbook-guide.pdf
| 152 |
(IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AccountIds Type: StringList Default: none Description: (Optional) The IDs of the accounts you want to share snapshots with. This parameter is required if you enter No for the value of the Private parameter. AWSSupport-ModifyRDSSnapshotPermission 642 AWS Systems Manager Automation runbook reference User Guide • AccountPermissionOperation Type: String Valid values: add | remove Default: none Description: (Optional) The type of operation to perform. • Private Type: String Valid values: Yes | No Description: (Required) Enter No for the value if you want to share snapshots with specific accounts. • SnapshotIdentifiers Type: StringList Description: (Required) The names of the Amazon RDS snapshots whose permission you want to modify. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • rds:DescribeDBSnapshots • rds:ModifyDBSnapshotAttribute Document Steps 1. aws:executeScript - Verifies the IDs of the snapshots provided in the SnapshotIdentifiers parameter. After verifying the IDs, the script checks for encrypted snapshots and outputs a list if any are found. AWSSupport-ModifyRDSSnapshotPermission 643 AWS Systems Manager Automation runbook reference User Guide 2. aws:branch - Branches the automation based on the value you enter for the Private parameter. 3. aws:executeScript - Modifies permissions of the snapshots specified to share it with the accounts specified. 4. aws:executeScript - Modifies permissions of the snapshots to change them from Public to Private . Outputs ValidateSnapshots.EncryptedSnapshots SharewithOtherAccounts.Result MakePrivate.Result MakePrivate.Commands AWSPremiumSupport-PostgreSQLWorkloadReview Description The AWSPremiumSupport-PostgreSQLWorkloadReview runbook captures multiple snapshots of your Amazon Relational Database Service (Amazon RDS) PostgreSQL database usage statistics. The statistics captured are required for an Support Proactive Services expert to perform an operational review. The statistics are collected using a set of custom SQL and shell scripts. These scripts are downloaded to a temporary Amazon Elastic Compute Cloud (Amazon EC2) instance in your AWS account that is created by this runbook. The runbook requires you to provide credentials using an AWS Secrets Manager secret containing a username and password key-value pair. The username must have permissions to query the standard PostgreSQL statistics views and functions. This runbook automatically creates the following AWS resources in your AWS account using an AWS CloudFormation stack. You can monitor the stack creation using the AWS CloudFormation console. • A virtual private cloud (VPC) and an Amazon EC2 instance launched in a private subnet of the VPC with optional connectivity to the internet using a NAT gateway. • An AWS Identity and Access Management (IAM) role that is attached to the temporary Amazon EC2 instance with permissions to retrieve the Secrets Manager secret value. The role also AWSPremiumSupport-PostgreSQLWorkloadReview 644 AWS Systems Manager Automation runbook reference User Guide provides permissions to upload files to an Amazon Simple Storage Service (Amazon S3) bucket of your choice, and optionally to an Support case. • A VPC peering connection to allow connectivity between your DB instance and the temporary Amazon EC2 instance. • Systems Manager, Secrets Manager, and Amazon S3 VPC endpoints that are attached to the temporary VPC. • A maintenance window with registered tasks that periodically start and stop the temporary Amazon EC2 instance, run data collection scripts, and upload files to an Amazon S3 bucket. An IAM role is also created for the maintenance window that provides permissions to perform the registered tasks. When the runbook completes, the AWS CloudFormation stack that is used to create the necessary AWS resources is deleted and the report is uploaded to the Amazon S3 bucket of your choice, and optionally an Support case. Note By default, the root Amazon EBS volume of the temporary Amazon EC2 instance is preserved. You can override this option by setting the EbsVolumeDeleteOnTermination parameter to true. Prerequisites • Enterprise Support subscription This runbook and the Proactive Services Workload Diagnostics and Reviews require an Enterprise Support Subscription. Before using this runbook, contact your Technical Account Manager (TAM) or Specialist TAM (STAM) for instructions. For more information, see Support Proactive Services. • Account and AWS Region quotas Be sure you have not reached the maximum number of Amazon EC2 instances or VPCs that you can create in your account and Region where you use this runbook. If you need to request a limit increase, see the Service limit increase form. • Database configuration 1. The database you specify in the DatabaseName parameter should have the pg_stat_statements extension configured. If you have not configured pg_stat_statements in shared_preload_libraries, then you must edit the value in the DB Parameter Group and apply the changes. Changes to the parameter AWSPremiumSupport-PostgreSQLWorkloadReview 645 AWS Systems Manager Automation runbook reference User Guide shared_preload_libraries requires you to reboot your DB instance. For more information, see Working with parameter groups. Adding pg_stat_statements to shared_preload_libraries
|
systems-manager-automation-runbook-guide-153
|
systems-manager-automation-runbook-guide.pdf
| 153 |
create in your account and Region where you use this runbook. If you need to request a limit increase, see the Service limit increase form. • Database configuration 1. The database you specify in the DatabaseName parameter should have the pg_stat_statements extension configured. If you have not configured pg_stat_statements in shared_preload_libraries, then you must edit the value in the DB Parameter Group and apply the changes. Changes to the parameter AWSPremiumSupport-PostgreSQLWorkloadReview 645 AWS Systems Manager Automation runbook reference User Guide shared_preload_libraries requires you to reboot your DB instance. For more information, see Working with parameter groups. Adding pg_stat_statements to shared_preload_libraries will add some performance overhead. However, this is useful for tracking performance of individual statements. For more information about the pg_stat_statements extension, see the PostgreSQL documentation. If you don't configure the pg_stat_statements extension or if the extension is not present in the database being used for statistics collection, the statement level analysis will not be presented in the operational review. 2. Make sure that track_counts and track_activities parameters are not turned off. If these parameters are turned off in the DB Parameter Group, no meaningful statistics will be available. Changing these parameters will require you to reboot your DB instance. For more information, see Working with parameters on your Amazon RDS for PostgreSQL DB instance. 3. If the track_io_timing parameter is turned off, the I/O level statistics will not be included in the operational review. Changing track_io_timing will require you to reboot your DB instance and will incur additional performance overhead depending on the DB instance workload. Despite the performance overhead for critical workloads, this parameter provides useful information related to I/O time per query. Billing and charges Your AWS account will be charged for the costs associated with the temporary Amazon EC2 instance, associated Amazon EBS volume, the NAT gateway, and the data transferred while this automation is running. By default, this runbook creates a t3.micro Amazon Linux 2 instance to collect the statistics. The runbook starts and stops the instance between steps to reduce costs. Data security and governance This runbook collects statistics by querying the PostgreSQL statistics views and functions. Make sure the credentials provided in the SecretId parameter only allow read-only permissions to the statistics views and functions. As part of the automation, the collection scripts are uploaded to your Amazon S3 bucket and can be located in s3://amzn-s3- demo-bucket/automation execution id/queries/. These scripts collect data that is used by an AWS Specialist to review key performance indicators at object level. The script collects information such as table name, schema name, and index name. If any of this information contains sensitive information like revenue indicators, username, email address, or any other personally identifiable information, then we recommend that you discontinue with this workload review. Contact your AWS TAM to discuss an alternative approach for the workload review. AWSPremiumSupport-PostgreSQLWorkloadReview 646 AWS Systems Manager Automation runbook reference User Guide Make sure you have the necessary approval and clearance to share the statistics and metadata collected by this automation with AWS. Security considerations If you set the UpdateRdsSecurityGroup parameter to yes, the runbook updates the security group associated with your DB instance to allow inbound traffic from the temporary Amazon EC2 instance's private IP address. If you set the UpdateRdsRouteTable parameter to yes, the runbook updates the route table associated with the subnet your DB instance is running in to allow traffic to the temporary Amazon EC2 instance through the VPC peering connection. User creation To allow the collection script to connect to your Amazon RDS database, you must set up a user with permissions to read the statistic views. Then you must store the credentials in Secrets Manager. We recommend creating a new dedicated user for this automation. Creating a separate user allows you to audit and track activities performed by this automation. 1. Create a new user. psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "CREATE USER <user_name> PASSWORD '<password>';" 2. Ensure that this user can only make read-only connections. psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "ALTER USER <user_name> SET default_transaction_read_only=true;" 3. Set user level limits. psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "ALTER USER <user_name> SET work_mem=4096;" psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "ALTER USER <user_name> SET statement_timeout=10000;" psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "ALTER USER <user_name> SET idle_in_transaction_session_timeout=60000;" 4. Grant pg_monitor permissions to the new user so it can access the DB statistics. (The pg_monitor role is a member of pg_read_all_settings, pg_read_all_stats, and pg_stat_scan_table.) AWSPremiumSupport-PostgreSQLWorkloadReview 647 AWS Systems Manager Automation runbook reference User Guide psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "GRANT pg_monitor to <user_name>;" Permissions added to the temporary Amazon EC2 instance profile by this Systems Manager Automation The following permissions are added to the IAM role associated with the temporary Amazon EC2 instance. The AmazonSSMManagedInstanceCore
|
systems-manager-automation-runbook-guide-154
|
systems-manager-automation-runbook-guide.pdf
| 154 |
<admin_user> -c "ALTER USER <user_name> SET statement_timeout=10000;" psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "ALTER USER <user_name> SET idle_in_transaction_session_timeout=60000;" 4. Grant pg_monitor permissions to the new user so it can access the DB statistics. (The pg_monitor role is a member of pg_read_all_settings, pg_read_all_stats, and pg_stat_scan_table.) AWSPremiumSupport-PostgreSQLWorkloadReview 647 AWS Systems Manager Automation runbook reference User Guide psql -h <database_connection_endpoint> -p <database_port> -U <admin_user> -c "GRANT pg_monitor to <user_name>;" Permissions added to the temporary Amazon EC2 instance profile by this Systems Manager Automation The following permissions are added to the IAM role associated with the temporary Amazon EC2 instance. The AmazonSSMManagedInstanceCore managed policy is also associated with the IAM role to allow the Amazon EC2 instance to be managed by Systems Manager. { "Version": "2012-10-17", "Statement": [ { "Action": [ "ec2:DescribeTags" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "s3:GetBucketLocation" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket", "Effect": "Allow" }, { "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/automation execution id/*", "Effect": "Allow" }, { "Action": [ "secretsmanager:GetSecretValue" ], "Resource": "arn:aws:secretsmanager:region:account id:secret:secret id", "Effect": "Allow" }, { "Action": [ AWSPremiumSupport-PostgreSQLWorkloadReview 648 AWS Systems Manager Automation runbook reference User Guide "support:AddAttachmentsToSet", "support:AddCommunicationToCase", "support:DescribeCases" ], "Resource": "*", "Effect": "Allow" } ] } Permissions added to the temporary maintenance window by this Systems Manager Automation The following permissions are automatically added to the IAM role associated with the Maintenance Windows tasks. The Maintenance Windows tasks starts, stops, and sends commands to the temporary Amazon EC2 instance. { "Version": "2012-10-17", "Statement": [ { "Action": [ "ssm:GetAutomationExecution", "ssm:ListCommands", "ssm:ListCommandInvocations", "ssm:GetCommandInvocation", "ssm:GetCalendarState", "ssm:CancelCommand", "ec2:DescribeInstanceStatus" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "ssm:SendCommand", "ec2:StartInstances", "ec2:StopInstances", "ssm:StartAutomationExecution" ], "Resource": [ "arn:aws:ec2:region:account id:instance/temporary instance id", "arn:aws:ssm:*:*:document/AWS-RunShellScript", "arn:aws:ssm:*:*:automation-definition/AWS-StopEC2Instance:$DEFAULT", "arn:aws:ssm:*:*:automation-definition/AWS-StartEC2Instance:$DEFAULT" AWSPremiumSupport-PostgreSQLWorkloadReview 649 AWS Systems Manager Automation runbook reference User Guide ], "Effect": "Allow" }, { "Condition": { "StringEquals": { "iam:PassedToService": "ssm.amazonaws.com" } }, "Action": "iam:PassRole", "Resource": "*", "Effect": "Allow" } ] } Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier Type: String AWSPremiumSupport-PostgreSQLWorkloadReview 650 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The ID of your DB instance. • DatabaseName Type: String Description: (Required) The database name hosted on your DB instance. • SecretId Type: String Description: (Required) The ARN of your Secrets Manager secret containing the username and password key value pair. The AWS CloudFormation stack creates an IAM policy with permissions for the GetSecretValue operation to this ARN. The credentials are used to allow the temporary instance to collect the database statistics. Contact your TAM or STAM to discuss the minimum required permissions. • Acknowledge Type: String Description: (Required) Enter yes if you acknowledge that this runbook will create temporary resources in your account to collect statistics from your DB instance. We recommend contacting your TAM or STAM before running this automation. • SupportCase Type: String Description: (Optional) The Support case number provided by your TAM or STAM. If provided, the runbook updates the case and attaches the data collected. This option requires the temporary Amazon EC2 instance to have internet connectivity to access the Support API endpoint. You must set the AllowVpcInternetAccess parameter to true. The case subject must contain the phrase AWSPremiumSupport-PostgreSQLWorkloadReview. • S3BucketName Type: String Description: (Required) The Amazon S3 bucket name in your account where you want to upload the data collected by the automation. Verify the bucket policy does not grant any unnecessary read or write permissions to principals that do not need access to the contents of the bucket. We AWSPremiumSupport-PostgreSQLWorkloadReview 651 AWS Systems Manager Automation runbook reference User Guide recommend creating a new temporary Amazon S3 bucket for the purpose of this automation. The runbook provides permissions to the s3:PutObject API operation to the IAM role attached to the temporary Amazon EC2 instance. The uploaded files will be located in s3://bucket name/automation execution id/. • InstanceType Type: String Description: (Optional) The type of the temporary Amazon EC2 instance that will run the custom SQL and shell scripts. Valid values: t2.micro | t2.small | t2.medium | t2.large | t3.micro | t3.small | t3.medium | t3.large Default: t3.micro • VpcCidr Type: String Description: (Optional) The IP address range in CIDR notation for the new VPC (for example, 172.31.0.0/16). Make sure you select a CIDR that does not overlap or match any existing VPC with connectivity to your DB instance. The smallest VPC you can create uses a /28 subnet mask, and the largest VPC uses a /16 subnet mask. Default: 172.31.0.0/16 • StackResourcesNamePrefix Type: String Description: (Optional) The AWS CloudFormation stack resources name prefix and tag. The runbook creates the
|
systems-manager-automation-runbook-guide-155
|
systems-manager-automation-runbook-guide.pdf
| 155 |
values: t2.micro | t2.small | t2.medium | t2.large | t3.micro | t3.small | t3.medium | t3.large Default: t3.micro • VpcCidr Type: String Description: (Optional) The IP address range in CIDR notation for the new VPC (for example, 172.31.0.0/16). Make sure you select a CIDR that does not overlap or match any existing VPC with connectivity to your DB instance. The smallest VPC you can create uses a /28 subnet mask, and the largest VPC uses a /16 subnet mask. Default: 172.31.0.0/16 • StackResourcesNamePrefix Type: String Description: (Optional) The AWS CloudFormation stack resources name prefix and tag. The runbook creates the AWS CloudFormation stack resources using this prefix as part of the name and tag applied to the resources. The structure for the tag key-value pair is StackResourcesNamePrefix:{{automation:EXECUTION_ID}}. Default: AWSPostgreSQLWorkloadReview • Schedule Type: String Description: (Optional) The maintenance window schedule. Specifies how often the maintenance window runs the tasks. The default value is every 1 hour. AWSPremiumSupport-PostgreSQLWorkloadReview 652 AWS Systems Manager Automation runbook reference User Guide Valid values: 15 minutes | 30 minutes | 1 hour | 2 hours | 4 hours | 6 hours | 12 hours | 1 day | 2 days | 4 days Default: 1 hour • Duration Type: Integer Description: (Optional) The maximum duration, in minutes, you want to allow the automation to run. The maximum duration supported is 8,640 minutes (6 days). The default value is 4,320 minutes (3 days). Valid values: 30-8640 Default: 4320 • UpdateRdsRouteTable Type: String Description: (Optional) If set to true, the runbook updates the route table associated with the subnet your DB instance runs in. An IPv4 route is added to route traffic to the temporary Amazon EC2 instance private IPV4 address through the newly created VPC peering connection. Valid values: true | false Default: false • AllowVpcInternetAccess Type: String Description: (Optional) If set to true, the runbook creates a NAT gateway to provide internet connectivity to the temporary Amazon EC2 instance to communicate with the Support API endpoint. You can leave this parameter as false if you only want the runbook to upload the output to your Amazon S3 bucket. Valid values: true | false Default: false • UpdateRdsSecurityGroup AWSPremiumSupport-PostgreSQLWorkloadReview 653 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) If set to true, the runbook updates the security group associated with your DB instance to allow traffic from the temporary instance's private IP address. Valid values: false | true Default: false • EbsVolumeDeleteOnTermination Type: String Description: (Optional) If set to true, the temporary Amazon EC2 instance's root volume is deleted after the runbook completes and deletes the AWS CloudFormation stack. Valid values: false | true Default: false Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • cloudformation:CreateStack • cloudformation:DeleteStack • cloudformation:DescribeStackEvents • cloudformation:DescribeStackResource • cloudformation:DescribeStacks • cloudformation:UpdateStack • ec2:AcceptVpcPeeringConnection • ec2:AllocateAddress • ec2:AssociateRouteTable • ec2:AssociateVpcCidrBlock • ec2:AttachInternetGateway • ec2:AuthorizeSecurityGroupEgress AWSPremiumSupport-PostgreSQLWorkloadReview 654 AWS Systems Manager Automation runbook reference User Guide • ec2:AuthorizeSecurityGroupIngress • ec2:CreateEgressOnlyInternetGateway • ec2:CreateInternetGateway • ec2:CreateNatGateway • ec2:CreateRoute • ec2:CreateRouteTable • ec2:CreateSecurityGroup • ec2:CreateSubnet • ec2:CreateTags • ec2:CreateVpc • ec2:CreateVpcEndpoint • ec2:CreateVpcPeeringConnection • ec2:DeleteEgressOnlyInternetGateway • ec2:DeleteInternetGateway • ec2:DeleteNatGateway • ec2:DeleteRoute • ec2:DeleteRouteTable • ec2:DeleteSecurityGroup • ec2:DeleteSubnet • ec2:DeleteTags • ec2:DeleteVpc • ec2:DeleteVpcEndpoints • ec2:DescribeAddresses • ec2:DescribeEgressOnlyInternetGateways • ec2:DescribeImages • ec2:DescribeInstances • ec2:DescribeInstanceStatus • ec2:DescribeInternetGateways • ec2:DescribeNatGateways • ec2:DescribeRouteTables AWSPremiumSupport-PostgreSQLWorkloadReview 655 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeVpcEndpoints • ec2:DescribeVpcPeeringConnections • ec2:DescribeVpcs • ec2:DetachInternetGateway • ec2:DisassociateRouteTable • ec2:DisassociateVpcCidrBlock • ec2:ModifySubnetAttribute • ec2:ModifyVpcAttribute • ec2:RebootInstances • ec2:ReleaseAddress • ec2:RevokeSecurityGroupEgress • ec2:RevokeSecurityGroupIngress • ec2:StartInstances • ec2:StopInstances • ec2:RunInstances • ec2:TerminateInstances • iam:AddRoleToInstanceProfile • iam:AttachRolePolicy • iam:CreateInstanceProfile • iam:CreateRole • iam:DeleteInstanceProfile • iam:DeleteRole • iam:DeleteRolePolicy • iam:DetachRolePolicy • iam:GetInstanceProfile • iam:GetRole • iam:GetRolePolicy • iam:PassRole AWSPremiumSupport-PostgreSQLWorkloadReview 656 AWS Systems Manager Automation runbook reference User Guide • iam:PutRolePolicy • iam:RemoveRoleFromInstanceProfile • iam:TagPolicy • iam:TagRole • rds:DescribeDBInstances • s3:GetAccountPublicAccessBlock • s3:GetBucketAcl • s3:GetBucketPolicyStatus • s3:GetBucketPublicAccessBlock • s3:ListBucket • ssm:AddTagsToResource • ssm:CancelMaintenanceWindowExecution • ssm:CreateDocument • ssm:CreateMaintenanceWindow • ssm:DeleteDocument • ssm:DeleteMaintenanceWindow • ssm:DeregisterTaskFromMaintenanceWindow • ssm:DescribeAutomationExecutions • ssm:DescribeDocument • ssm:DescribeInstanceInformation • ssm:DescribeMaintenanceWindowExecutions • ssm:GetCalendarState • ssm:GetDocument • ssm:GetMaintenanceWindowExecution • ssm:GetParameters • ssm:ListCommandInvocations • ssm:ListCommands • ssm:ListTagsForResource • ssm:RegisterTaskWithMaintenanceWindow • ssm:RemoveTagsFromResource AWSPremiumSupport-PostgreSQLWorkloadReview 657 AWS Systems Manager Automation runbook reference User Guide • ssm:SendCommand • support:AddAttachmentsToSet • support:AddCommunicationToCase • support:DescribeCases Document Steps 1. aws:assertAwsResourceProperty - Confirms the DB instance is in the available state. 2. aws:executeAwsApi - Gathers details about the DB instance. 3. aws:executeScript - Checks if the Amazon S3 bucket specified in the S3BucketName allows anonymous, or public read or write access permissions. 4. aws:executeScript - Gets the AWS CloudFormation template content from the Automation runbook attachment that is used to create the temporary AWS resources in your AWS account. 5. aws:createStack - Creates the AWS CloudFormation stack resources. 6. aws:waitForAwsResourceProperty - Waits until the Amazon EC2 instance created
|
systems-manager-automation-runbook-guide-156
|
systems-manager-automation-runbook-guide.pdf
| 156 |
Guide • ssm:SendCommand • support:AddAttachmentsToSet • support:AddCommunicationToCase • support:DescribeCases Document Steps 1. aws:assertAwsResourceProperty - Confirms the DB instance is in the available state. 2. aws:executeAwsApi - Gathers details about the DB instance. 3. aws:executeScript - Checks if the Amazon S3 bucket specified in the S3BucketName allows anonymous, or public read or write access permissions. 4. aws:executeScript - Gets the AWS CloudFormation template content from the Automation runbook attachment that is used to create the temporary AWS resources in your AWS account. 5. aws:createStack - Creates the AWS CloudFormation stack resources. 6. aws:waitForAwsResourceProperty - Waits until the Amazon EC2 instance created by the AWS CloudFormation template is running. 7. aws:executeAwsApi - Gets the IDs for the temporary Amazon EC2 instance and VPC peering connection created by AWS CloudFormation. 8. aws:executeAwsApi - Gets the IP address for the temporary Amazon EC2 instance to configure connectivity with your DB instance. 9. aws:executeAwsApi - Tags the Amazon EBS volume attached to the temporary Amazon EC2 instance. 10.aws:waitForAwsResourceProperty - Waits until the temporary Amazon EC2 instance passes status checks. 11.aws:waitForAwsResourceProperty - Waits until the temporary Amazon EC2 instance is managed by Systems Manager. If this step times out or fails, then the runbook reboots the instance. a. aws:executeAwsApi - Reboots the temporary Amazon EC2 instance if the previous step failed or timed out. b. aws:waitForAwsResourceProperty - Waits until the temporary Amazon EC2 instance is managed by Systems Manager after reboot. 12.aws:runCommand - Installs the metadata collector application requirements on the temporary Amazon EC2 instance. AWSPremiumSupport-PostgreSQLWorkloadReview 658 AWS Systems Manager Automation runbook reference User Guide 13.aws:runCommand - Configures access to your DB instance by creating a configuration file on the temporary Amazon EC2 instance. 14.aws:executeAwsApi - Creates a maintenance window to periodically run the metadata collector application using Run Command. The maintenance window starts and stops the instance between commands. 15.aws:waitForAwsResourceProperty - Waits until the maintenance window created by the AWS CloudFormation template is ready. 16.aws:executeAwsApi - Gets the IDs for the maintenance window and change calendar created by AWS CloudFormation. 17.aws:sleep - Waits until the end date of the maintenance window. 18.aws:executeAwsApi - Turns off the maintenance window. 19.aws:executeScript - Gets the results of the tasks run during the maintenance window. 20.aws:waitForAwsResourceProperty - Waits for the maintenance window to finish the last task before continuing. 21.aws:branch - Branches the workflow based on whether you provided a value for the SupportCase parameter. a. aws:changeInstanceState - Starts the temporary Amazon EC2 instance and waits for status checks to pass before uploading the report. b. aws:waitForAwsResourceProperty - Waits until the temporary Amazon EC2 instance is managed by Systems Manager. If this step timeouts or fail, then the runbook reboots the instance. i. aws:executeAwsApi - Reboots the temporary Amazon EC2 instance if the previous step failed or timed out. ii. aws:waitForAwsResourceProperty - Waits until the temporary Amazon EC2 instance is managed by Systems Manager after reboot. c. aws:runCommand - Attaches the metadata report to the Support case if you provided a value for the SupportCase parameter. The script compresses and splits the report into 5 MB files. The maximum number of files the script attaches to a Support case is 12. 22.aws:changeInstanceState - Stops the temporary Amazon EC2 instance in case the AWS CloudFormation stack fails to delete. 23.aws:executeAwsApi - Describes the AWS CloudFormation stack events if the runbooks fails to create or update the AWS CloudFormation stack. AWSPremiumSupport-PostgreSQLWorkloadReview 659 AWS Systems Manager Automation runbook reference User Guide 24.aws:waitForAwsResourceProperty - Waits until the AWS CloudFormation stack is in a terminal status before deleting. 25.aws:executeAwsApi - Deletes the AWS CloudFormation stack excluding the maintenance window. The root Amazon EBS volume associated with the temporary Amazon EC2 instance is preserved if the EbsVolumeDeleteOnTermination parameter value was set to false. AWS-RebootRdsInstance Description The AWS-RebootRdsInstance runbook reboots an Amazon Relational Database Service (Amazon RDS) DB instance if it isn't already rebooting. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) The ID of the Amazon RDS DB instance that you want to reboot. AWS-RebootRdsInstance 660 AWS Systems Manager Automation runbook reference User Guide Document Steps RebootInstance - Reboots the DB instance if it is not already rebooting. WaitForAvailableState - Waits for the DB instance to complete the reboot process. Outputs This automation has no outputs. AWSSupport-ShareRDSSnapshot Description The AWSSupport-ShareRDSSnapshot runbook provides an automated solution for the procedure outlined in the Knowledge Center article How can I share an encrypted Amazon RDS DB snapshot with another account? If your Amazon Relational Database Service (Amazon RDS)
|
systems-manager-automation-runbook-guide-157
|
systems-manager-automation-runbook-guide.pdf
| 157 |
• InstanceId Type: String Description: (Required) The ID of the Amazon RDS DB instance that you want to reboot. AWS-RebootRdsInstance 660 AWS Systems Manager Automation runbook reference User Guide Document Steps RebootInstance - Reboots the DB instance if it is not already rebooting. WaitForAvailableState - Waits for the DB instance to complete the reboot process. Outputs This automation has no outputs. AWSSupport-ShareRDSSnapshot Description The AWSSupport-ShareRDSSnapshot runbook provides an automated solution for the procedure outlined in the Knowledge Center article How can I share an encrypted Amazon RDS DB snapshot with another account? If your Amazon Relational Database Service (Amazon RDS) snapshot was encrypted using the default AWS managed key, you cannot share the snapshot. In this case, you must copy the snapshot using a customer managed key, and then share the snapshot with the target account. This automation performs these steps using the value you specify in the SnapshotName parameter, or the latest snapshot found for the selected Amazon RDS DB instance or cluster. Note If you do not specify a value for the KMSKey parameter, the automation creates a new AWS KMS customer managed key in your account that is used to encrypt the snapshot. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSSupport-ShareRDSSnapshot 661 AWS Systems Manager Automation runbook reference User Guide Databases Parameters • AccountIds Type: StringList Description: (Required) Comma-separated list of account IDs to share the snapshot with. • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Database Type: String Description: (Required) The name of the Amazon RDS DB instance or cluster whose snapshot you want to share. This parameter is optional if you specify a value for the SnapshotName parameter. • KMSKey Type: String Description: (Optional) The full Amazon Resource Name (ARN) of the AWS KMS customer managed key used to encrypt the snapshot. • SnapshotName Type: String Description: (Optional) The ID of the DB cluster or instance snapshot that you want to use. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSSupport-ShareRDSSnapshot 662 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • rds:DescribeDBInstances • rds:DescribeDBSnapshots • rds:CopyDBSnapshot • rds:ModifyDBSnapshotAttribute The AutomationAssumeRole requires the following actions to successfully start the runbook for a DB cluster. • ssm:StartAutomationExecution • rds:DescribeDBClusters • rds:DescribeDBClusterSnapshots • rds:CopyDBClusterSnapshot • rds:ModifyDBClusterSnapshotAttribute The IAM role used to run the automation must be added as a key user to use the KMS key specified in the ARNKmsKey parameter. For information about adding key users to a KMS key, see Changing a key policy in the AWS Key Management Service Developer Guide . The AutomationAssumeRole requires the following additional actions to successfully start the runbook if you do not specify a value for the KMSKey parameter. • kms:CreateKey • kms:ScheduleKeyDeletion • kms:CreateGrant • kms:DescribeKey Document Steps 1. aws:executeScript - Checks whether a value was provided for the KMSKey parameter, and creates a AWS KMS customer managed key if no value is found. 2. aws:branch - Checks whether a value was provided for the SnapshotName parameter, and branches accordingly. 3. aws:executeAwsApi - Checks whether the snapshot provided is from a DB instance. AWSSupport-ShareRDSSnapshot 663 AWS Systems Manager Automation runbook reference User Guide 4. aws:executeScript - Formats the SnapshotName parameter replacing colons with a hyphen. 5. aws:executeAwsApi - Copies the snapshot using the specified KMSKey . 6. aws:waitForAwsResourceProperty - Waits for the copy snapshot operation to complete. 7. aws:executeAwsApi - Shares the new snapshot with the AccountIds specified. 8. aws:executeAwsApi - Checks whether the snapshot provided is from a DB cluster. 9. aws:executeScript - Formats the SnapshotName parameter replacing colons with a hyphen. 10.aws:executeAwsApi - Copies the snapshot using the specified KMSKey . 11.aws:waitForAwsResourceProperty - Waits for the copy snapshot operation to complete. 12.aws:executeAwsApi - Shares the new snapshot with the AccountIds specified. 13.aws:executeAwsApi - Checks whether the value provided for the Database parameter is a DB instance. 14.aws:executeAwsApi - Checks whether the value provided for the Database parameter is a DB cluster. 15.aws:executeAwsApi - Retrieves a list of snapshots for the specified Database . 16.aws:executeScript - Determines the latest snapshot available from the list assembled in the previous step. 17.aws:executeAwsApi - Copies the DB instance snapshot using the specified KMSKey . 18.aws:waitForAwsResourceProperty - Waits for the copy snapshot operation to complete. 19.aws:executeAwsApi - Shares the new snapshot with the AccountIds specified. 20.aws:executeAwsApi - Retrieves a list of snapshots for the specified Database . 21.aws:executeScript - Determines the latest snapshot available from the list assembled in the previous step. 22.aws:executeAwsApi - Copies the DB instance snapshot using the specified KMSKey . 23.aws:waitForAwsResourceProperty -
|
systems-manager-automation-runbook-guide-158
|
systems-manager-automation-runbook-guide.pdf
| 158 |
15.aws:executeAwsApi - Retrieves a list of snapshots for the specified Database . 16.aws:executeScript - Determines the latest snapshot available from the list assembled in the previous step. 17.aws:executeAwsApi - Copies the DB instance snapshot using the specified KMSKey . 18.aws:waitForAwsResourceProperty - Waits for the copy snapshot operation to complete. 19.aws:executeAwsApi - Shares the new snapshot with the AccountIds specified. 20.aws:executeAwsApi - Retrieves a list of snapshots for the specified Database . 21.aws:executeScript - Determines the latest snapshot available from the list assembled in the previous step. 22.aws:executeAwsApi - Copies the DB instance snapshot using the specified KMSKey . 23.aws:waitForAwsResourceProperty - Waits for the copy snapshot operation to complete. 24.aws:executeAwsApi - Shares the new snapshot with the AccountIds specified. 25.aws:executeScript - Deletes the AWS KMS customer managed key created by the automation if you did not specify a value for the KMSKey parameter and the automation fails. AWS-StartRdsInstance Description AWS-StartRdsInstance 664 AWS Systems Manager Automation runbook reference User Guide Start an Amazon Relational Database Service (Amazon RDS) instance. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) ID of the Amazon RDS instance to start. AWS-StartStopAuroraCluster Description This runbook starts or stops an Amazon Aurora cluster. Note To start a cluster it must be in a stopped status. To stop a cluster it must be in an available status. This runbook can't be used to start or stop a cluster that is an Aurora AWS-StartStopAuroraCluster 665 AWS Systems Manager Automation runbook reference User Guide Serverless cluster, an Aurora multi-master cluster, part of an Aurora global database, or a cluster that uses Aurora parallel query. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • ClusterName Type: String Description: (Required) The name of the Aurora cluster you want to stop or start. • Action Type: String Valid values: Start | Stop Default: Start Description: (Required) The name of the Aurora cluster you want to stop or start. AWS-StartStopAuroraCluster 666 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • rds:DescribeDBClusters • rds:StartDBCluster • rds:StopDBCluster Document Steps • aws:executeScript - Starts or stops the cluster based on the values you specify for the. Outputs StartStopAuroraCluster.ClusterName - The name of the Aurora cluster StartStopAuroraCluster.CurrentStatus - The current status of the Aurora cluster StartStopAuroraCluster.Message - Details of the automation AWS-StopRdsInstance Description Stop an Amazon Relational Database Service (Amazon RDS) instance. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases AWS-StopRdsInstance 667 AWS Systems Manager Automation runbook reference User Guide Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) ID of the Amazon RDS instance to stop. AWSSupport-TroubleshootConnectivityToRDS Description The AWSSupport-TroubleshootConnectivityToRDS runbook diagnoses connectivity issues between an EC2 instance and an Amazon Relational Database Service instance. The automation ensures the DB instance is available, and then checks the associated security group rules, network access control lists (network ACLs), and route tables for potential connectivity issues. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSSupport-TroubleshootConnectivityToRDS 668 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier Type: String Description: (Required) The DB instance ID to test connectivity to. • SourceInstance Type: String Allowed pattern: ^i-[a-z0-9]{8,17}$ Description: (Required) The ID of the EC2 instance to test connectivity from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeInstances • ec2:DescribeNetworkAcls • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • rds:DescribeDBInstances Document Steps • aws:assertAwsResourceProperty - Confirms the DB instance status is available . • aws:executeAwsApi - Gets information about the DB
|
systems-manager-automation-runbook-guide-159
|
systems-manager-automation-runbook-guide.pdf
| 159 |
behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier Type: String Description: (Required) The DB instance ID to test connectivity to. • SourceInstance Type: String Allowed pattern: ^i-[a-z0-9]{8,17}$ Description: (Required) The ID of the EC2 instance to test connectivity from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeInstances • ec2:DescribeNetworkAcls • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • rds:DescribeDBInstances Document Steps • aws:assertAwsResourceProperty - Confirms the DB instance status is available . • aws:executeAwsApi - Gets information about the DB instance. • aws:executeAwsApi - Gets information about the DB instance network ACLs. AWSSupport-TroubleshootConnectivityToRDS 669 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Gets the DB instance subnet CIDR. • aws:executeAwsApi - Gets information about the EC2 instance. • aws:executeAwsApi - Gets information about the EC2 instance network ACLs. • aws:executeAwsApi - Gets information about the security groups associated with the EC2 instance. • aws:executeAwsApi - Gets information about the security groups associated with the DB instance. • aws:executeAwsApi - Gets information about the route tables associated with the EC2 instance. • aws:executeAwsApi - Gets information about the main route table associated with the Amazon VPC for the EC2 instance. • aws:executeAwsApi - Gets information about the route tables associated with the DB instance. • aws:executeAwsApi - Gets information about the main route table associated with the Amazon VPC for the DB instance. • aws:executeScript - Evaluates security group rules. • aws:executeScript - Evaluates network ACLs. • aws:executeScript - Evaluates route tables. • aws:sleep - Ends the automation. Outputs getRDSInstanceProperties.DBInstanceIdentifier - The DB instance used in the automation. getRDSInstanceProperties.DBInstanceStatus - The current status of the DBInstance. evalSecurityGroupRules.SecurityGroupEvaluation - Results from comparing the SourceInstance security group rules to the DB instance security group rules. evalNetworkAclRules.NetworkAclEvaluation - Results from comparing the SourceInstance network ACLs to the DB instance network ACLs. evalRouteTableEntries.RouteTableEvaluation - Results from comparing the SourceInstance route table to the DB instance routes. AWSSupport-TroubleshootConnectivityToRDS 670 AWS Systems Manager Automation runbook reference User Guide AWSSupport-TroubleshootRDSIAMAuthentication Description The AWSSupport-TroubleshootRDSIAMAuthentication helps troubleshoot AWS Identity and Access Management (IAM) authentication for Amazon RDS for PostgreSQL, Amazon RDS for MySQL, Amazon RDS for MariaDB, Amazon Aurora PostgreSQL, and Amazon Aurora MySQL instances. Use this runbook to verify the configuration required for IAM authentication with an Amazon RDS instance or Aurora Cluster. It also provides steps to rectify the connectivity issues to the Amazon RDS Instance or Aurora Cluster. Important This runbook does not support Amazon RDS for Oracle or Amazon RDS for Microsoft SQL Server. Important If a source Amazon EC2 Instance is provided and the target Database is Amazon RDS, a child automation AWSSupport-TroubleshootConnectivityToRDS is invoked to troubleshoot TCP connectivity. The output also provides commands you can run on your Amazon EC2 instance or source machine to connect to the Amazon RDS instances using IAM authentication. How does it work? This runbook consists of six steps: • Step 1: validateInputs: Validates the inputs to the automation. • Step 2: branchOnSourceEC2Provided: Verifies if a source Amazon EC2 Instance ID is provided in the input parameters. • Step 3: validateRDSConnectivity: Validates Amazon RDS connectivity from the source Amazon EC2 instance if provided. • Step 4: validateRDSIAMAuthentication: Validates if the IAM Authentication feature is enabled. • Step 5: validateIAMPolicies: Verifies if the required IAM permissions are present in the IAM user/ role provided. AWSSupport-TroubleshootRDSIAMAuthentication 671 AWS Systems Manager Automation runbook reference User Guide • Step 6: generateReport: Generates a report of the results of the previously executed steps. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • RDSType Type: String Description: (Required): Select the type of relational database to which you are trying to connect and authenticate. Allowed Values: Amazon RDS or Amazon Aurora Cluster. • DBInstanceIdentifier Type: String Description: (Required) The identifier of the target Amazon RDS Database Instance or Aurora Database Cluster. Allowed Pattern: ^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$ AWSSupport-TroubleshootRDSIAMAuthentication 672 AWS Systems Manager Automation runbook reference User Guide Max Characters: 63 • SourceEc2InstanceIdentifier Type: AWS::EC2::Instance::Id Description: (Optional) The Amazon EC2 Instance ID if you are connecting to the Amazon RDS Database Instance from an Amazon EC2 Instance running in the same account and region. Do not specify this parameter if the source is not an Amazon EC2 instance or if the target Amazon RDS type is an Aurora Database Cluster. Default: "" • DBIAMRoleName Type: String Description: (Optional) The IAM role name being used for IAM-based authentication. Provide only if the parameter DBIAMUserName
|
systems-manager-automation-runbook-guide-160
|
systems-manager-automation-runbook-guide.pdf
| 160 |
Database Cluster. Allowed Pattern: ^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$ AWSSupport-TroubleshootRDSIAMAuthentication 672 AWS Systems Manager Automation runbook reference User Guide Max Characters: 63 • SourceEc2InstanceIdentifier Type: AWS::EC2::Instance::Id Description: (Optional) The Amazon EC2 Instance ID if you are connecting to the Amazon RDS Database Instance from an Amazon EC2 Instance running in the same account and region. Do not specify this parameter if the source is not an Amazon EC2 instance or if the target Amazon RDS type is an Aurora Database Cluster. Default: "" • DBIAMRoleName Type: String Description: (Optional) The IAM role name being used for IAM-based authentication. Provide only if the parameter DBIAMUserName is not provided, otherwise leave it empty. Either DBIAMRoleName or DBIAMUserName must be provided. Allowed Pattern: ^[a-zA-Z0-9+=,.@_-]{1,64}$|^$ Max Characters: 64 Default: "" • DBIAMUserName Type: String Description: (Optional) The IAM user name used for IAM-based authentication. Provide only if the DBIAMRoleName parameter is not provided, otherwise leave it empty. Either DBIAMRoleName or DBIAMUserName must be provided. Allowed Pattern: ^[a-zA-Z0-9+=,.@_-]{1,64}$|^$ Max Characters: 64 Default: "" • DBUserName Type: String AWSSupport-TroubleshootRDSIAMAuthentication 673 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The database user name mapped to an IAM role/user for IAM-based authentication within the database. The default option * evaluates if the rds-db:connect permission is allowed for all users in the Database. Allowed Pattern: ^[a-zA-Z0-9+=,.@*_-]{1,64}$ Max Characters: 64 Default: * Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeInstances • ec2:DescribeNetworkAcls • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • iam:GetPolicy • iam:GetRole • iam:GetUser • iam:ListAttachedRolePolicies • iam:ListAttachedUserPolicies • iam:ListRolePolicies • iam:ListUserPolicies • iam:SimulatePrincipalPolicy • rds:DescribeDBClusters • rds:DescribeDBInstances • ssm:DescribeAutomationStepExecutions • ssm:GetAutomationExecution • ssm:StartAutomationExecution AWSSupport-TroubleshootRDSIAMAuthentication 674 AWS Systems Manager Automation runbook reference User Guide Instructions 1. Navigate to the AWSSupport-TroubleshootRDSIAMAuthentication in the AWS Systems Manager Console. 2. Select Execute Automation 3. For input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • RDSType (Required): Select the type of Amazon RDS to which you are trying to connect and authenticate. Choose from the two allowed values: Amazon RDS or Amazon Aurora Cluster. • DBInstanceIdentifier (Required): Enter the identifier of the target Amazon RDS Database Instance or the Aurora Cluster to which you are trying to connect and use IAM credentials for authentication. • SourceEc2InstanceIdentifier (Optional): Provide the Amazon EC2 Instance ID if you are connecting to the Amazon RDS Database Instance from an Amazon EC2 Instance present in the same account and region. Leave blank if the source is not Amazon EC2 or if the target Amazon RDS type is an Aurora Cluster. • DBIAMRoleName (Optional): Enter the IAM Role name used for IAM-Based authentication. Provide only if DBIAMUserName is not provided; otherwise, leave blank. Either DBIAMRoleName or DBIAMUserName must be provided. • DBIAMUserName (Optional): Enter the IAM User used for IAM-Based authentication. Provide only if DBIAMRoleName is not provided, otherwise, leave blank. Either DBIAMRoleName or DBIAMUserName must be provided. • DBUserName (Optional): AWSSupport-TroubleshootRDSIAMAuthentication 675 AWS Systems Manager Automation runbook reference User Guide Enter the database user mapped to an IAM role/user for IAM-Based authentication within the database. The default option * is used to evaluate; nothing is provided in this field. 4. Select Execute. 5. Notice that the automation initiates. 6. The document performs the following steps: • Step 1: validateInputs: Validates the inputs to the automation - SourceEC2InstanceIdentifier (optional), DBInstanceIdentifier or ClusterID, and DBIAMRoleName or DBIAMUserName. It verifies if the input parameters entered are present in your account and region. It also verifies if the user entered one of the IAM parameters (for example, DBIAMRoleName or DBIAMUserName). Additionally, it performs other verifications, such as if the Database mentioned is in Available status. • Step 2: branchOnSourceEC2Provided: Verifies if Source Amazon EC2 is provided in the input parameters and the Database is Amazon RDS. If yes, it proceeds to step 3. If not, it skips step 3, which is Amazon EC2-Amazon RDS Connectivity validation and proceeds to step 4. • Step 3: validateRDSConnectivity: AWSSupport-TroubleshootRDSIAMAuthentication 676 AWS Systems Manager Automation runbook reference User Guide If the Source Amazon EC2 is provided in the input parameters and the Database is Amazon RDS, step 2 initiates step 3. In this step, the child automation AWSSupport- TroubleshootConnectivityToRDS is invoked to validate Amazon RDS connectivity from source Amazon EC2. The child automation runbook AWSSupport- TroubleshootConnectivityToRDS verifies if the required network configurations (Amazon Virtual Private Cloud [Amazon VPC], Security Groups, Network Access Control List [NACL], Amazon RDS availability) are in place so that you can connect from the Amazon EC2 instance to the Amazon RDS instance. • Step 4: validateRDSIAMAuthentication: Validates if the IAM Authentication feature
|
systems-manager-automation-runbook-guide-161
|
systems-manager-automation-runbook-guide.pdf
| 161 |
reference User Guide If the Source Amazon EC2 is provided in the input parameters and the Database is Amazon RDS, step 2 initiates step 3. In this step, the child automation AWSSupport- TroubleshootConnectivityToRDS is invoked to validate Amazon RDS connectivity from source Amazon EC2. The child automation runbook AWSSupport- TroubleshootConnectivityToRDS verifies if the required network configurations (Amazon Virtual Private Cloud [Amazon VPC], Security Groups, Network Access Control List [NACL], Amazon RDS availability) are in place so that you can connect from the Amazon EC2 instance to the Amazon RDS instance. • Step 4: validateRDSIAMAuthentication: Validates if the IAM Authentication feature is enabled on the Amazon RDS instance or Aurora Cluster. • Step 5: validateIAMPolicies: Verifies if the required IAM permissions are present in the IAM user/role passed to enable the IAM credentials to authenticate into the Amazon RDS instance for the specified Database User (if any). • Step 6: generateReport: Obtains all the information from the previous steps and prints the result or the output of each step. It also lists the steps to refer to and perform, to connect to the Amazon RDS instance using the IAM credentials. 7. When the automation is complete, review the Outputs section for the detailed results: • Checking the IAM User/Role permission to connect to Database: Verifies if the required IAM permissions are present in the IAM user/role passed to enable the IAM credentials to authenticate into the Amazon RDS Instance for the specified Database User (if any). • Checking IAM-Based Authentication Attribute for the Database: Verifies if the feature of the IAM authentication is enabled for the specified Amazon RDS Database/Aurora Cluster. • Checking Connectivity from Amazon EC2 Instance to Amazon RDS Instance: AWSSupport-TroubleshootRDSIAMAuthentication 677 AWS Systems Manager Automation runbook reference User Guide Verifies if the required network configurations (Amazon VPC, Security Groups, NACL, Amazon RDS availability) are in place so that you can connect from the Amazon EC2 instance to the Amazon RDS Instance. • Next Steps: Lists the commands and steps to refer to and perform, to connect to the Amazon RDS Instance using the IAM credentials. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWSSupport-ValidateRdsNetworkConfiguration Description AWSSupport-ValidateRdsNetworkConfiguration automation helps to avoid incompatible- network state for your existing Amazon Relational Database Service (Amazon RDS) / Amazon AWSSupport-ValidateRdsNetworkConfiguration 678 AWS Systems Manager Automation runbook reference User Guide Aurora / Amazon DocumentDB instance before you perform ModifyDBInstance or StartDBInstance operation. If the instance is already in incompatible-network state, the runbook will provide the reason. How does it work? This runbook determines if your Amazon RDS database instance will go into incompatilble-network state, or if it has, determine the reason it's in incompatible-network state. The runbook performs the following checks against your Amazon RDS database instance: • Amazon Elastic Network Interface (ENI) quota per region. • All subnets in the database Subnet Group exist. • There are sufficient free IP addresses available for the subnet(s). • (For publicly accessible Amazon RDS instances) Settings of VPC attributes (enableDnsSupport and enableDnsHostnames). Important When using this document against Amazon Aurora / Amazon DocumentDB clusters, ensure that you use DBInstanceIdentifier instead of ClusterIdentifier. Otherwise, the document will fail in the first step. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Required IAM permissions AWSSupport-ValidateRdsNetworkConfiguration 679 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • rds:DescribeDBInstances • servicequotas:GetServiceQuota • ec2:DescribeNetworkInterfaces • ec2:DescribeVpcAttribute • ec2:DescribeSubnets Sample policy: { "Version": "2012-10-17", "Statement": [ { "Sid": "ValidateRdsNetwork", "Effect": "Allow", "Action": [ "rds:DescribeDBInstances", "servicequotas:GetServiceQuota", "ec2:DescribeNetworkInterfaces", "ec2:DescribeVpcAttribute", "ec2:DescribeSubnets" ], "Resource": [ "arn:aws:rds:{Region}:{Account}:db:{DbInstanceName}" ] } ] } Instructions 1. Navigate to the AWSSupport-ValidateRdsNetworkConfiguration in the AWS Systems Manager Console. 2. Select Execute Automation 3. For input parameters, enter the following: AWSSupport-ValidateRdsNetworkConfiguration 680 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DBInstanceIdentifier (Required): Enter the Amazon Relational Database Service Instance Identifier. 4. Select Execute. 5. Notice that the automation initiates. 6. The document performs the following steps: • Step 1: assertRdsState: Checks if the provided instance identifier exists and has any of the following states: available, stopped, or incompatible-network. • Step 2: gatherRdsInformation: Gathers required information about the Amazon RDS instance to use later in the automation. • Step 3: checkEniQuota: Checks for the current available quota of Amazon ENI for the region. • Step 4: validateVpcAttributes: Validates that the DNS parameters (enableDnsSupport and enableDnsHostnames) of the Amazon VPC are set to true (or not if
|
systems-manager-automation-runbook-guide-162
|
systems-manager-automation-runbook-guide.pdf
| 162 |
Relational Database Service Instance Identifier. 4. Select Execute. 5. Notice that the automation initiates. 6. The document performs the following steps: • Step 1: assertRdsState: Checks if the provided instance identifier exists and has any of the following states: available, stopped, or incompatible-network. • Step 2: gatherRdsInformation: Gathers required information about the Amazon RDS instance to use later in the automation. • Step 3: checkEniQuota: Checks for the current available quota of Amazon ENI for the region. • Step 4: validateVpcAttributes: Validates that the DNS parameters (enableDnsSupport and enableDnsHostnames) of the Amazon VPC are set to true (or not if the Amazon RDS instance is PubliclyAccessible). • Step 5: validateSubnetAttributes: Validates the existence of subnets in the DBSubnetGroup and checks for available IPs for each subnet. • Step 6: generateReport: AWSSupport-ValidateRdsNetworkConfiguration 681 AWS Systems Manager Automation runbook reference User Guide Obtains all the information from the previous steps and prints the result or the output of each step. It also lists the steps to refer to and perform, to connect to the Amazon RDS instance using the IAM credentials. 7. When the automation is complete, review the Outputs section for the detailed results: Amazon RDS instance with valid network configuration: Amazon RDS instance with incorrect network configuration (VPC attribute enableDnsHostnames is set to false): AWSSupport-ValidateRdsNetworkConfiguration 682 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • How do I resolve issues with an Amazon RDS database that is in an incompatible-network state? • How do I resolve issues with an Amazon DocumentDB instance that is in an incompatible- network state? AWSSupport-ValidateRdsNetworkConfiguration 683 AWS Systems Manager Automation runbook reference User Guide Amazon Redshift AWS Systems Manager Automation provides predefined runbooks for Amazon Redshift. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-DeleteRedshiftCluster • AWSConfigRemediation-DisablePublicAccessToRedshiftCluster • AWSConfigRemediation-EnableRedshiftClusterAuditLogging • AWSConfigRemediation-EnableRedshiftClusterAutomatedSnapshot • AWSConfigRemediation-EnableRedshiftClusterEncryption • AWSConfigRemediation-EnableRedshiftClusterEnhancedVPCRouting • AWSConfigRemediation-EnforceSSLOnlyConnectionsToRedshiftCluster • AWSConfigRemediation-ModifyRedshiftClusterMaintenanceSettings • AWSConfigRemediation-ModifyRedshiftClusterNodeType AWSConfigRemediation-DeleteRedshiftCluster Description The AWSConfigRemediation-DeleteRedshiftCluster runbook deletes the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters Amazon Redshift 684 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The ID of the Amazon Redshift cluster that you want to delete. • SkipFinalClusterSnapshot Type: Boolean Default: false Description: (Optional) If set to false , the automation creates a snapshot before deleting the Amazon Redshift cluster. If set to true , a final cluster snapshot is not created. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DeleteCluster • redshift:DescribeClusters Document Steps • aws:branch - Branches based on the value you specify for the SkipFinalClusterSnapshot parameter. • aws:executeAwsApi - Deletes the Amazon Redshift cluster specified in the ClusterIdentifier parameter. • aws:assertAwsResourceProperty - Verifies the Amazon Redshift cluster has been deleted. AWSConfigRemediation-DeleteRedshiftCluster 685 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation- DisablePublicAccessToRedshiftCluster Description The AWSConfigRemediation-DisablePublicAccessToRedshiftCluster runbook disables public accessibility for the Amazon Redshift cluster that you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster that you want to disable public accessibility for. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSConfigRemediation-DisablePublicAccessToRedshiftCluster 686 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps • aws:executeAwsApi - Disables public accessibility for the cluster specified in the ClusterIdentifier parameter. • aws:waitForAwsResourceProperty - Waits for the state of the cluster to change to available . • aws:assertAwsResourceProperty - Confirms the public accessibility setting is disabled on the cluster. AWSConfigRemediation-EnableRedshiftClusterAuditLogging Description The AWSConfigRemediation-EnableRedshiftClusterAuditLogging runbook enables audit logging for the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String AWSConfigRemediation-EnableRedshiftClusterAuditLogging 687 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BucketName Type: String Description: (Required) The name of the Amazon Simple Storage Service (Amazon S3) bucket you want to upload logs to. • ClusterIdentifier Type: String Description: (Required) The unique
|
systems-manager-automation-runbook-guide-163
|
systems-manager-automation-runbook-guide.pdf
| 163 |
AWSConfigRemediation-EnableRedshiftClusterAuditLogging Description The AWSConfigRemediation-EnableRedshiftClusterAuditLogging runbook enables audit logging for the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String AWSConfigRemediation-EnableRedshiftClusterAuditLogging 687 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BucketName Type: String Description: (Required) The name of the Amazon Simple Storage Service (Amazon S3) bucket you want to upload logs to. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable audit logging on. • S3KeyPrefix Type: String Description: (Optional) The Amazon S3 key prefix (subfolder) you want to upload logs to. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeLoggingStatus • redshift:EnableLogging • s3:GetBucketAcl • s3:PutObject Document Steps • aws:branch - Branches based on whether a value was specified for the S3KeyPrefix parameter. AWSConfigRemediation-EnableRedshiftClusterAuditLogging 688 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Enables audit logging on the cluster specified in the ClusterIdentifier parameter. • aws:assertAwsResourceProperty - Verifies audit logging was enabled on the cluster. AWSConfigRemediation- EnableRedshiftClusterAutomatedSnapshot Description The AWSConfigRemediation-EnableRedshiftClusterAutomatedSnapshot runbook enables automated snapshots for the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • AutomatedSnapshotRetentionPeriod Type: Integer Valid values: 1-35 AWSConfigRemediation-EnableRedshiftClusterAutomatedSnapshot 689 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The number of days that automated snapshots are retained. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable automated snapshots on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps • aws:executeAwsApi - Enables automation snapshots on the cluster specified in the ClusterIdentifier parameter. • aws:waitForAwsResourceProperty - Waits for the state of the cluster to change to available . • aws:executeScript - Confirms automated snapshots were enabled on the cluster. AWSConfigRemediation-EnableRedshiftClusterEncryption Description The AWSConfigRemediation-EnableRedshiftClusterEncryption runbook enables encryption on the Amazon Redshift cluster you specify using an AWS Key Management Service (AWS KMS) customer managed key. This runbook should only be used as a baseline to ensure that your Amazon Redshift clusters are encrypted according to minimum recommended security best practices. We recommend encrypting multiple clusters with different customer managed keys. AWSConfigRemediation-EnableRedshiftClusterEncryption 690 AWS Systems Manager Automation runbook reference User Guide This runbook cannot change the AWS KMS customer managed key used on an already encrypted cluster. To change the AWS KMS customer managed key used to encrypt a cluster, you must first disable encryption on the cluster. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable encryption on. • KMSKeyARN Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS KMS customer managed key you want to use to encrypt the cluster's data. Required IAM permissions AWSConfigRemediation-EnableRedshiftClusterEncryption 691 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps • aws:executeAwsApi - Enables encryption on the Amazon Redshift cluster specified in the ClusterIdentifier parameter. • aws:assertAwsResourceProperty - Verifies encryption has been enabled on the cluster. AWSConfigRemediation- EnableRedshiftClusterEnhancedVPCRouting Description The AWSConfigRemediation-EnableRedshiftClusterEnhancedVPCRouting runbook enables enhanced virtual private cloud (VPC) routing for the Amazon Redshift cluster you specify. For information about enhanced VPC routing, see Amazon Redshift enhanced VPC routing in the Amazon Redshift Management Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters AWSConfigRemediation-EnableRedshiftClusterEnhancedVPCRouting 692 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable enhanced VPC routing on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps • aws:executeAwsApi - Enables enhanced VPC routing on the cluster specified in the ClusterIdentifier parameter. • assertAwsResourceProperty - Confirms enhanced VPC routing was enabled on
|
systems-manager-automation-runbook-guide-164
|
systems-manager-automation-runbook-guide.pdf
| 164 |
Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable enhanced VPC routing on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps • aws:executeAwsApi - Enables enhanced VPC routing on the cluster specified in the ClusterIdentifier parameter. • assertAwsResourceProperty - Confirms enhanced VPC routing was enabled on the cluster. AWSConfigRemediation- EnforceSSLOnlyConnectionsToRedshiftCluster Description The AWSConfigRemediation-EnforceSSLOnlyConnectionsToRedshiftCluster runbook requires incoming connections to use SSL for the Amazon Redshift cluster you specify. AWSConfigRemediation-EnforceSSLOnlyConnectionsToRedshiftCluster 693 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable enhanced VPC routing on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:DescribeClusterParameters • redshift:ModifyClusterParameterGroup AWSConfigRemediation-EnforceSSLOnlyConnectionsToRedshiftCluster 694 AWS Systems Manager Automation runbook reference User Guide Document Steps • aws:executeAwsApi - Gathers parameter details from the cluster specified in the ClusterIdentifier parameter. • aws:executeAwsApi - Enables the require_ssl setting on the cluster specified in the ClusterIdentifier parameter. • aws:assertAwsResourceProperty - Confirms the require_ssl setting was enabled on the cluster. • aws:executeScript - Verifies the require_ssl setting for the cluster. AWSConfigRemediation- ModifyRedshiftClusterMaintenanceSettings Description The AWSConfigRemediation-ModifyRedshiftClusterMaintenanceSettings runbook modifies the maintenance settings for the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AllowVersionUpgrade Type: Boolean Description: (Required) If set to true , major version upgrades are applied automatically to the cluster during the maintenance window. AWSConfigRemediation-ModifyRedshiftClusterMaintenanceSettings 695 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • AutomatedSnapshotRetentionPeriod Type: Integer Valid values: 1-35 Description: (Required) The number of days automated snapshots are retained. • ClusterIdentifier Type: String Description: (Required) The unique identifier of the cluster you want to enable enhanced VPC routing on. • PreferredMaintenanceWindow Type: String Description: (Required) The weekly time range (in UTC) during which system maintenance can occur. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ModifyCluster Document Steps AWSConfigRemediation-ModifyRedshiftClusterMaintenanceSettings 696 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Modifies the maintenance settings for the cluster specified in the ClusterIdentifier parameter. • aws:assertAwsResourceProperty - Confirms the modified maintenance settings were configured for the cluster. AWSConfigRemediation-ModifyRedshiftClusterNodeType Description The AWSConfigRemediation-ModifyRedshiftClusterNodeType runbook modifies the node type and number of nodes for the Amazon Redshift cluster you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Databases Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • Classic Type: Boolean Description: (Optional) If set to true , the resize operation uses the classic resize process. • ClusterIdentifier AWSConfigRemediation-ModifyRedshiftClusterNodeType 697 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The unique identifier of the cluster whose node type you want to modify. • ClusterType Type: String Valid values: single-node | multi-node Description: (Required) The type of cluster you want to assign to your cluster. • NodeType Type: String Valid values: ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge | dc2.large | dc2.8xlarge | ra3.4xlarge | ra3.16xlarge Description: (Required) The type of node you want to assign to your cluster. • NumberOfNodes Type: Integer Valid values: 2-100 Description: (Optional) The number of nodes you want to assign to your cluster. If your cluster is a single-node type, do not specify a value for this parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ResizeCluster Document Steps AWSConfigRemediation-ModifyRedshiftClusterNodeType 698 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Modifies the node type and number of nodes for the cluster specified in the ClusterIdentifier parameter. Amazon S3 AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Storage Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-ArchiveS3BucketToIntelligentTiering • AWS-ConfigureS3BucketLogging • AWS-ConfigureS3BucketVersioning • AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock • AWSConfigRemediation-ConfigureS3PublicAccessBlock •
|
systems-manager-automation-runbook-guide-165
|
systems-manager-automation-runbook-guide.pdf
| 165 |
IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • redshift:DescribeClusters • redshift:ResizeCluster Document Steps AWSConfigRemediation-ModifyRedshiftClusterNodeType 698 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Modifies the node type and number of nodes for the cluster specified in the ClusterIdentifier parameter. Amazon S3 AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Storage Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-ArchiveS3BucketToIntelligentTiering • AWS-ConfigureS3BucketLogging • AWS-ConfigureS3BucketVersioning • AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock • AWSConfigRemediation-ConfigureS3PublicAccessBlock • AWS-CreateS3PolicyToExpireMultipartUploads • AWS-DisableS3BucketPublicReadWrite • AWS-EnableS3BucketEncryption • AWS-EnableS3BucketKeys • AWSConfigRemediation-RemovePrincipalStarFromS3BucketPolicy • AWSConfigRemediation-RestrictBucketSSLRequestsOnly • AWSSupport-TroubleshootS3PublicRead • AWSSupport-EmptyS3Bucket • AWSSupport-TroubleshootS3EventNotifications • AWSSupport-ContainS3Resource AWS-ArchiveS3BucketToIntelligentTiering Description The AWS-ArchiveS3BucketToIntelligentTiering runbook creates, or replaces, an intelligent tiering configuration for the Amazon Simple Storage Service (Amazon S3) bucket you specify. Amazon S3 699 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the S3 bucket you want to create an intelligent tiering configuration for. • ConfigurationId Type: String Description: (Required) The ID for the intelligent tiering configuration. This can be a new configuration ID, or the ID of an existing configuration. • NumberOfDaysToArchive Type: String Valid values: 90-730 AWS-ArchiveS3BucketToIntelligentTiering 700 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The number of consecutive days after an object in your bucket is eligible to be transitioned to the Archive Access tier. • NumberOfDaysToDeepArchive Type: String Valid values: 180-730 Description: (Required) The number of consecutive days after an object in your bucket is eligible to be transitioned to the Deep Archive Access tier. • S3Prefix Type: String Description: (Optional) The key name prefix of the objects you want to apply the configuration to. • Tags Type: MapList Description: (Optional) Metadata assigned to the objects you want to apply the configuration to. Tags consist of a user-defined key and value. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:GetIntelligentTieringConfiguration • s3:PutIntelligentTieringConfiguration Document Steps • PutsBucketIntelligentTieringConfiguration (aws:executeScript) - Creates or updates an Amazon S3 Intelligent-Tiering configuration for the specified bucket. AWS-ArchiveS3BucketToIntelligentTiering 701 AWS Systems Manager Automation runbook reference User Guide • VerifyBucketIntelligentTieringConfiguration (aws:assertAwsResourceProperty) - Verifies the S3 Bucket Intelligent Configuration was applied to the specified bucket. AWS-ConfigureS3BucketLogging Description Enable logging on an Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the Amazon S3 Bucket for which you want to configure logging. • GrantedPermission Type: String AWS-ConfigureS3BucketLogging 702 AWS Systems Manager Automation runbook reference User Guide Valid values: FULL_CONTROL | READ | WRITE Description: (Required) Logging permissions assigned to the grantee for the bucket. • GranteeEmailAddress Type: String (Optional) Email address of the grantee. • GranteeId Type: String Description: (Optional) The canonical user ID of the grantee. • GranteeType Type: String Valid values: CanonicalUser | AmazonCustomerByEmail | Group Description: (Required) Type of grantee. • GranteeUri Type: String Description: (Optional) URI of the grantee group. • TargetBucket Type: String Description: (Required) Specifies the bucket where you want Amazon S3 to store server access logs. You can have your logs delivered to any bucket that you own. You can also configure multiple buckets to deliver their logs to the same target bucket. In this case you should choose a different TargetPrefix for each source bucket so that the delivered log files can be distinguished by key. • TargetPrefix Type: String Default: / AWS-ConfigureS3BucketLogging 703 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) Specifies a prefix for the keys under which the log files will be stored. AWS-ConfigureS3BucketVersioning Description Configure versioning for an Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions
|
systems-manager-automation-runbook-guide-166
|
systems-manager-automation-runbook-guide.pdf
| 166 |
Type: String Default: / AWS-ConfigureS3BucketLogging 703 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) Specifies a prefix for the keys under which the log files will be stored. AWS-ConfigureS3BucketVersioning Description Configure versioning for an Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the Amazon S3 bucket you want to configure versioning for. • VersioningState Type: String Valid values: Enabled | Suspended AWS-ConfigureS3BucketVersioning 704 AWS Systems Manager Automation runbook reference User Guide Default: Enabled Description: (Optional) Applied to the VersioningConfiguration.Status. When set to 'Enabled', this process enables versioning for the objects in the bucket, all objects added to the bucket receive a unique version ID. When set to Suspended , this process disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null . AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock Description The AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock runbook configures the Amazon Simple Storage Service (Amazon S3) public access block settings for an Amazon S3 bucket based on the values you specify in the runbook parameters. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BlockPublicAcls Type: Boolean AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock 705 AWS Systems Manager Automation runbook reference User Guide Default: true Description: (Optional) If set to true , Amazon S3 blocks public access control lists (ACLs) for the S3 bucket, and objects stored in the S3 bucket you specify in the BucketName parameter. • BlockPublicPolicy Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 blocks public bucket policies for the S3 bucket you specify in the BucketName parameter. • BucketName Type: String Description: (Required) The name of the S3 bucket you want to configure. • IgnorePublicAcls Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 ignores all public ACLs for the S3 bucket you specify in the BucketName parameter. • RestrictPublicBuckets Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 restricts public bucket policies for the S3 bucket you specify in the BucketName parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock 706 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:GetAccountPublicAccessBlock • s3:PutAccountPublicAccessBlock • s3:GetBucketPublicAccessBlock • s3:PutBucketPublicAccessBlock Document Steps • aws:executeAwsApi - Creates or modifies the PublicAccessBlock configuration for the S3 bucket specified in the BucketName parameter. • aws:executeScript - Returns the PublicAccessBlock configuration for the S3 bucket specified in the BucketName parameter, and verifies the changes were successfully made based on the values specified in the runbook parameters. AWSConfigRemediation-ConfigureS3PublicAccessBlock Description The AWSConfigRemediation-ConfigureS3PublicAccessBlock runbook configures an AWS account's Amazon Simple Storage Service (Amazon S3) public access block settings based on the values you specify in the runbook parameters. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWSConfigRemediation-ConfigureS3PublicAccessBlock 707 AWS Systems Manager Automation runbook reference User Guide • AccountId Type: String Description: (Required) The ID of the AWS account that owns the S3 bucket you are configuring. • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BlockPublicAcls Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 blocks public access control lists (ACLs) for S3 buckets owned by the AWS account you specify in the AccountId parameter. • BlockPublicPolicy Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 blocks public bucket policies for S3 buckets owned by the AWS account you specify in the AccountId parameter. • IgnorePublicAcls Type: Boolean Default: true Description: (Optional) If set to true , Amazon S3 ignores all public ACLs for S3 buckets owned by the AWS account you specify in the AccountId parameter. • RestrictPublicBuckets Type: Boolean AWSConfigRemediation-ConfigureS3PublicAccessBlock 708 AWS Systems Manager Automation runbook reference User Guide Default: true Description: (Optional) If set to true , Amazon S3 restricts public bucket policies for S3 buckets owned by the AWS account you specify in the AccountId parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:GetAccountPublicAccessBlock • s3:PutAccountPublicAccessBlock Document Steps • aws:executeAwsApi -
|
systems-manager-automation-runbook-guide-167
|
systems-manager-automation-runbook-guide.pdf
| 167 |
Default: true Description: (Optional) If set to true , Amazon S3 ignores all public ACLs for S3 buckets owned by the AWS account you specify in the AccountId parameter. • RestrictPublicBuckets Type: Boolean AWSConfigRemediation-ConfigureS3PublicAccessBlock 708 AWS Systems Manager Automation runbook reference User Guide Default: true Description: (Optional) If set to true , Amazon S3 restricts public bucket policies for S3 buckets owned by the AWS account you specify in the AccountId parameter. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:GetAccountPublicAccessBlock • s3:PutAccountPublicAccessBlock Document Steps • aws:executeAwsApi - Creates or modifies the PublicAccessBlock configuration for the AWS account specified in the AccountId parameter. • aws:executeScript - Returns the PublicAccessBlock configuration for the AWS account specified in the AccountId parameter, and verifies the changes were successfully made based on the values specified in the runbook parameters. AWS-CreateS3PolicyToExpireMultipartUploads Description The AWS-CreateS3PolicyToExpireMultipartUploads runbook creates a lifecycle policy for a specified bucket that expires incomplete, multi-part uploads in progress after a defined number of days. This runbook merges the new lifecycle policy with any existing lifecycle bucket policies that already exist. Run this Automation (console) Document type Automation AWS-CreateS3PolicyToExpireMultipartUploads 709 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the S3 bucket you want to configure. • DaysUntilExpire Type: Integer Description: (Required) The number of days Amazon S3 waits before permanently removing all parts of the upload. • RuleId Type: String Description: (Required) The ID used to identify the lifeycle bucket rule. This must be a unique value. • S3Prefix Type: String Description: (Optional) The key name prefix of the objects you want to apply the configuration to. AWS-CreateS3PolicyToExpireMultipartUploads 710 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • s3:GetLifecycleConfiguration • s3:PutLifecycleConfiguration Document Steps • ConfigureExpireMultipartUploads (aws:executeScript) - Configures the lifecycle policy for the bucket. • VerifyExpireMultipartUploads (aws:executeScript) - Verifies the lifecycle policy has been configured for the bucket. Outputs • VerifyExpireMultipartUploads.VerifyExpireMultipartUploadsResponse • VerifyExpireMultipartUploads.LifecycleConfigurationRule AWS-DisableS3BucketPublicReadWrite Description Use Amazon Simple Storage Service (Amazon S3) Block Public Access to disable read and write access for a public S3 bucket. For more information, see Using Amazon S3 Block Public Access in the Amazon Simple Storage Service User Guide . Run this Automation (console) Document type Automation Owner Amazon AWS-DisableS3BucketPublicReadWrite 711 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • S3BucketName Type: String Description: (Required) S3 bucket on which you want to restrict access. AWS-EnableS3BucketEncryption Description Configures default encryption for an Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWS-EnableS3BucketEncryption 712 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the S3 bucket where you want to encrypt the contents. • SSEAlgorithm Type: String Default: AES256 Description: (Optional) Server-side encryption algorithm to use for the default encryption. AWS-EnableS3BucketKeys Description The AWS-EnableS3BucketKeys runbook enables Bucket Keys on the Amazon Simple Storage Service (Amazon S3) bucket you specify. This bucket level key creates data keys for new objects during its lifecycle. If you don't specify a value for the KmsKeyId parameter, server-side encryption using Amazon S3 managed keys (SSE-S3) are used for the default encryption configuration. Note Amazon S3 Bucket Keys aren't supported for dual-layer server-side encryption with AWS Key Management Service (AWS KMS) keys (DSSE-KMS). Run this Automation (console) Document type Automation AWS-EnableS3BucketKeys 713 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems
|
systems-manager-automation-runbook-guide-168
|
systems-manager-automation-runbook-guide.pdf
| 168 |
the KmsKeyId parameter, server-side encryption using Amazon S3 managed keys (SSE-S3) are used for the default encryption configuration. Note Amazon S3 Bucket Keys aren't supported for dual-layer server-side encryption with AWS Key Management Service (AWS KMS) keys (DSSE-KMS). Run this Automation (console) Document type Automation AWS-EnableS3BucketKeys 713 AWS Systems Manager Automation runbook reference User Guide Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BucketName Type: String Description: (Required) The name of the S3 bucket you want to enable Bucket Keys for. • KMSKeyId Type: String Description: (Optional) The Amazon Resource Name (ARN), key ID, or the key alias of the AWS Key Management Service (AWS KMS) customer managed key you want to use for server-side encryption. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:GetEncryptionConfiguration • s3:PutEncryptionConfiguration AWS-EnableS3BucketKeys 714 AWS Systems Manager Automation runbook reference User Guide Document Steps • ChooseEncryptionType (aws:branch) - Evaluates the value provided for the KmsKeyId parameter to determine if SSE-S3 (AES256) or SSE-KMS will be used. • PutBucketKeysKMS (aws:executeAwsApi) - Sets the BucketKeyEnabled property to true for the specified S3 bucket using the specified KmsKeyId. • PutBucketKeysAES256 (aws:executeAwsApi) - Sets the BucketKeyEnabled property to true for the specified S3 bucket with AES256 encryption. • VerifyS3BucketKeysEnabled (aws:assertAwsResourceProperty) - Verifies that the Bucket Keys are enabled on the target S3 bucket. AWSConfigRemediation- RemovePrincipalStarFromS3BucketPolicy Description The AWSConfigRemediation-RemovePrincipalStarFromS3BucketPolicy runbook removes principal policy statements that have wildcards ( Principal: * or Principal: "AWS": * ) for Allow actions from your Amazon Simple Storage Service (Amazon S3) bucket policy. Policy statements with conditions are also removed. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSConfigRemediation-RemovePrincipalStarFromS3BucketPolicy 715 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BucketName Type: String Description: (Required) The name of the Amazon S3 bucket whose policy you want to modify. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:DeleteBucketPolicy • s3:GetBucketPolicy • s3:PutBucketPolicy Document Steps • aws:executeScript - Modifies the bucket policy and verifies principal policy statements with wildcards have been removed from the Amazon S3 bucket you specify in the BucketName parameter. AWSConfigRemediation-RestrictBucketSSLRequestsOnly Description The AWSConfigRemediation-RestrictBucketSSLRequestsOnly runbook creates an Amazon Simple Storage Service (Amazon S3) bucket policy statement that explicitly denies HTTP requests to the Amazon S3 bucket you specify. Run this Automation (console) Document type AWSConfigRemediation-RestrictBucketSSLRequestsOnly 716 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • BucketName Type: String Description: (Required) The name of the S3 bucket that you want to deny HTTP requests. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • s3:DeleteBucketPolicy • s3:GetBucketPolicy • s3:PutEncryptionConfiguration • s3:PutBucketPolicy Document Steps AWSConfigRemediation-RestrictBucketSSLRequestsOnly 717 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Creates a bucket policy for the S3 bucket specified in the BucketName parameter that explicitly denies HTTP requests. AWSSupport-TroubleshootS3PublicRead Description The AWSSupport-TroubleshootS3PublicRead runbook diagnoses issues reading objects from the public Amazon Simple Storage Service (Amazon S3) bucket you specify in the S3BucketName parameter. A subset of settings are also analyzed for objects in the S3 bucket. Run this Automation (console) Limitations • This automation does not check for access points that allow public access to objects. • This automation does not evaluate condition keys in the S3 bucket policy. • If you're using AWS Organizations, this automation does not evaluate service control policies to confirm that access to Amazon S3 is allowed. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on AWSSupport-TroubleshootS3PublicRead 718 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • CloudWatchLogGroupName Type: String Description: (Optional) The Amazon CloudWatch Logs log group where you want to send the automation output. If a log group is not
|
systems-manager-automation-runbook-guide-169
|
systems-manager-automation-runbook-guide.pdf
| 169 |
Amazon S3 is allowed. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on AWSSupport-TroubleshootS3PublicRead 718 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • CloudWatchLogGroupName Type: String Description: (Optional) The Amazon CloudWatch Logs log group where you want to send the automation output. If a log group is not found that matches the value you specify, the automation will create a log group using this parameter value. The retention period for the log group created by this automation is 14 days. • CloudWatchLogStreamName Type: String Description: (Optional) The CloudWatch Logs log stream where you want to send the automation output. If a log stream is not found that matches the value you specify, the automation will create a log stream using this parameter value. If you do not specify a value for this parameter, the automation will use the ExecutionId for the name of the log stream. • HttpGet Type: Boolean Valid values: true | false Default: true Description: (Optional) If this parameter is set to true , the automation makes a partial HTTP request to the objects in the S3BucketName you specify. Only the first byte of the object is returned using the Range HTTP header. • IgnoreBlockPublicAccess Type: Boolean Valid values: true | false Default: false Description: (Optional) If this parameter is set to true , the automation ignores the public access block settings of the S3 bucket you specify in the S3BucketName parameter. Changing this parameter from the default value is not recommended. AWSSupport-TroubleshootS3PublicRead 719 AWS Systems Manager Automation runbook reference User Guide • MaxObjects Type: Integer Valid values: 1-25 Default: 5 Description: (Optional) The number of objects to analyze in the S3 bucket you specify in the S3BucketName parameter. • S3BucketName Type: String Description: (Required) The name of the S3 bucket to troubleshoot. • S3PrefixName Type: String Description: (Optional) The key name prefix of the objects you want to analyze in your S3 bucket. For more information, see Object keys in the Amazon Simple Storage Service User Guide . • StartAfter Type: String Description: (Optional) The object key name where you want the automation to begin analyzing objects in your S3 bucket. • ResourcePartition Type: String Valid values: aws | aws-us-gov | aws-cn Default: aws Description: (Required) The partition where your S3 bucket is located. • Verbose Type: Boolean Valid values: true | false AWSSupport-TroubleshootS3PublicRead 720 AWS Systems Manager Automation runbook reference User Guide Default: false Description: (Optional) To return more detailed information during the automation, set this parameter to true . Only warning and error messages will be returned if the parameter is set to false . Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. The logs:CreateLogGroup , logs:CreateLogStream , and logs:PutLogEvents permissions are only required if you want the automation to send log data to CloudWatch Logs. { "Version": "2012-10-17", "Statement": [ { "Action": [ "iam:SimulateCustomPolicy", "iam:GetContextKeysForCustomPolicy", "s3:ListAllMyBuckets", "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", "logs:PutRetentionPolicy", "s3:GetAccountPublicAccessBlock" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "s3:GetObject", "s3:GetObjectAcl", "s3:GetObjectTagging" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1/*", "Effect": "Allow" }, { AWSSupport-TroubleshootS3PublicRead 721 AWS Systems Manager Automation runbook reference User Guide "Action": [ "s3:ListBucket", "s3:GetBucketLocation", "s3:GetBucketPublicAccessBlock", "s3:GetBucketRequestPayment", "s3:GetBucketPolicyStatus", "s3:GetBucketPolicy", "s3:GetBucketAcl" ], "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1", "Effect": "Allow" } ] } Document Steps • aws:assertAwsResourceProperty - Confirms the S3 bucket exists, and is accessible. • aws:executeScript - Returns the S3 bucket location and your canonical user ID. • aws:executeScript - Returns the public access block settings for your account and the S3 bucket. • aws:assertAwsResourceProperty - Confirms the S3 bucket payer is set to BucketOwner . If Requester Pays is enabled on the S3 bucket, the automation ends. • aws:executeScript - Returns the S3 bucket policy status and determines whether it is considered public. For more information about public S3 buckets, see The meaning of "public" in the Amazon Simple Storage Service User Guide . • aws:executeAwsApi - Returns the S3 bucket policy. • aws:executeAwsApi - Returns all context keys found in the S3 bucket policy. • aws:assertAwsResourceProperty - Confirms whether there is an explicit deny in the S3 bucket policy for the GetObject API action. • aws:executeAwsApi - Returns the access control list (ACL) for the S3 bucket. • aws:executeScript - Creates a CloudWatch Logs log group and log stream if you specify a value for the CloudWatchLogGroupName parameter. • aws:executeScript - Based on the values you specify in the runbook input parameters, evaluates whether any of the S3 bucket settings gathered during the automation are preventing objects from being accessed by the public. This script performs
|
systems-manager-automation-runbook-guide-170
|
systems-manager-automation-runbook-guide.pdf
| 170 |
context keys found in the S3 bucket policy. • aws:assertAwsResourceProperty - Confirms whether there is an explicit deny in the S3 bucket policy for the GetObject API action. • aws:executeAwsApi - Returns the access control list (ACL) for the S3 bucket. • aws:executeScript - Creates a CloudWatch Logs log group and log stream if you specify a value for the CloudWatchLogGroupName parameter. • aws:executeScript - Based on the values you specify in the runbook input parameters, evaluates whether any of the S3 bucket settings gathered during the automation are preventing objects from being accessed by the public. This script performs the following functions: AWSSupport-TroubleshootS3PublicRead 722 AWS Systems Manager Automation runbook reference User Guide • Evaluates public access block settings • Returns objects from your S3 bucket based on the values you specify in the MaxObjects , S3PrefixName , and StartAfter parameters. • Returns the S3 bucket policy to simulate a custom IAM policy for the objects returned from your S3 bucket. • Performs a partial HTTP request to the returned objects if the HttpGet parameter is set to true . Only the first byte of the object is returned using the Range HTTP header. • Checks the returned object's key name to confirm whether it ends with one or two periods. Object key names that end in periods can't be downloaded from the Amazon S3 console. • Checks whether the returned object's owner matches the owner of the S3 bucket. • Checks whether the object's ACL grants READ or FULL_CONTROL permissions to anonymous users. • Returns tags associated with the object. • Uses the simulated IAM policy to confirm whether there is an explicit deny for this object in the S3 bucket policy for the GetObject API action. • Returns the object's metadata to confirm that the storage class is supported. • Checks the object's server-side encryption settings to confirm whether the object is encrypted using a AWS Key Management Service (AWS KMS) customer managed key. Outputs AnalyzeObjects.bucket AnalyzeObjects.object AWSSupport-EmptyS3Bucket Description The AWSSupport-EmptyS3Bucket automation runbook empties an existing Amazon Simple Storage Service (Amazon S3) bucket by using a lifecycle expiration configuration rule. Important • Amazon S3 buckets with Multi-factor Authentication (MFA) enabled are not supported. AWSSupport-EmptyS3Bucket 723 AWS Systems Manager Automation runbook reference User Guide • The lifecycle rules modified by this runbook permanently delete all objects and their versions in the specified Amazon S3 bucket. You cannot recover permanently deleted objects. For more information, review Expiring Objects. How does it work? The runbook AWSSupport-EmptyS3Bucket performs the following high-level steps: • Suspends bucket versioning, if enabled. • Updates the bucket policy to deny any s3:PutObject API calls (to prevent new uploads while it is being emptied). • Updates the lifecycle rules to delete all the objects according to the expiration days specified in the input parameters. Note • Object versions protected with Amazon S3 Object Lock are not deleted or overwritten by lifecycle configurations. • The deletion process is asynchronous and may take time to complete after the runbook execution finishes. Run this Automation (console) Document type Automation Owner Amazon Platforms / Required IAM permissions AWSSupport-EmptyS3Bucket 724 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. The AutomationAssumeRole parameter requires the following actions to successfully use the runbook: • ssm:DescribeAutomationExecutions • ssm:GetAutomationExecution • s3:GetBucketVersioning • s3:PutBucketVersioning • s3:GetBucketPolicy • s3:GetBucketLifecycleConfiguration • s3:GetLifecycleConfiguration • s3:PutBucketPolicy • s3:PutBucketLifecycleConfiguration • s3:PutLifecycleConfiguration • s3:DeleteBucketPolicy • s3:DeleteBucketLifecycle Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-EmptyS3Bucket in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • S3BucketName: The name of the Amazon S3 bucket you want to empty. AWSSupport-EmptyS3Bucket 725 AWS Systems Manager Automation runbook reference User Guide • SNSTopicArn: Provide the ARN of the Amazon SNS Topic for approval notification. This Amazon SNS topic is used to send approval notifications during required during the automation execution. • ApproverIAM: Provide a list of AWS authenticated principals who are able to either approve or reject the action. The maximum number of approvers is 10. You can specify principals by using any of these formats, an AWS Identity and Access Management (IAM) user name, an IAM user ARN, an IAM role ARN, or an IAM assume role user ARN. • MinimumRequiredApprovals (Optional): The minimum number of approvals required to resume the automation. If you don't specify a value, the system defaults to 1. The value for this parameter must be a positive number. The value for this
|
systems-manager-automation-runbook-guide-171
|
systems-manager-automation-runbook-guide.pdf
| 171 |
automation execution. • ApproverIAM: Provide a list of AWS authenticated principals who are able to either approve or reject the action. The maximum number of approvers is 10. You can specify principals by using any of these formats, an AWS Identity and Access Management (IAM) user name, an IAM user ARN, an IAM role ARN, or an IAM assume role user ARN. • MinimumRequiredApprovals (Optional): The minimum number of approvals required to resume the automation. If you don't specify a value, the system defaults to 1. The value for this parameter must be a positive number. The value for this parameter can't exceed the number of approvers defined by the ApproverIAM parameter. • NoncurrentVersionExpirationDays (Optional): Specify the number of days when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. • Default: 1 • Maximum Value: 365 • ExpirationDays (Optional): Specify the expiration for the lifecycle of the object in the form days. • Default: 1 • Maximum Value: 365 • AbortIncompleteMultipartUpload (Optional): Specify the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. • Default: 1 • Maximum Value: 365 • Acknowledgement: AWSSupport-EmptyS3Bucket 726 AWS Systems Manager Automation runbook reference User Guide Please read the complete details of the actions performed by this automation runbook and provide consent Yes, I understand and acknowledge if you acknowledge the steps. 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • checkConcurrency: Ensures there is only one execution of this runbook targeting the specified Amazon S3 bucket. If the runbook finds another in progress execution targeting the same bucket name, it returns an error and ends. • getBucketVersioningConfiguration: Fetches the versioning status of the specified Amazon S3 bucket. • branchOnStoppingIfMFADeleteEnabled (conditional): Stops the automation if Multi-factor Authentication (MFA) is enabled on the specified Amazon S3 bucket. • approvalToMakeChangesToTheProvidedS3Bucket: AWSSupport-EmptyS3Bucket 727 AWS Systems Manager Automation runbook reference User Guide Waits for designated principals approval to disable bucket versioning and update the bucket policy and lifecycle rules configuration for the specified Amazon S3 bucket. • branchOnBucketVersioningStatus (conditional): If versioning is enabled on the specified Amazon S3 bucket, disable it, otherwise continue to update bucket policy and lifecycle configuration. • suspendBucketVersioning: Suspends the versioning state of the specified Amazon S3 bucket. • updateBucketPolicyAndLifeCycleConfiguration: Adds or updates the bucket policy to deny all s3:PutObject requests and updates the lifecycle configuration to expire objects based on the user provided inputs parameters. • branchOnFailingIfBucketPropertiesNotUpdated (conditional): Checks the status of the updateBucketPolicyAndLifeCycleConfiguration step and tries to revert the original bucket versioning state if changed by automation. • branchOnFailureOriginalVersioningStatus (conditional): On failure, branches to determine the original versioning status. If was enabled and suspended by this automation, tries to enable it again. • onFailureRestoreBucketVersioning Restores the enabled versioning state of the specified Amazon S3 bucket. 7. After completed, review the Outputs section for the detailed results of the execution: AWSSupport-EmptyS3Bucket 728 AWS Systems Manager Automation runbook reference User Guide • Successful execution This workflow updates the bucket's lifecycle rule. Objects will be deleted according to the Delete-All-AWSSupport-EmptyS3-Bucket lifecycle policy. AWSSupport-EmptyS3Bucket 729 AWS Systems Manager Automation runbook reference User Guide • Failure execution Partial deletion will not be performed. If execution fails, the lifecycle and other bucket settings are rolled back. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows For more information on managing Amazon S3 buckets and objects, see Emptying a bucket. AWSSupport-TroubleshootS3EventNotifications Description The AWSSupport-TroubleshootS3EventNotifications AWS Systems Manager automation runbook helps troubleshoot Amazon Simple Storage Service (Amazon S3) Bucket Event Notifications configured with AWS Lambda Functions, Amazon Simple Notification Service (Amazon SNS) Topics, or Amazon Simple Queue Service (Amazon SQS) Queues. It provides a configuration settings report of the different resources configured with the the Amazon S3 Bucket as a destination event notification. How does it work? The runbook performs the following steps: • Checks if the Amazon S3 Bucket exists in the same account where AWSSupport- TroubleshootS3EventNotifications is executed. AWSSupport-TroubleshootS3EventNotifications 730 AWS Systems Manager Automation runbook reference User Guide • Fetches the destination resources (AWS Lambda Function, or Amazon SNS Topic or Amazon SQS queue) configured as Event Notifications for the Amazon S3 Bucket using the GetBucketNotificationConfiguration API. • Validates that the destination resource exists, then reviews the resource-based policy of the destination resources to determine if Amazon S3 is allowed to publish to the destination. • If you encrypted the destination with an AWS Key Management Service (AWS KMS) key, the key policy is checked to determine if Amazon S3 access is allowed. • Generates a report of all the destination resource checks. Important • This runbook can only evaluate event notification configurations if the Amazon S3 bucket owner is
|
systems-manager-automation-runbook-guide-172
|
systems-manager-automation-runbook-guide.pdf
| 172 |
or Amazon SQS queue) configured as Event Notifications for the Amazon S3 Bucket using the GetBucketNotificationConfiguration API. • Validates that the destination resource exists, then reviews the resource-based policy of the destination resources to determine if Amazon S3 is allowed to publish to the destination. • If you encrypted the destination with an AWS Key Management Service (AWS KMS) key, the key policy is checked to determine if Amazon S3 access is allowed. • Generates a report of all the destination resource checks. Important • This runbook can only evaluate event notification configurations if the Amazon S3 bucket owner is the same as the AWS account owner where the automation runbook is being executed. • Additionally, this runbook cannot evaluate policies on destination resources that are hosted in another AWS account. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSSupport-TroubleshootS3EventNotifications 731 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • S3BucketName Type: AWS::S3::Bucket::Name Description: (Required) The name of the Amazon S3 bucket configured with event notification(s). Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • s3:GetBucketLocation • s3:ListAllMyBuckets • s3:GetBucketNotification • sqs:GetQueueAttributes • sqs:GetQueueUrl • sns:GetTopicAttributes • kms:GetKeyPolicy • kms:DescribeKey • kms:ListAliases • lambda:GetPolicy • lambda:GetFunction • iam:GetContextKeysForCustomPolicy • iam:SimulateCustomPolicy • iam:ListRoles • ssm:DescribeAutomationStepExecutions Example IAM Policy for the Automation Assume Role AWSSupport-TroubleshootS3EventNotifications 732 AWS Systems Manager Automation runbook reference User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "S3Permission", "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:ListAllMyBuckets" ], "Resource": "*" }, { "Sid": "S3PermissionGetBucketNotification", "Effect": "Allow", "Action": [ "s3:GetBucketNotification" ], "Resource": "arn:aws:s3::::<bucket-name>" }, { "Sid": "SQSPermission", "Effect": "Allow", "Action": [ "sqs:GetQueueAttributes", "sqs:GetQueueUrl" ], "Resource": "arn:aws:sqs:<region>:123456789012:*" }, { "Sid": "SNSPermission", "Effect": "Allow", "Action": [ "sns:GetTopicAttributes" ], "Resource": "arn:aws:sns:<region>:123456789012:*" }, { "Sid": "KMSPermission", "Effect": "Allow", "Action": [ "kms:GetKeyPolicy", "kms:DescribeKey", "kms:ListAliases" AWSSupport-TroubleshootS3EventNotifications 733 AWS Systems Manager Automation runbook reference User Guide ], "Resource": "arn:aws:kms:<region>:123456789012:key/ <key-id>" }, { "Sid": "LambdaPermission", "Effect": "Allow", "Action": [ "lambda:GetPolicy", "lambda:GetFunction" ], "Resource": "arn:aws:lambda:<region>:123456789012:function:*" }, { "Sid": "IAMPermission", "Effect": "Allow", "Action": [ "iam:GetContextKeysForCustomPolicy", "iam:SimulateCustomPolicy", "iam:ListRoles" ], "Resource": "*" }, { "Sid": "SSMPermission", "Effect": "Allow", "Action": [ "ssm:DescribeAutomationStepExecutions" ], "Resource": "*" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-TroubleshootS3EventNotifications in Systems Manager under Documents. 2. Select Execute automation. AWSSupport-TroubleshootS3EventNotifications 734 AWS Systems Manager Automation runbook reference User Guide 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • S3BucketName (Required): The name of the Amazon S3 bucket configured with event notification(s). 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • ValidateInputs Validates Amazon S3 bucket provided belongs to the same account where the automation is executed and fetch the region the bucket is hosted. • GetBucketNotificationConfiguration Calls GetBucketNotificationConfiguration API to review Event Notifications configured with the Amazon S3 bucket and formats output. • BranchOnSQSResourcePolicy Branches on whether there are Amazon SQS resources in event notifications. • ValidateSQSResourcePolicy Validates resource policy on Amazon SQS Queue attributes has sqs:SendMessage permission for Amazon S3. If the Amazon SQS resource is encrypted, checks that encryption is not using default AWS KMS key i.e. aws/sqs and checks that AWS KMS key policy has permissions for Amazon S3. • BranchOnSNSResourcePolicy Branches on whether there are Amazon SNS resources in event notifications. AWSSupport-TroubleshootS3EventNotifications 735 AWS Systems Manager Automation runbook reference User Guide • ValidateSNSResourcePolicy Validates resource policy on Amazon SNS Topic attributes has sns:Publish permission for Amazon S3. If the Amazon SNS resource is encrypted, checks that encryption is not using default AWS KMS key i.e. aws/sns and checks that AWS KMS key policy has permissions for Amazon S3. • BranchOnLambdaFunctionResourcePolicy Branches on whether there are AWS Lambda functions in event notifications. • ValidateLambdaFunctionResourcePolicy Validates resource policy on AWS Lambda function has lambda:InvokeFunction permission for Amazon S3. • GenerateReport Returns details of the runbook steps outputs, and recommendations to resolve any issue with the event notifications configured with the Amazon S3 bucket. 7. After completed, review the Outputs section for the detailed results of the execution: • Amazon SQS Event Notifications If there are Amazon SQS destination notifications configured with the Amazon S3 bucket, a list of the Amazon SQS Queues is displayed alongside the results of the checks. The report includes Amazon SQS resource
|
systems-manager-automation-runbook-guide-173
|
systems-manager-automation-runbook-guide.pdf
| 173 |
are AWS Lambda functions in event notifications. • ValidateLambdaFunctionResourcePolicy Validates resource policy on AWS Lambda function has lambda:InvokeFunction permission for Amazon S3. • GenerateReport Returns details of the runbook steps outputs, and recommendations to resolve any issue with the event notifications configured with the Amazon S3 bucket. 7. After completed, review the Outputs section for the detailed results of the execution: • Amazon SQS Event Notifications If there are Amazon SQS destination notifications configured with the Amazon S3 bucket, a list of the Amazon SQS Queues is displayed alongside the results of the checks. The report includes Amazon SQS resource check, Amazon SQS access policy check, AWS KMS key check, AWS KMS key status check, and AWS KMS key policy check. • Amazon SNS Event Notifications If there are Amazon SNS destination notifications configured with the Amazon S3 bucket, a list of the Amazon SNS Topics is displayed alongside the results of the checks. The report includes Amazon SNS resource check, Amazon SNS access policy check, AWS KMS key check, AWS KMS key status check, and AWS KMS key policy check. • AWS Lambda Event Notifications If there are AWS Lambda destination notifications configured with the Amazon S3 bucket, a list of the Lambda functions is displayed alongside the results of the checks. The report includes Lambda resource check and Lambda access policy check. AWSSupport-TroubleshootS3EventNotifications 736 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWSSupport-ContainS3Resource Description The AWSSupport-ContainS3Resource runbook provides an automated solution for the procedure outlined in the article Support Automation Workflow (SAW) Runbook: Contain a compromised AWS Amazon S3 Bucket Important • This runbook performs various operations that require elevated privileges, such as modifying Amazon S3 bucket policies, tags, and public access configurations. These actions could potentially lead to privilege escalation or impact other workloads that depend on the targeted Amazon S3 bucket. You should review the permissions granted to the role specified by the AutomationAssumeRole parameter and ensure AWSSupport-ContainS3Resource 737 AWS Systems Manager Automation runbook reference User Guide they are appropriate for the intended use case. You can refer to the following AWS documentation for more information on IAM permissions: Identity and Access Management (IAM) Permissions AWS AWS Systems Manager Automation Permissions. • This runbook performs mutative actions that could potentially cause unavailability or disruption to your workloads. Specifically, the Contain action blocks all access to the specified Amazon S3 bucket, except for the roles specified in the SecureRoles parameter. This could impact any applications or services that rely on the targeted Amazon S3 bucket. • During the Contain action, this runbook may create an additional Amazon S3 bucket (specified by the BackupS3BucketName parameter) to store the backup of the original bucket's configuration, if it does not already exist. • If the Action parameter is set to Restore, this runbook attempts to restore the Amazon S3 bucket's configuration to its original state based on the backup stored in the BackupS3BucketName bucket. However, there is a risk that the restoration process may fail, leaving the Amazon S3 bucket in an inconsistent state. The runbook provides instructions for manual restoration in case of such failures, but you should be prepared to handle potential issues during the restoration process. It is recommended to review the runbook thoroughly, understand its potential impacts, and test it in a non-production environment before executing it in your production environment. How does it work? This runbook operates differently based on the resource type and action: • For Amazon S3 General Purpose Bucket Containment: The automation blocks public access to the bucket, disables ACL configuration, enforces Bucket Owner Object ownership, and puts a restrictive bucket policy denying all Amazon S3 actions to the bucket except for allow listed IAM Roles. • For Amazon S3 General Purpose Object Containment: The automation blocks Public Access to bucket, disables ACL configuration, enforces Bucket Owner Object ownership, and puts a restrictive bucket policy denying all Amazon S3 actions on the object except for allow listed IAM Roles. AWSSupport-ContainS3Resource 738 AWS Systems Manager Automation runbook reference User Guide • For Amazon S3 Directory Bucket Containment: The automation puts a restrictive bucket policy denying all Amazon S3 actions to the bucket except for allow listed IAM Roles. • For Amazon S3 General Purpose Bucket Restore: The automation restores the Block Public Access configuration, Bucket ACL configuration, Bucket Owner Object ownership and Bucket Policy to the initial configuration prior to containment. • For Amazon S3 General Purpose Object Restore: The automation restores the Block Public Access configuration, Bucket ACL configuration, Object ACL Configuration, Bucket Owner Object ownership and Bucket Policy to the initial configuration prior to containment. • For Amazon S3 Directory Bucket Restore: The automation restores the bucket
|
systems-manager-automation-runbook-guide-174
|
systems-manager-automation-runbook-guide.pdf
| 174 |
puts a restrictive bucket policy denying all Amazon S3 actions to the bucket except for allow listed IAM Roles. • For Amazon S3 General Purpose Bucket Restore: The automation restores the Block Public Access configuration, Bucket ACL configuration, Bucket Owner Object ownership and Bucket Policy to the initial configuration prior to containment. • For Amazon S3 General Purpose Object Restore: The automation restores the Block Public Access configuration, Bucket ACL configuration, Object ACL Configuration, Bucket Owner Object ownership and Bucket Policy to the initial configuration prior to containment. • For Amazon S3 Directory Bucket Restore: The automation restores the bucket policy to the initial configuration prior to containment. Run this Automation (console) Document Type Automation Owner Amazon Platform / Required IAM Permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • s3:CreateBucket • s3:DeleteBucketPolicy • s3:DeleteObjectTagging • s3:GetAccountPublicAccessBlock • s3:GetBucketAcl • s3:GetBucketLocation • s3:GetBucketOwnershipControls • s3:GetBucketPolicy AWSSupport-ContainS3Resource 739 AWS Systems Manager Automation runbook reference User Guide • s3:GetBucketPolicyStatus • s3:GetBucketTagging • s3:GetEncryptionConfiguration • s3:GetObject • s3:GetObjectAcl • s3:GetObjectTagging • s3:GetReplicationConfiguration • s3:ListBucket • s3:PutAccountPublicAccessBlock • s3:PutBucketACL • s3:PutBucketOwnershipControls • s3:PutBucketPolicy • s3:PutBucketPublicAccessBlock • s3:PutBucketTagging • s3:PutBucketVersioning • s3:PutObject • s3:PutObjectAcl • s3express:CreateSession • s3express:DeleteBucketPolicy • s3express:GetBucketPolicy • s3express:PutBucketPolicy • ssm:DescribeAutomationExecutions Here is an example of an IAM policy that grants the necessary permissions for the AutomationAssumeRole: { "Version": "2012-10-17", "Statement": [ { "Sid": "S3Permissions", "Effect": "Allow", "Action": [ AWSSupport-ContainS3Resource 740 AWS Systems Manager Automation runbook reference User Guide "s3:CreateBucket", "s3:DeleteBucketPolicy", "s3:DeleteObjectTagging", "s3:GetAccountPublicAccessBlock", "s3:GetBucketAcl", "s3:GetBucketLocation", "s3:GetBucketOwnershipControls", "s3:GetBucketPolicy", "s3:GetBucketPolicyStatus", "s3:GetBucketTagging", "s3:GetEncryptionConfiguration", "s3:GetObject", "s3:GetObjectAcl", "s3:GetObjectTagging", "s3:GetReplicationConfiguration", "s3:ListBucket", "s3:PutAccountPublicAccessBlock", "s3:PutBucketACL", "s3:PutBucketOwnershipControls", "s3:PutBucketPolicy", "s3:PutBucketPublicAccessBlock", "s3:PutBucketTagging", "s3:PutBucketVersioning", "s3:PutObject", "s3:PutObjectAcl" ], "Resource": "*" }, { "Sid": "S3ExpressPermissions", "Effect": "Allow", "Action": [ "s3express:CreateSession", "s3express:DeleteBucketPolicy", "s3express:GetBucketPolicy", "s3express:PutBucketPolicy" ], "Resource": "*" }, { "Sid": "SSMPermissions", "Effect": "Allow", "Action": [ "ssm:DescribeAutomationExecutions" AWSSupport-ContainS3Resource 741 AWS Systems Manager Automation runbook reference User Guide ], "Resource": "*" } ] } Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-ContainS3Resource in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • BucketName (Required): • Description: (Required) The name of the Amazon S3 bucket. • Type: AWS::S3::Bucket::Name • Action (Required): • Description: (Required) Select Contain to isolate the Amazon S3 resource or Restore to try to restore the resource configuration to its original state from a previous backup. • Type: String • Allowed Values: Contain|Restore • DryRun (Optional): • Description: (Optional) When set to true, the automation will not make any changes to the target Amazon S3 resource, instead it will output what it would have attempted to change. Default value: true. • Type: Boolean • Allowed Values: true|false • BucketKeyName (Optional): • Description: (Optional) The key of the Amazon S3 object you want to contain or restore. Used during object level containment. • Type: String • Allowed Pattern: ^[a-zA-Z0-9\\.\\-_\\\\!*'()/]{0,1024}$ • BucketRestrictAccess (Conditional): AWSSupport-ContainS3Resource 742 AWS Systems Manager Automation runbook reference User Guide • Description: (Conditional) The ARN of the IAM users or roles that will be allowed access to the target Amazon S3 resource after running the containment actions. This parameter is required when Action is set to Contain. • Type: StringList • Allowed Pattern: ^$|^arn:(aws|aws-cn|aws-us-gov|aws-iso(-[a-z])?):iam:: [0-9]{12}:(role|user)\\/[\\w+\\/=,.@-]+$ • TagIdentifier (Optional): • Description: (Optional) A tag in the format Key=BatchId,Value=78925 that will be added to the resources created or modified by this runbook during the containment workflow. • Type: String • Allowed Pattern: ^$|^[Kk][Ee][Yy]=[\\+\\-\\=\\.\\_\\:\\/@a-zA-Z0-9] {1,128},[Vv][Aa][Ll][Uu][Ee]=[\\+\\-\\=\\.\\_\\:\\/@a-zA-Z0-9] {0,128}$ • BackupS3BucketName (Conditional): • Description: (Conditional) The Amazon S3 bucket to backup the target resource configuration when the Action is set to Contain or to restore the configuration from when the Action is set to Restore. • Type: AWS::S3::Bucket::Name • BackupS3KeyName (Conditional): • Description: (Conditional) If Action is set to Restore, this specifies the Amazon S3 key the automation will use to try to restore the target resource configuration. • Type: String • Allowed Pattern: ^[a-zA-Z0-9\\.\\-_\\\\!*'()/]{0,1024}$ • BackupS3BucketAccess (Conditional): • Description: (Conditional) The ARN of the IAM users or roles that will be allowed access to the backup Amazon S3 bucket after running the containment actions. This parameter is required when Action is Contain. • Type: StringList • Allowed Pattern: ^$|^arn:(aws|aws-cn|aws-us-gov|aws-iso(-[a-z])?):iam:: [0-9]{12}:(role|user)\\/[\\w+\\/=,.@-]+$ • AutomationAssumeRole (Optional): AWSSupport-ContainS3Resource 743 AWS Systems Manager Automation runbook reference User Guide • Description: (Optional) The Amazon Resource Name (ARN) of the IAM role that allows Systems Manager Automation to perform the actions on your behalf. • Type: AWS::IAM::Role::Arn 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • validateRequiredInputs Validates the required automation input parameters based on the Action specified. • assertBucketExists Checks if the target Amazon S3 bucket exists and is accessible. • backupBucketPreChecks Checks if the backup Amazon S3 bucket potentially grants public read or write access to its objects. • backupTargetBucketMetadata Describes the current configuration of the target Amazon S3 bucket and uploads the
|
systems-manager-automation-runbook-guide-175
|
systems-manager-automation-runbook-guide.pdf
| 175 |
Description: (Optional) The Amazon Resource Name (ARN) of the IAM role that allows Systems Manager Automation to perform the actions on your behalf. • Type: AWS::IAM::Role::Arn 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • validateRequiredInputs Validates the required automation input parameters based on the Action specified. • assertBucketExists Checks if the target Amazon S3 bucket exists and is accessible. • backupBucketPreChecks Checks if the backup Amazon S3 bucket potentially grants public read or write access to its objects. • backupTargetBucketMetadata Describes the current configuration of the target Amazon S3 bucket and uploads the backup to the specified backup Amazon S3 bucket. • containBucket Performs bucket level operations to contain the target Amazon S3 bucket. • BranchOnActionAndMode Branches the automation based on the input parameters Action and DryRun. • RestoreInstanceConfiguration Restores the Amazon S3 bucket configuration from the backup. • containFinalOutput Consolidates containment activity in readable format. • ReportContain Outputs dry run details for the containment actions. AWSSupport-ContainS3Resource • ReportRestore 744 AWS Systems Manager Automation runbook reference User Guide Outputs dry run details for the restoring actions. • ReportRestoreFailure Provides instructions to restore the Amazon S3 bucket original configuration during a restore workflow failure scenario. • ReportContainmentFailure Provides instructions to restore the Amazon S3 bucket original configuration during a containment workflow failure scenario. • FinalOutput Outputs the details of the containment actions. 7. After the execution completes, review the Outputs section for the detailed results of the execution: • ContainFinalOutput.Output Outputs the details of the containment actions performed by this runbook when DryRun is set to False. • RestoreFinalOutput.Output Outputs the details of the restore actions performed by this runbook when DryRun is set to False. • ContainS3ResourceDryRun.Output Outputs the details of the containment actions performed by this runbook when DryRun is set to True. • RestoreS3ResourceDryRun.Output Outputs the details of the restore actions performed by this runbook when DryRun is set to True. • ReportContainmentFailure.Output Provides instructions to restore the target Amazon S3 resource original configuration during a containment workflow failure scenario. • ReportRestoreFailure.Output AWSSupport-ContainS3Resource 745 AWS Systems Manager Automation runbook reference User Guide Provides instructions to restore the target Amazon S3 resource original configuration during a restore workflow failure scenario. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows Amazon SES AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Email Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSSupport-AnalyzeSESMessageSendingStatus AWSSupport-AnalyzeSESMessageSendingStatus Description The AWSSupport-AnalyzeSESMessageSendingStatus automation runbook summarizes the email delivery status of undelivered email messages and gives you advice to solve why it was undelivered. The runbook retrieves Amazon Simple Email Service (Amazon SES) email sending events stored in an Amazon CloudWatch Logs group published by Amazon SES. For Amazon SES event publishing details, please refer to Monitoring using Amazon Simple Email Service event publishing. The runbook also provides a summary and the timeline of the email deliveries as well as recommendations which can potentially affect undelivered email messages. You can find those messages in the output section of each executions. Please note that this runbook can only troubleshoot the events after the event store deployment. How does it work? Amazon SES 746 AWS Systems Manager Automation runbook reference User Guide The runbook performs the following steps: • Checks concurrent automation executions for the same CloudWatch Logs group. • Analyze Amazon SES events corresponding to message IDs given by the automation parameter. • Output delivery summaries to the output section of the automation execution. Important • Before executing this runbook, you have to store published Amazon SES events to a CloudWatch Logs log group specified by the automation parameter. This runbook only analyzes Amazon SES events stored in the log group. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • logs:StartQuery • logs:GetQueryResults • ses:GetIdentityMailFromDomainAttributes AWSSupport-AnalyzeSESMessageSendingStatus 747 AWS Systems Manager Automation runbook reference User Guide • ses:GetSendQuota • ssm:DescribeAutomationExecutions • ssm:GetAutomationExecution Instructions Follow these steps to configure the automation: 1. Navigate to AWSSupport-AnalyzeSESMessageSendingStatus in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • MessageIds (Required) Comma separated Amazon Simple Email Service message IDs of the Amazon Simple Email Service events that you would like to analyze. • CloudWatchLogsGroup (Optional) The Amazon CloudWatch Logs group which
|
systems-manager-automation-runbook-guide-176
|
systems-manager-automation-runbook-guide.pdf
| 176 |
to AWSSupport-AnalyzeSESMessageSendingStatus in Systems Manager under Documents. 2. Select Execute automation. 3. For the input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user who starts this runbook. • MessageIds (Required) Comma separated Amazon Simple Email Service message IDs of the Amazon Simple Email Service events that you would like to analyze. • CloudWatchLogsGroup (Optional) The Amazon CloudWatch Logs group which stores Amazon Simple Email Service events. The default log group name is `/ses/sending_event_logs`. If you would like to utilize another log group than the default log group, please enter your log group name in this field.", • QueryStartTime (Optional) The start time of the time range for the event analysis. The valid time format is ISO8601 (e.g. `yyyy-MM-ddTHH:mm:ss`, `1970-01-01T00:00:00`). The default date time is 30 days ago. • QueryEndTime (Optional) The end time of the time range for the event analyasis. The valid time format is ISO8601 (e.g. `yyyy-MM-ddTHH:mm:ss`, `1970-01-01T00:00:00`). The default date time is the current time. AWSSupport-AnalyzeSESMessageSendingStatus 748 AWS Systems Manager Automation runbook reference User Guide 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • CheckConcurrency: Ensures that there is only one execution of this runbook targeting the Amazon CloudWatch Logs group. If the runbook finds another execution targeting the same log group, it returns an error and ends. • AnalyzeSesEvents: Analyze Amazon Simple Email Service events stored in the Amazon CloudWatch Logs group specified by the automation parameter. • OutputFailureReason: Output execution step failure messages when the AnalyzeSESMessageSendingStatus step failed. 7. After completed, review the Outputs section for the detailed results of the execution: • Output of analysis on an undelivered email message because of a bounce Output of an automation execution for an email message that didn't reach the destination mailbox because of a bounce. AWSSupport-AnalyzeSESMessageSendingStatus 749 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page SageMaker AI AWS Systems Manager Automation provides predefined runbooks for Amazon SageMaker AI. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-DisableSageMakerNotebookRootAccess AWS-DisableSageMakerNotebookRootAccess Description SageMaker AI 750 AWS Systems Manager Automation runbook reference User Guide The AWS-DisableSageMakerNotebookRootAccess runbook disables root access on a Amazon SageMaker AI notebook instance. During the automation, the notebook instance is stopped to make the required changes. SageMaker AI Studio notebook instances aren't supported. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • NotebookInstanceName Type: String Description: (Required) The name of the SageMaker AI notebook instance to disable root access on. • StartInstanceAfterUpdate Type: Boolean Default: true Description: (Optional) Determines whether the notebook instance is started after disabling root access. The default setting for this parameter is true. If set to true, the instance is started after AWS-DisableSageMakerNotebookRootAccess 751 AWS Systems Manager Automation runbook reference User Guide root access is disabled. If set to false, the instance is left in the stopped state after root access is disabled. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • sagemaker:DescribeNotebookInstance • sagemaker:StartNotebookInstance • sagemaker:StopNotebookInstance • sagemaker:UpdateNotebookInstance Document Steps • CheckNotebookInstanceStatus (aws:executeAwsApi): Checks the current status of the notebook instance. • StopOrUpdateNotebookInstance (aws:branch): Branches based on the status of the notebook instance. • StopNotebookInstance (aws:executeAwsApi): Starts the instance if the status is stopped. • WaitForInstanceToStop (aws:waitForAwsResourceProperty): Verifies the instance is stopped. • UpdateNotebookInstance (aws:executeAwsApi): Disables root access on the notebook instance. • WaitForNotebookUpdate (aws:waitForAwsResourceProperty): Verifies root access has been disabled and the instance has a stopped status. • ChooseInstanceStart (aws:branch): Branch based on whether the instance should be started. • StartNotebookInstance (aws:executeAwsApi): Starts the notebook instance. • VerifyNotebookInstanceStatus (aws:waitForAwsResourceProperty): Verifies if the instance is available before disabling root access. • VerifyNotebookInstanceRootAccess (aws:assertAwsResourceProperty): Verifies the notebook instance root access setting is successfully disabled. AWS-DisableSageMakerNotebookRootAccess 752 AWS Systems Manager Automation runbook reference User Guide Secrets Manager AWS Systems Manager Automation provides predefined runbooks for AWS Secrets Manager. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-DeleteSecret • AWSConfigRemediation-RotateSecret AWSConfigRemediation-DeleteSecret Description The AWSConfigRemediation-DeleteSecret runbook deletes a
|
systems-manager-automation-runbook-guide-177
|
systems-manager-automation-runbook-guide.pdf
| 177 |
ChooseInstanceStart (aws:branch): Branch based on whether the instance should be started. • StartNotebookInstance (aws:executeAwsApi): Starts the notebook instance. • VerifyNotebookInstanceStatus (aws:waitForAwsResourceProperty): Verifies if the instance is available before disabling root access. • VerifyNotebookInstanceRootAccess (aws:assertAwsResourceProperty): Verifies the notebook instance root access setting is successfully disabled. AWS-DisableSageMakerNotebookRootAccess 752 AWS Systems Manager Automation runbook reference User Guide Secrets Manager AWS Systems Manager Automation provides predefined runbooks for AWS Secrets Manager. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-DeleteSecret • AWSConfigRemediation-RotateSecret AWSConfigRemediation-DeleteSecret Description The AWSConfigRemediation-DeleteSecret runbook deletes a secret and all of the versions stored in AWS Secrets Manager. You can optionally specify the recovery window during which you can restore the secret. If you don't specify a value for the RecoveryWindowInDays parameter, the operation defaults to 30 days. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Secrets Manager 753 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • RecoveryWindowInDays Type: Integer Valid values: 7-30 Default: 30 Description: (Optional) The number of days which you can restore the secret. • SecretId Type: String Description: (Required) The Amazon Resource Name (ARN) of the secret you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • secretsmanager:DeleteSecret • secretsmanager:DescribeSecret Document Steps • aws:executeAwsApi - Deletes the secret you specify in the SecretId parameter. • aws:executeScript - Verifies the secret has been scheduled for deletion. AWSConfigRemediation-RotateSecret Description AWSConfigRemediation-RotateSecret 754 AWS Systems Manager Automation runbook reference User Guide The AWSConfigRemediation-RotateSecret runbook rotates a secret stored in AWS Secrets Manager. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • RotationInterval Type: Interval Valid values: 1-365 Description: (Required) The number of days between rotations of the secret. • RotationLambdaArn Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Lambda funtion that can rotate the secret. • SecretId Type: String AWSConfigRemediation-RotateSecret 755 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the secret you want to rotate. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • lambda:InvokeFunction • secretsmanager:DescribeSecret • secretsmanager:RotateSecret Document Steps • aws:executeAwsApi - Rotates the secret you specify in the SecretId parameter. • aws:executeScript - Verifies rotation has been enabled on the secret. Security Hub AWS Systems Manager Automation provides predefined runbooks for AWS Security Hub. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-EnableSecurityHub AWSConfigRemediation-EnableSecurityHub Description The AWSConfigRemediation-EnableSecurityHub runbook enables AWS Security Hub (Security Hub) for the AWS account and AWS Region where you run the automation. For information about Security Hub, see What is AWS Security Hub? in the AWS Security Hub User Guide . Security Hub 756 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • EnableDefaultStandards Type: Boolean Default: true Description: (Required) If set to true , the default security standards designated by Security Hub are enabled. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • securityhub:DescribeHub • securityhub:EnableSecurityHub • ssm:StartAutomationExecution AWSConfigRemediation-EnableSecurityHub 757 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution Document Steps • aws:executeAwsApi - Enables Security Hub in the current account and Region. • aws:executeAwsApi - Verifies that Security Hub has been enabled. AWS Shield AWS Systems Manager Automation provides predefined runbooks for AWS Shield. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSPremiumSupport-DDoSResiliencyAssessment AWSPremiumSupport-DDoSResiliencyAssessment Description The AWSPremiumSupport-DDoSResiliencyAssessment, AWS Systems Manager automation runbook helps you to check DDoS vulnerabilities and configuration of resources in accordance with the AWS Shield Advanced protection for your AWS account. It provides a configuration settings report for resources that are vulnerable to Distributed Denial of Service (DDoS) attacks. It is used to collect, analyze, and assess the following resources: Amazon Route 53, Amazon Load Balancers, Amazon CloudFront distributions, AWS Global Accelerator and AWS Elastic IPs for
|
systems-manager-automation-runbook-guide-178
|
systems-manager-automation-runbook-guide.pdf
| 178 |
more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSPremiumSupport-DDoSResiliencyAssessment AWSPremiumSupport-DDoSResiliencyAssessment Description The AWSPremiumSupport-DDoSResiliencyAssessment, AWS Systems Manager automation runbook helps you to check DDoS vulnerabilities and configuration of resources in accordance with the AWS Shield Advanced protection for your AWS account. It provides a configuration settings report for resources that are vulnerable to Distributed Denial of Service (DDoS) attacks. It is used to collect, analyze, and assess the following resources: Amazon Route 53, Amazon Load Balancers, Amazon CloudFront distributions, AWS Global Accelerator and AWS Elastic IPs for their configuration settings in accordance with the recommended best practices for AWS Shield Advanced Protection. The final configuration report is available in an Amazon S3 bucket of your choice as an HTML file. How does it work? This runbook contains a series of checks for the various types of resources that are enabled for public access and if they have protections configured as per the recommendations in the AWS DDoS Best Practices Whitepaper. The runbook performs the following: • Checks if a subscription to AWS Shield Advanced is enabled. AWS Shield 758 AWS Systems Manager Automation runbook reference User Guide • If enabled, it finds if there are any Shield Advanced protected resources. • It finds all the global and regional resources in the AWS account and checks if these are Shield protected. • It requires the Resource Type parameters for assessment, Amazon S3 bucket name, and the Amazon S3 bucket AWS account ID (S3BucketOwner). • It returns the findings as an HTML report stored in the Amazon S3 bucket provided. The input parameters AssessmentType decides if the checks on all resources will be performed. By default, the runbook checks for all types of resources. If only GlobalResources or RegionalResources parameter is selected, the runbook performs checks only on the selected resource types. Important • Access to AWSPremiumSupport-* runbooks requires an Enterprise or Business Support subscription. For more information, see Compare Support Plans. • This runbook requires an ACTIVE AWS Shield Advanced subscription. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSPremiumSupport-DDoSResiliencyAssessment 759 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AssessmentType Type: String Description: (Optional) Determines the type of resources to be evaluated for DDoS resiliency assessment. By default, the runbook will evaluate both global and regional resources. For regional resources, the runbook describes all Application (ALB) and Network (NLB) load balancers as well as all the Auto Scaling group in your AWS account/region. Valid values: ['Global Resources', 'Regional Resources', 'Global and Regional Resources'] Default: Global and Regional Resources • S3BucketName Type: AWS::S3::Bucket::Name Description: (Required) The Amazon S3 bucket name where the report will be uploaded. Allowed Pattern: ^[0-9a-z][a-z0-9\-\.]{3,63}$ • S3BucketOwnerAccount Type: String Description: (Optional) The AWS account that owns the Amazon S3 bucket. Please specify this parameter if the Amazon S3 bucket belongs to a different AWS account, otherwise you can leave this parameter empty. Allowed Pattern: ^$|^[0-9]{12,13}$ • S3BucketOwnerRoleArn Type: AWS::IAM::Role::Arn Description: (Optional) The ARN of an IAM role with permissions to describe the Amazon S3 bucket and AWS account block public access configuration if the bucket is in a different AWS AWSPremiumSupport-DDoSResiliencyAssessment 760 AWS Systems Manager Automation runbook reference User Guide account. If this parameter is not specified, the runbook uses the AutomationAssumeRole or the IAM user that starts this runbook (if AutomationAssumeRole is not specified). Please see the required permissions section in the runbook description. Allowed Pattern: ^$|^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):iam::[0-9] {12,13}:role/.*$ • S3BucketPrefix Type: String Description: (Optional) The prefix for the path inside Amazon S3 for storing the results. Allowed Pattern: ^[a-zA-Z0-9][-./a-zA-Z0-9]{0,255}$|^$ Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • autoscaling:DescribeAutoScalingGroups • cloudfront:ListDistributions • ec2:DescribeAddresses • ec2:DescribeNetworkAcls • ec2:DescribeInstances • elasticloadbalancing:DescribeLoadBalancers • elasticloadbalancing:DescribeTargetGroups • globalaccelerator:ListAccelerators • iam:GetRole • iam:ListAttachedRolePolicies • route53:ListHostedZones • route53:GetHealthCheck • shield:ListProtections • shield:GetSubscriptionState • shield:DescribeSubscription • shield:DescribeEmergencyContactSettings AWSPremiumSupport-DDoSResiliencyAssessment 761 AWS Systems Manager Automation runbook reference User Guide • shield:DescribeDRTAccess • waf:GetWebACL • waf:GetRateBasedRule • wafv2:GetWebACL • wafv2:GetWebACLForResource • waf-regional:GetWebACLForResource • waf-regional:GetWebACL • s3:ListBucket • s3:GetBucketAcl • s3:GetBucketLocation • s3:GetBucketPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketEncryption • s3:GetAccountPublicAccessBlock • s3:PutObject Example IAM Policy for the Automation Assume Role { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:ListBucket", "s3:GetBucketAcl", "s3:GetAccountPublicAccessBlock" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "s3:ListBucket", "s3:GetBucketAcl", "s3:GetBucketLocation", AWSPremiumSupport-DDoSResiliencyAssessment 762 AWS Systems Manager Automation runbook reference User Guide "s3:GetBucketPublicAccessBlock", "s3:GetBucketPolicyStatus", "s3:GetEncryptionConfiguration" ], "Resource": "arn:aws:s3:::<bucket-name>", "Effect": "Allow" }, { "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::<bucket-name>/*", "Effect": "Allow" }, {
|
systems-manager-automation-runbook-guide-179
|
systems-manager-automation-runbook-guide.pdf
| 179 |
761 AWS Systems Manager Automation runbook reference User Guide • shield:DescribeDRTAccess • waf:GetWebACL • waf:GetRateBasedRule • wafv2:GetWebACL • wafv2:GetWebACLForResource • waf-regional:GetWebACLForResource • waf-regional:GetWebACL • s3:ListBucket • s3:GetBucketAcl • s3:GetBucketLocation • s3:GetBucketPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketEncryption • s3:GetAccountPublicAccessBlock • s3:PutObject Example IAM Policy for the Automation Assume Role { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:ListBucket", "s3:GetBucketAcl", "s3:GetAccountPublicAccessBlock" ], "Resource": "*", "Effect": "Allow" }, { "Action": [ "s3:ListBucket", "s3:GetBucketAcl", "s3:GetBucketLocation", AWSPremiumSupport-DDoSResiliencyAssessment 762 AWS Systems Manager Automation runbook reference User Guide "s3:GetBucketPublicAccessBlock", "s3:GetBucketPolicyStatus", "s3:GetEncryptionConfiguration" ], "Resource": "arn:aws:s3:::<bucket-name>", "Effect": "Allow" }, { "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::<bucket-name>/*", "Effect": "Allow" }, { "Action": [ "autoscaling:DescribeAutoScalingGroups", "cloudfront:ListDistributions", "ec2:DescribeInstances", "ec2:DescribeAddresses", "ec2:DescribeNetworkAcls", "elasticloadbalancing:DescribeLoadBalancers", "elasticloadbalancing:DescribeTargetGroups", "globalaccelerator:ListAccelerators", "iam:GetRole", "iam:ListAttachedRolePolicies", "route53:ListHostedZones", "route53:GetHealthCheck", "shield:ListProtections", "shield:GetSubscriptionState", "shield:DescribeSubscription", "shield:DescribeEmergencyContactSettings", "shield:DescribeDRTAccess", "waf:GetWebACL", "waf:GetRateBasedRule", "wafv2:GetWebACL", "wafv2:GetWebACLForResource", "waf-regional:GetWebACLForResource", "waf-regional:GetWebACL" ], "Resource": "*", "Effect": "Allow" }, { AWSPremiumSupport-DDoSResiliencyAssessment 763 AWS Systems Manager Automation runbook reference User Guide "Action": "iam:PassRole", "Resource": "arn:aws:iam::123456789012:role/ <AutomationAssumeRole-Name>", "Effect": "Allow" } ] } Instructions 1. Navigate to the AWSPremiumSupport-DDoSResiliencyAssessment in the AWS Systems Manager Console. 2. Select Execute Automation 3. For input parameters, enter the following: • AutomationAssumeRole (Optional): The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AssessmentType (Optional): Determines the type of resources to evaluate for DDoS resiliency assessment. By default, the runbook evaluates both global and regional resources. • S3BucketName (Required): The name of the Amazon S3 bucket to save the assessment report in HTML format. • S3BucketOwner (Optional): The AWS account ID of the Amazon S3 bucket for ownership verification. The AWS account ID is required if the report needs to publish to a cross-account Amazon S3 bucket and optional if the Amazon S3 bucket is in the same AWS account as automation initiation. • S3BucketPrefix (Optional): Any prefix for the path inside Amazon S3 for storing the results. AWSPremiumSupport-DDoSResiliencyAssessment 764 AWS Systems Manager Automation runbook reference User Guide 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • CheckShieldAdvancedState: Checks if the Amazon S3 bucket specified in the "S3BucketName" allows anonymous, or public read or write access permissions, whether the bucket has encryption at rest enabled, and if the AWS account ID provided in "S3BucketOwner" is the owner of the Amazon S3 bucket. • S3BucketSecurityChecks: Checks if the Amazon S3 bucket specified in the "S3BucketName" allows anonymous, or public read or write access permissions, whether the bucket has encryption at rest enabled, and if the AWS account ID provided in "S3BucketOwner" is the owner of the Amazon S3 bucket. • BranchOnShieldAdvancedStatus: Branches document steps based on the AWS Shield Advanced Subscription status and/or Amazon S3 Bucket Ownership status. • ShieldAdvancedConfigurationReview: Reviews Shield Advanced configurations to ensure minimum required details are present. For example: IAM Access for AWS Shield Response Team (SRT) Team, Contact List Details, and SRT Proactive Engagement Status. • ListShieldAdvancedProtections: Lists the Shield Protected Resources and creates a group of protected resources for each service. • BranchOnResourceTypeAndCount: AWSPremiumSupport-DDoSResiliencyAssessment 765 AWS Systems Manager Automation runbook reference User Guide Branches document steps based on the value of Resource Type parameter and the number of Shield protected global resources. • ReviewGlobalResources: Reviews the Shield Advanced protected Global resources like Route 53 Hosted Zones, CloudFront Distributions and Global Accelerators. • BranchOnResourceType: Branches document steps based on the Resource type selections, if Global, Regional, or both. • ReviewRegionalResources: Reviews the Shield Advanced protected Regional resources like Application Load Balancers, Network Load Balancers, Classic Load Balancers, Amazon Elastic Compute Cloud (Amazon EC2) Instances (Elastic IPs). • SendReportToS3: Uploads the DDoS Assessment Report details to the Amazon S3 bucket. 7. After completed, the URI for the assessment report HTML file is provided in the Amazon S3 bucket: S3 Console link and Amazon S3 URI for the Report on successful execution of the runbook References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation AWSPremiumSupport-DDoSResiliencyAssessment 766 AWS Systems Manager Automation runbook reference User Guide • Support Automation Workflows landing page AWS service documentation • AWS Shield Advanced Amazon SNS AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Notification Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-EnableSNSTopicDeliveryStatusLogging • AWSConfigRemediation-EncryptSNSTopic • AWS-PublishSNSNotification AWS-EnableSNSTopicDeliveryStatusLogging Description The AWS-EnableSNSTopicDeliveryStatusLogging runbook configures delivery status logging for a HTTP, Amazon Data Firehose, Lambda, Platform application, or Amazon Simple Queue Service (Amazon SQS) endpoint. This allow Amazon SNS to log failed alerts and a sample percentage of successful alert notifications to Amazon CloudWatch. If delivery status logging is already configured for the topic, the runbook replaces the existing configuration with the new
|
systems-manager-automation-runbook-guide-180
|
systems-manager-automation-runbook-guide.pdf
| 180 |
provides predefined runbooks for Amazon Simple Notification Service. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-EnableSNSTopicDeliveryStatusLogging • AWSConfigRemediation-EncryptSNSTopic • AWS-PublishSNSNotification AWS-EnableSNSTopicDeliveryStatusLogging Description The AWS-EnableSNSTopicDeliveryStatusLogging runbook configures delivery status logging for a HTTP, Amazon Data Firehose, Lambda, Platform application, or Amazon Simple Queue Service (Amazon SQS) endpoint. This allow Amazon SNS to log failed alerts and a sample percentage of successful alert notifications to Amazon CloudWatch. If delivery status logging is already configured for the topic, the runbook replaces the existing configuration with the new values you specify for the input parameters. Run this Automation (console) Document type Automation Owner Amazon Amazon SNS 767 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • EndpointType Type: String Valid values: • HTTP • Firehose • Lambda • Application • SQS Description: (Required) The type of Amazon SNS topic endpoint you want to log delivery status notification messages for. • TopicArn Type: String Description: (Required) The ARN of the Amazon SNS topic you want to configure delivery status logging for. • SuccessFeedbackRoleArn Type: String Description: (Required) The ARN of the IAM role which Amazon SNS uses to send logs for successful notification messages to CloudWatch. AWS-EnableSNSTopicDeliveryStatusLogging 768 AWS Systems Manager Automation runbook reference User Guide • SuccessFeedbackSampleRate Type: String Valid values: 0-100 Description: (Required) The percentage of successful messages to sample for the specified Amazon SNS topic. • FailureFeedbackRoleArn Type: String Description: (Required) The ARN of the IAM role which Amazon SNS uses to send logs for failure notification messages to CloudWatch. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:PassRole • sns:GetTopicAttributes • sns:SetTopicAttributes Document Steps • aws:executeAwsApi - Applies the value for the SuccessFeedbackRoleArn parameter to the Amazon SNS topic. • aws:executeAwsApi - Applies the value for the SuccessFeedbackSampleRate parameter to the Amazon SNS topic. • aws:executeAwsApi - Applies the value for the FailureFeedbackRoleArn parameter to the Amazon SNS topic. • aws:executeScript - Confirms delivery status logging is enabled on the Amazon SNS topic. Outputs AWS-EnableSNSTopicDeliveryStatusLogging 769 AWS Systems Manager Automation runbook reference User Guide VerifyDeliveryStatusLoggingEnabled.GetTopicAttributesResponse - Response from the GetTopicAttributes API operations. VerifyDeliveryStatusLoggingEnabled.VerifyDeliveryStatusLoggingEnabled - Message indicating successful verification of delivery status logging. AWSConfigRemediation-EncryptSNSTopic Description The AWSConfigRemediation-EncryptSNSTopic runbook enables encryption on the Amazon Simple Notification Service (Amazon SNS) topic you specify using an AWS Key Management Service (AWS KMS) customer managed key. This runbook should only be used as a baseline to ensure that your Amazon SNS topics are encrypted according to minimum recommended security best practices. We recommend encrypting multiple topics with different customer managed keys. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • KmsKeyArn Type: String AWSConfigRemediation-EncryptSNSTopic 770 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS KMS customer managed key you want to use to encrypt the Amazon SNS topic. • TopicArn Type: String Description: (Required) The ARN of the Amazon SNS topic you want to encrypt. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • sns:GetTopicAttributes • sns:SetTopicAttributes Document Steps • aws:executeAwsApi - Encrypts the Amazon SNS topic you specify in the TopicArn parameter. • aws:assertAwsResourceProperty - Confirms encryption is enabled on the Amazon SNS topic. AWS-PublishSNSNotification Description Publish a notification to Amazon SNS. Run this Automation (console) Document type Automation Owner AWS-PublishSNSNotification 771 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Message Type: String Description: (Required) The message to include in the SNS notification. • TopicArn Type: String Description: (Required) The ARN of the SNS topic to publish the notification to. Amazon SQS AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Queue Service (Amazon SQS). For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content.
|
systems-manager-automation-runbook-guide-181
|
systems-manager-automation-runbook-guide.pdf
| 181 |
(IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Message Type: String Description: (Required) The message to include in the SNS notification. • TopicArn Type: String Description: (Required) The ARN of the SNS topic to publish the notification to. Amazon SQS AWS Systems Manager Automation provides predefined runbooks for Amazon Simple Queue Service (Amazon SQS). For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-EnableSQSEncryption AWS-EnableSQSEncryption Description Amazon SQS 772 AWS Systems Manager Automation runbook reference User Guide The AWS-EnableSQSEncryption runbook enables encryption at rest for an Amazon Simple Queue Service (Amazon SQS) queue. An Amazon SQS queue can be encrypted with Amazon SQS managed keys (SSE-SQS), or with AWS Key Management Service (AWS KMS) managed keys (SSE- KMS). The key that you assign to your queue must have a key policy that includes permissions for all principals that are authorized to use the queue. With encryption enabled, anonymous SendMessage and ReceiveMessage requests to the encrypted queue are rejected. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • QueueUrl Type: String Description: (Required) The URL of the Amazon SQS queue you want to enable encryption on. • KmsKeyId Type: String AWS-EnableSQSEncryption 773 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The AWS KMS key to use for encryption. This value can be a globally unique identifier, an ARN to either an alias or a key, or an alias name prefixed by "alias/". You can also use the AWS managed key by specifying the alias aws/sqs. • KmsDataKeyReusePeriodSeconds Type: String Valid values: 60-86400 Default: 300 Description: (Optional) The length of time, in seconds, an Amazon SQS queue can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • sqs:GetQueueAttributes • sqs:SetQueueAttributes Document Steps • SelectKeyType (aws:branch): Branches based on the key specified. • PutAttributeSseKms (aws:executeAwsApi) - Updates the Amazon SQS queue to use the AWS KMS key specified for encryption. • PutAttributeSseSqs (aws:executeAwsApi) - Updates the Amazon SQS queue to use the default key for encryption. • VerifySqsEncryptionKms (aws:assertAwsResourceProperty) - Verifies encryption is enabled on the Amazon SQS queue. • VerifySqsEncryptionDefault (aws:assertAwsResourceProperty) - Verifies encryption is enabled on the Amazon SQS queue. AWS-EnableSQSEncryption 774 AWS Systems Manager Automation runbook reference User Guide Step Functions AWS Systems Manager Automation provides predefined runbooks for AWS Step Functions (Step Functions). For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-EnableStepFunctionsStateMachineLogging AWS-EnableStepFunctionsStateMachineLogging Description The AWS-EnableStepFunctionsStateMachineLogging runbook enables or updates logging on the AWS Step Functions state machine you specify. The minimum logging level must be set to ALL, ERROR, or FATAL. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. Step Functions 775 AWS Systems Manager Automation runbook reference User Guide • Level Type: String Valid values: ALL | ERROR | FATAL Description: (Required) The URL of the Amazon SQS queue you want to enable encryption on. • LogGroupArn Type: String Description: (Required) The ARN of the Amazon CloudWatch Logs log group you want to send state machine logs to. • StateMachineArn Type: String Description: (Required) The ARN of the state machine you want enable logging on. • IncludeExecutionData Type: Boolean Default: False Description: (Optional) Determines whether execution data is included in the logs. • TracingConfiguration Type: Boolean Default: False Description: (Optional) Determines whether AWS X-Ray tracing is enabled. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution AWS-EnableStepFunctionsStateMachineLogging 776 AWS Systems Manager Automation runbook reference User Guide • states:DescribeStateMachine • states:UpdateStateMachine Document Steps • EnableStepFunctionsStateMachineLogging (aws:executeAwsApi) - Updates the specified state machine with the logging configuration specified. • VerifyStepFunctionsStateMachineLoggingEnabled (aws:assertAwsResourceProperty) - Verifies logging was enabled for the specified state machine. Outputs • EnableStepFunctionsStateMachineLogging.Response - Response from the UpdateStateMachine API call. Systems Manager AWS Systems Manager
|
systems-manager-automation-runbook-guide-182
|
systems-manager-automation-runbook-guide.pdf
| 182 |
whether execution data is included in the logs. • TracingConfiguration Type: Boolean Default: False Description: (Optional) Determines whether AWS X-Ray tracing is enabled. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution AWS-EnableStepFunctionsStateMachineLogging 776 AWS Systems Manager Automation runbook reference User Guide • states:DescribeStateMachine • states:UpdateStateMachine Document Steps • EnableStepFunctionsStateMachineLogging (aws:executeAwsApi) - Updates the specified state machine with the logging configuration specified. • VerifyStepFunctionsStateMachineLoggingEnabled (aws:assertAwsResourceProperty) - Verifies logging was enabled for the specified state machine. Outputs • EnableStepFunctionsStateMachineLogging.Response - Response from the UpdateStateMachine API call. Systems Manager AWS Systems Manager Automation provides predefined runbooks for Systems Manager. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-BulkDeleteAssociation • AWS-BulkEditOpsItems • AWS-BulkResolveOpsItems • AWS-ConfigureMaintenanceWindows • AWS-CreateManagedLinuxInstance • AWS-CreateManagedWindowsInstance • AWSConfigRemediation-EnableCWLoggingForSessionManager • AWS-ExportOpsDataToS3 • AWS-ExportPatchReportToS3 • AWS-SetupInventory • AWS-SetupManagedInstance Systems Manager 777 AWS Systems Manager Automation runbook reference User Guide • AWS-SetupManagedRoleOnEC2Instance • AWSSupport-TroubleshootManagedInstance • AWSSupport-TroubleshootPatchManagerLinux • AWSSupport-TroubleshootSessionManager AWS-BulkDeleteAssociation Description The AWS-BulkDeleteAssociation runbook helps you to delete up to 50 Systems Manager State Manager associations at a time. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AssociationIds Type: StringList Description: (Required) A comma-separated list of the IDs of the associations you want to delete. AWS-BulkDeleteAssociation 778 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:DeleteAssociation Document Steps • aws:executeScript - Deletes the associations you specify in the AssociationIds parameter. AWS-BulkEditOpsItems Description The AWS-BulkEditOpsItems runbook helps you edit the status, severity, category, or priority of AWS Systems Manager OpsItems. This automation can edit a maximum of 50 OpsItems at a time. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on AWS-BulkEditOpsItems 779 AWS Systems Manager Automation runbook reference User Guide your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Category Type: String Valid values: • Availability • Cost • No change • Performance • Recovery • Security Default: No change Description: (Optional) The new category you want to specify for the edited OpsItems. • OpsItemIds Type: StringList Description: (Required) A comma-separated list of OpsItems IDs you want to edit (for example, oi-XXXXXXXXXXXX,oi-XXXXXXXXXXXX). • Priority Type: String Valid values: • No change • 1 • 2 • 3 • 4 • 5 AWS-BulkEditOpsItems Default: No change 780 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The importance of the edited OpsItems in relation to other OpsItems in the system. • Severity Type: String Valid values: • No change • 1 • 2 • 3 • 4 Default: No change Description: (Optional) The severity of the edited OpsItems. • WaitTimeBetweenEditsInSecs Type: String Valid values: 0.0-2.0 Default: 0.8 Description: (Optional) The time the automation waits between calling the UpdateOpsItems operation. • Status Type: String Valid values: • InProgress • No change • Open • Resolved AWS-BulkEditOpsItems Default: No change 781 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The new status of the edited OpsItems. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetAutomationExecution • ssm:StartAutomationExecution • ssm:UpdateOpsItem Document Steps • aws:executeScript - Edits the OpsItems you specified in the OpsItemIds parameter based on the values you specify for the Category , Priority , Severity , and Status parameters. AWS-BulkResolveOpsItems Description The AWS-BulkResolveOpsItems runbook resolves AWS Systems Manager OpsItems that match the filter you specify. You can also specify an OpsItemId to add to the resolved OpsItems using the OpsInsightsId parameter. If you specify a value for the S3BucketName parameter, a result summary is sent to the Amazon Simple Storage Service (Amazon S3) bucket. To receive a notification once the result summary has been sent to the Amazon S3 bucket, specify a value for the SnsTopicArn parameter. This automation will resolve a maximum of 1,000 OpsItems at a time. Run this Automation (console) Document type Automation Owner Amazon AWS-BulkResolveOpsItems 782 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform
|
systems-manager-automation-runbook-guide-183
|
systems-manager-automation-runbook-guide.pdf
| 183 |
a result summary is sent to the Amazon Simple Storage Service (Amazon S3) bucket. To receive a notification once the result summary has been sent to the Amazon S3 bucket, specify a value for the SnsTopicArn parameter. This automation will resolve a maximum of 1,000 OpsItems at a time. Run this Automation (console) Document type Automation Owner Amazon AWS-BulkResolveOpsItems 782 AWS Systems Manager Automation runbook reference User Guide Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Filters Type: String Description: (Required) The key-value pairs of filters to return the OpsItems you want to resolve. For example, [{"Key": "Status", "Values": ["Open"], "Operator": "Equal"}] . To learn more about the options available for filtering OpsItems responses, see OpsItemFilters in the AWS Systems Manager API Reference . • OpsInsightId Type: String Description: (Optional) The related resource identifier you want to add to resolved OpsItems. • S3BucketName Type: String Description: (Optional) The name of the Amazon S3 bucket you want to send the result summary to. • SnsMessage Type: String Description: (Optional) The notification you want Amazon Simple Notification Service (Amazon SNS) to send when the automation completes. • SnsTopicArn AWS-BulkResolveOpsItems 783 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The ARN of the Amazon SNS topic you want to notify when the result summary has been sent to Amazon S3. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • s3:GetBucketAcl • s3:PutObject • sns:Publish • ssm:DescribeOpsItems • ssm:GetAutomationExecution • ssm:StartAutomationExecution • ssm:UpdateOpsItem Document Steps • aws:executeScript - Gathers and resolves the OpsItems based on the filters you specify. If you specified a value for the OpsInsightId parameter, the value is added as a related resource. • aws:executeScript - If you specified a value for the S3BucketName parameter, a result summary is then sent to the Amazon S3 bucket. • aws:executeScript - If you specified a value for the SnsTopicArn parameter, a notification is sent to the Amazon SNS topic after the result summary has been sent to Amazon S3 including the SnsMessage parameter value if specified. AWS-ConfigureMaintenanceWindows Description The AWS-ConfigureMaintenanceWindows runbook helps you to enable or disable multiple Systems Manager maintenance windows. AWS-ConfigureMaintenanceWindows 784 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • MaintenanceWindows Type: StringList Description: (Required) A comma-separated list of the IDs of the maintenance windows you want to enable or disable. • MaintenanceWindowsStatus Type: String Valid values: "True" | "False" Default: "False" Description: (Required) Determines whether maintenance windows are enabled or disabled. Specify "True" to enable maintenance windows, and "False" to disable them. Required IAM permissions AWS-ConfigureMaintenanceWindows 785 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:GetMaintenanceWindow • ssm:UpdateMaintenanceWindow Document Steps • aws:executeScript - Gathers the status of the maintenance windows you specify in the MaintenanceWindows parameter, and enables or disables the maintenance windows. AWS-CreateManagedLinuxInstance Description Create an EC2 instance for Linux that is configured for Systems Manager. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux Parameters • AmiId Type: String Description: (Required) AMI ID to use for launching the instance. • AutomationAssumeRole AWS-CreateManagedLinuxInstance 786 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • GroupName Type: String Default: SSMSecurityGroupForLinuxInstances Description: (Required) Security group name to create. • HttpTokens Type: String Valid values: optional | required Default: optional Description: (Optional) IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to optional or required to determine whether IMDSv2 is optional or required. • InstanceType Type: String Default: t2.medium Description: (Required) Type of instance to launch. Default is t2.medium. • KeyPairName Type: String Description: (Required) Key pair to use when creating instance. • RemoteAccessCidr Type: String Default: 0.0.0.0/0 AWS-CreateManagedLinuxInstance 787 AWS Systems Manager Automation runbook reference User Guide Description: (Required) Creates Security group with port for SSH(Port range 22) open to IPs specified by CIDR
|
systems-manager-automation-runbook-guide-184
|
systems-manager-automation-runbook-guide.pdf
| 184 |
name to create. • HttpTokens Type: String Valid values: optional | required Default: optional Description: (Optional) IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to optional or required to determine whether IMDSv2 is optional or required. • InstanceType Type: String Default: t2.medium Description: (Required) Type of instance to launch. Default is t2.medium. • KeyPairName Type: String Description: (Required) Key pair to use when creating instance. • RemoteAccessCidr Type: String Default: 0.0.0.0/0 AWS-CreateManagedLinuxInstance 787 AWS Systems Manager Automation runbook reference User Guide Description: (Required) Creates Security group with port for SSH(Port range 22) open to IPs specified by CIDR (default is 0.0.0.0/0). If the security group already exists it will not be modified and rules will not be changed. • RoleName Type: String Default: SSMManagedInstanceProfileRole Description: (Required) Role name to create. • StackName Type: String Default: CreateManagedInstanceStack{{automation:EXECUTION_ID}} Description: (Optional) Specify stack name used by this runbook • SubnetId Type: String Default: Default Description: (Required) New instance will be deployed into this subnet or in the default subnet if not specified. • VpcId Type: String Default: Default Description: (Required) New instance will be deployed into this Amazon Virtual Private Cloud (Amazon VPC) or in the default Amazon VPC if not specified. AWS-CreateManagedWindowsInstance Description Create an EC2 instance for a Windows Server that is configured for Systems Manager. AWS-CreateManagedWindowsInstance 788 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Windows Parameters Parameters • AmiId Type: String Default: {{ssm:/aws/service/ami-windows-latest/Windows_Server-2016-English- Full-Base}} Description: (Required) AMI ID to use for launching the instance. • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • GroupName Type: String Default: SSMSecurityGroupForLinuxInstances Description: (Required) Security group name to create. AWS-CreateManagedWindowsInstance 789 AWS Systems Manager Automation runbook reference User Guide • HttpTokens Type: String Valid values: optional | required Default: optional Description: (Optional) IMDSv2 uses token-backed sessions. Set the use of HTTP tokens to optional or required to determine whether IMDSv2 is optional or required. • InstanceType Type: String Default: t2.medium Description: (Required) Type of instance to launch. Default is t2.medium. • KeyPairName Type: String Description: (Required) Key pair to use when creating instance. • RemoteAccessCidr Type: String Default: 0.0.0.0/0 Description: (Required) Creates security group with port for RDP (Port range 3389) open to IPs specified by CIDR (default is 0.0.0.0/0). If the security group already exists it will not be modified and rules will not be changed. • RoleName Type: String Default: SSMManagedInstanceProfileRole Description: (Required) Role name to create. • StackName Type: String AWS-CreateManagedWindowsInstance 790 AWS Systems Manager Automation runbook reference User Guide Default: CreateManagedInstanceStack{{automation:EXECUTION_ID}} Description: (Optional) Specify stack name used by this runbook • SubnetId Type: String Default: Default Description: (Required) New instance will be deployed into this subnet or in the default subnet if not specified. • VpcId Type: String Default: Default Description: (Required) New instance will be deployed into this Amazon Virtual Private Cloud (Amazon VPC) or in the default Amazon VPC if not specified. AWSConfigRemediation-EnableCWLoggingForSessionManager Description The AWSConfigRemediation-EnableCWLoggingForSessionManager runbook enables AWS Systems Manager Session Manager (Session Manager) sessions to store output logs to an Amazon CloudWatch (CloudWatch) log group. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows AWSConfigRemediation-EnableCWLoggingForSessionManager 791 AWS Systems Manager Automation runbook reference User Guide Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DestinationLogGroup Type: String Description: (Required) The name of the CloudWatch log group. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ssm:GetDocument • ssm:UpdateDocument • ssm:CreateDocument • ssm:UpdateDefaultDocumentVersion • ssm:DescribeDocument Document Steps • aws:executeScript - Accepts the CloudWatch log group to update the document which stores Session Manager session output logs preferences, or creates one if it doesn't exist. AWS-ExportOpsDataToS3 Description AWS-ExportOpsDataToS3 792 AWS Systems Manager Automation runbook reference User Guide This runbook retrieves a list of OpsData summaries in AWS Systems Manager Explorer and exports them to an object in a specified Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • columnFields Type: StringList Description: (Required) Column fields to write to the output file. • filters Type: String Description: (Optional) Filters for the getOpsSummary request. • resultAttribute Type: String Description: (Optional) The
|
systems-manager-automation-runbook-guide-185
|
systems-manager-automation-runbook-guide.pdf
| 185 |
summaries in AWS Systems Manager Explorer and exports them to an object in a specified Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • columnFields Type: StringList Description: (Required) Column fields to write to the output file. • filters Type: String Description: (Optional) Filters for the getOpsSummary request. • resultAttribute Type: String Description: (Optional) The result attribute for getOpsSummary request. • s3BucketName AWS-ExportOpsDataToS3 793 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) S3 bucket where you want to download the output file. • snsSuccessMessage Type: String Description: (Optional) Message to send when runbook finishes. • snsTopicArn Type: String Description: (Required) Amazon Simple Notification Service (Amazon SNS) topic ARN to notify when the download completes. • syncName Type: String Description: (Optional) The name of the resource data sync. Document Steps getOpsSummaryStep – Retrieves up to 5,000 ops summaries to export in a CSV file now. Outputs OpsData object – If the runbook runs successfully, you will find the exported OpsData object in your target S3 bucket. AWS-ExportPatchReportToS3 Description This runbook retrieves lists of patch summary data and patch details in AWS Systems Manager Patch Manager and exports them to .csv files in a specified Amazon Simple Storage Service (Amazon S3) bucket. Run this Automation (console) Document type AWS-ExportPatchReportToS3 794 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • assumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that runs this document. • s3BucketName Type: String Description: (Required) The S3 bucket where you want to download the output file. • snsTopicArn Type: String Description: (Optional) The Amazon Simple Notification Service (Amazon SNS) topic Amazon Resource Name (ARN) to notify when the download completes. • snsSuccessMessage Type: String Description: (Optional) Text of the message to send when the runbook finishes. • targets Type: String Description: (Required) The instance ID or a wildcard character (*) to indicate whether to report patch data for a specific instance or for all instances. AWS-ExportPatchReportToS3 795 AWS Systems Manager Automation runbook reference User Guide Document Steps ExportReportStep – The action for this step depends on the value of the targets parameter. If targets is in the format of instanceids=* , the step retrieves up to 10,000 patch summaries for instances in your account and exports the data to a .csv file. If targets is in the format instanceids=<instance-id> , the step retrieves both the patch summary and all the patches for the specified instance in your account and exports them to a .csv file. Outputs PatchSummary/Patches object – If the runbook runs successfully, the exported patch report object is downloaded to your target S3 bucket. AWS-SetupInventory Description Create a Systems Manager Inventory association for one or more managed instances. The system collects metadata from your instances according to the schedule in the association. For more information, see AWS Systems Manager Inventory . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • Applications Type: String Default: Enabled AWS-SetupInventory 796 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) Collect metadata about installed applications. • AssociatedDocName Type: String Default: AWS-GatherSoftwareInventory Description: (Optional) The name of the runbook used to collect Inventory from the managed instance. • AssociationName Type: String Description: (Optional) A name for the Inventory association that will be assigned to the instance. • AssocWaitTime Type: String Default: PT5M Description: (Optional) Amount of time that Inventory collection should pause when the Inventory association start time is reached. The time uses ISO 8601 format. • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AwsComponents Type: String Default: Enabled Description: (Optional) Collect metadata for AWS Components like amazon-ssm-agent. • CustomInventory AWS-SetupInventory 797 AWS Systems Manager Automation runbook reference User Guide Type: String Default: Enabled Description: (Optional) Collect custom inventory metadata. • Files Type: String Description: (Optional) Collect metadata about files on your instances. For more information about how to collect this type of Inventory data, see Working with file and Windows registry inventory . Requires SSMAgent version 2.2.64.0 or later. Linux example: [{"Path":"/usr/bin", "Pattern":["aws*", "*ssm*"],"Recursive":false}, {"Path":"/var/log", "Pattern":["amazon*.*"], "Recursive":true, "DirScanLimit":1000}]
|
systems-manager-automation-runbook-guide-186
|
systems-manager-automation-runbook-guide.pdf
| 186 |
specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AwsComponents Type: String Default: Enabled Description: (Optional) Collect metadata for AWS Components like amazon-ssm-agent. • CustomInventory AWS-SetupInventory 797 AWS Systems Manager Automation runbook reference User Guide Type: String Default: Enabled Description: (Optional) Collect custom inventory metadata. • Files Type: String Description: (Optional) Collect metadata about files on your instances. For more information about how to collect this type of Inventory data, see Working with file and Windows registry inventory . Requires SSMAgent version 2.2.64.0 or later. Linux example: [{"Path":"/usr/bin", "Pattern":["aws*", "*ssm*"],"Recursive":false}, {"Path":"/var/log", "Pattern":["amazon*.*"], "Recursive":true, "DirScanLimit":1000}] Windows example: [{"Path":"%PROGRAMFILES%", "Pattern":["*.exe"],"Recursive":true}] • InstanceDetailedInformation Type: String Default: Enabled Description: (Optional) Collect additional information about the instance, including the CPU model, speed, and the number of cores, to name a few. • InstanceIds Type: String Default: * Description: (Required) EC2 instances that you want to inventory. • LambdaAssumeRole Type: String Description: (Optional) The ARN of the role that allows Lambda created by Automation to perform the actions on your behalf. If not specified a transient role will be created to run the Lambda function. • NetworkConfig AWS-SetupInventory 798 AWS Systems Manager Automation runbook reference User Guide Type: String Default: Enabled Description: (Optional) Collect metadata about network configurations. • OutputS3BucketName Type: String Description: (Optional) Name of an Amazon S3 bucket where you want to write Inventory log data. • OutputS3KeyPrefix Type: String Description: (Optional) An Amazon S3 key prefix (subfolder) where you want to write Inventory log data. • OutputS3Region Type: String Description: (Optional) The name of the AWS Region where the Amazon S3 exists. • Schedule Type: String Default: cron(0 */30 * * * ? *) Description: (Optional) A cron expression for the Inventory association schedule. The default is every 30 minutes. • Services Type: String Default: Enabled Description: (Optional, Windows OS only, requires SSMAgent version 2.2.64.0 and above) Collect data for service configurations. • WindowsRegistry AWS-SetupInventory 799 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) Collect metadata about Microsoft Windows Registry keys. For more information about how to collect this type of Inventory data, see Working with file and Windows registry inventory . Requires SSM Agent version 2.2.64.0 or later. Example: [ {"Path":"HKEY_CURRENT_CONFIG\System","Recursive":true},{"Path":"HKEY_LOCAL_MACHINE \SOFTWARE\Amazon\MachineImage", "ValueNames":["AMIName"]}] • WindowsRoles Type: String Default: Enabled Description: (Optional) Collect information about Windows roles on the instance. Applies to Windows operating systems only. Requires SSMAgent version 2.2.64.0 or later. • WindowsUpdates Type: String Default: Enabled Description: (Optional) Collect data about all Windows Updates on the instance. AWS-SetupManagedInstance Description Configure an instance with an AWS Identity and Access Management (IAM) role for Systems Manager access. Run this Automation (console) Document type Automation Owner Amazon Platforms AWS-SetupManagedInstance 800 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) ID of the EC2 instance to configure • LambdaAssumeRole Type: String Description: (Optional) The ARN of the role that allows Lambda created by Automation to perform the actions on your behalf. If not specified a transient role will be created to run the Lambda function. • RoleName Type: String Default: SSMRoleForManagedInstance Description: (Optional) The name of the IAM role for the EC2 instance. If this role does not exist, it will be created. When specifying this value, verify that the role contains the AmazonSSMManagedInstanceCore Managed Policy. AWS-SetupManagedRoleOnEC2Instance Description Configure an instance with the SSMRoleForManagedInstance managed IAM role for Systems Manager access. AWS-SetupManagedRoleOnEC2Instance 801 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) ID of the EC2 instance to configure • LambdaAssumeRole Type: String Description: (Optional) The ARN of the role that allows Lambda created by Automation to perform the actions on your behalf. If not specified a transient role will be created to run the Lambda function. • RoleName Type: String Default: SSMRoleForManagedInstance AWS-SetupManagedRoleOnEC2Instance 802 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The name of the IAM role for the EC2 instance. If this role does not exist, it will be created. When specifying this value, verify that the role contains the AmazonSSMManagedInstanceCore Managed Policy. AWSSupport-TroubleshootManagedInstance Description The AWSSupport-TroubleshootManagedInstance runbook helps you to determine
|
systems-manager-automation-runbook-guide-187
|
systems-manager-automation-runbook-guide.pdf
| 187 |
to configure • LambdaAssumeRole Type: String Description: (Optional) The ARN of the role that allows Lambda created by Automation to perform the actions on your behalf. If not specified a transient role will be created to run the Lambda function. • RoleName Type: String Default: SSMRoleForManagedInstance AWS-SetupManagedRoleOnEC2Instance 802 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The name of the IAM role for the EC2 instance. If this role does not exist, it will be created. When specifying this value, verify that the role contains the AmazonSSMManagedInstanceCore Managed Policy. AWSSupport-TroubleshootManagedInstance Description The AWSSupport-TroubleshootManagedInstance runbook helps you to determine why an Amazon Elastic Compute Cloud (Amazon EC2) instance does not report as managed by AWS Systems Manager. This runbook reviews the VPC configuration for the instance including security group rules, VPC endpoints, network access control list (ACL) rules, and route tables. It also confirms an AWS Identity and Access Management (IAM) instance profile that contains the required permissions is attached to the instance. Important This automation runbook does not evaluate IPv6 rules. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSSupport-TroubleshootManagedInstance 803 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) The ID of the Amazon EC2 instance that is not reporting as managed by Systems Manager. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:DescribeAutomationExecutions • ssm:DescribeAutomationStepExecutions • ssm:DescribeInstanceInformation • ssm:DescribeInstanceProperties • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ssm:GetDocument • ssm:ListDocuments • ssm:StartAutomationExecution • iam:ListRoles • iam:GetInstanceProfile • iam:ListAttachedRolePolicies • ec2:DescribeInstances • ec2:DescribeNetworkAcls • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeVpcEndpoints AWSSupport-TroubleshootManagedInstance 804 AWS Systems Manager Automation runbook reference User Guide Document Steps • aws:executeScript - Gathers the PingStatus of the instance. • aws:branch - Branches based on whether the instance is already reporting as managed by Systems Manager. • aws:executeAwsApi - Gathers details about the instance including the VPC configuration. • aws:executeScript - If applicable, gathers additional details related to VPC endpoints that have been deployed to use with Systems Manager, and confirms the security groups attached to the VPC endpoint allow inbound traffic on TCP port 443 from the instance. • aws:executeScript - Checks whether the route table allows traffic to the VPC endpoint or public Systems Manager endpoints. • aws:executeScript - Checks whether the network ACL rules allow traffic to the VPC endpoint or public Systems Manager endpoints. • aws:executeScript - Checks whether outbound traffic to the VPC endpoint or public Systems Manager endpoints is allowed by the security group associated with the instance. • aws:executeScript - Checks if the instance profile attached to the instance includes a managed policy that provides the required permissions. • aws:branch - Branches based on the operating system of the instance. • aws:executeScript - Provides reference to ssmagent-toolkit-linux shell script. • aws:executeScript - Provides reference to ssmagent-toolkit-windows PowerShell script. • aws:executeScript - Generates final output for the automation. • aws:executeScript - If the PingStatus of the instance is Online , returns that the instance is already managed by Systems Manager. AWSSupport-TroubleshootPatchManagerLinux Description The AWSSupport-TroubleshootPatchManagerLinux runbook troubleshoots common issues that can cause a patch failure on Linux-based managed nodes using Patch Manager, a tool in AWS Systems Manager. The main goal of this runbook is to identify the patch command failure root cause and suggest a remediation plan. How does it work? AWSSupport-TroubleshootPatchManagerLinux 805 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-TroubleshootPatchManagerLinux runbook considers the couple instance ID/Command ID provided by you for troubleshooting. If no Command ID is provided, it selects the latest failed patch command within the last 30 days on the provided instance. After checking the command status, the prerequisites fulfillment, and the OS distribution, the runbook downloads and runs a log analyzer package. The output includes the issue root cause as well as the needed action to fix the issue. Document Type Automation Owner Amazon Platforms • Amazon Linux 2 and AL2023 • Red Hat Enterprise Linux 8.X and 9.X • Centos 8.X and 9.X • SUSE 15.X Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:SendCommand • ssm:DescribeDocument • ssm:GetCommandInvocation • ssm:ListCommands • ssm:DescribeInstanceInformation • ssm:ListCommandInvocations • ssm:GetDocument • ssm:DescribeAutomationExecutions AWSSupport-TroubleshootPatchManagerLinux 806 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootPatchManagerLinux in the AWS Systems Manager console. 2. Select Execute automation. 3. For the input parameters, enter the following: • InstanceId (Required): Use the interactive
|
systems-manager-automation-runbook-guide-188
|
systems-manager-automation-runbook-guide.pdf
| 188 |
2 and AL2023 • Red Hat Enterprise Linux 8.X and 9.X • Centos 8.X and 9.X • SUSE 15.X Parameters Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:SendCommand • ssm:DescribeDocument • ssm:GetCommandInvocation • ssm:ListCommands • ssm:DescribeInstanceInformation • ssm:ListCommandInvocations • ssm:GetDocument • ssm:DescribeAutomationExecutions AWSSupport-TroubleshootPatchManagerLinux 806 AWS Systems Manager Automation runbook reference User Guide • ssm:GetAutomationExecution Instructions Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootPatchManagerLinux in the AWS Systems Manager console. 2. Select Execute automation. 3. For the input parameters, enter the following: • InstanceId (Required): Use the interactive instance picker to choose the ID of the Linux Based SSM Managed Node (Amazon Elastic Compute Cloud (Amazon EC2) or Hybrid Activated server) that the patch command failed against, or manually enter the ID of the SSM Managed instance. • AutomationAssumeRole (Optional): Enter the ARN of the IAM role that allows Automation to perform actions on your behalf. If a role isn't specified, Automation uses the permissions of the user who starts this runbook. • RunCommandId (Optional): Enter the Failed Run Command ID of the AWS-RunPatchBaseline document. If you don't provide a Command ID, the runbook will look for the latest failed patch command within the last 30 days on the selected instance. 4. Select Execute. 5. The automation initiates. 6. The document performs the following steps: • CheckConcurrency: AWSSupport-TroubleshootPatchManagerLinux 807 AWS Systems Manager Automation runbook reference User Guide Ensures that there is only one execution of this runbook targeting the same instance. If the runbook finds another execution in progress targeting the same instance, it returns an error and ends. • ValidateCommandID: Validates if the provided Command ID, as input parameter, was executed for the AWS- RunPatchBaseline SSM Document. If no Command ID is provided, the runbook will consider the latest failed execution of AWS-RunPatchBaseline within the last 30 days on the selected instance. • BranchOnCommandStatus: Confirms that the status of the provided command is failed. Otherwise, the runbook ends the execution and generates a report stating that the provided command was successfully executed. • VerifyPrerequistes: Confirms that the Prerequisites mentioned above are fulfilled. • GetPlatformDetails: Retrieves the Operating System (OS) distribution and version. • GetDownloadURL: Retrieves the download URL for the PatchManager Log Analyzer package. • EvaluatePatchManagerLogs: Downloads and executes the PatchManager Log Analyzer python package on the instance to evaluate the log file. • GenerateReport: Generates a final report of the runbook execution that includes the identified problem and suggested solution. 7. After completed, review the Outputs section for the detailed results of the execution: AWSSupport-TroubleshootPatchManagerLinux 808 AWS Systems Manager Automation runbook reference User Guide References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWSSupport-TroubleshootSessionManager Description The AWSSupport-TroubleshootSessionManager runbook helps you troubleshoot common issues that prevent you from connecting to managed Amazon Elastic Compute Cloud (Amazon EC2) instances using Session Manager. Session Manager is a tool in AWS Systems Manager. This runbook checks the following: • Checks whether the instance is running and reporting as managed by Systems Manager. • Runs the AWSSupport-TroubleshootManagedInstance runbook if the instance is not reporting as managed by Systems Manager. • Checks the version of the SSM Agent installed on the instance. • Checks whether an instance profile containing a recommended AWS Identity and Access Management (IAM) policy for Session Manager is attached to the Amazon EC2 instance. • Collects SSM Agent logs from the instance. AWSSupport-TroubleshootSessionManager 809 AWS Systems Manager Automation runbook reference User Guide • Analyzes your Session Manager preferences. • Runs the AWSSupport-AnalyzeAWSEndpointReachabilityFromEC2 runbook to analyze the instance's connectivity to the endpoints for Session Manager, AWS Key Management Service (AWS KMS), Amazon Simple Storage Service (Amazon S3) and Amazon CloudWatch Logs (CloudWatch Logs). Considerations • Hybrid managed nodes are not supported. • This runbook only checks whether a recommended managed IAM policy is attached to the instance profile. It does not analyze IAM or AWS KMS permissions contained in your instance profile. Important The AWSSupport-AnalyzeAWSEndpointReachabilityFromEC2 runbook uses VPC Reachability Analyzer to analyze the network connectivity between a source and a service endpoint. You are charged per analysis run between a source and destination. For more details, see Amazon VPC Pricing. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSSupport-TroubleshootSessionManager 810 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) The ID of the Amazon EC2 instance that you are unable to connect to
|
systems-manager-automation-runbook-guide-189
|
systems-manager-automation-runbook-guide.pdf
| 189 |
more details, see Amazon VPC Pricing. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWSSupport-TroubleshootSessionManager 810 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • InstanceId Type: String Description: (Required) The ID of the Amazon EC2 instance that you are unable to connect to using Session Manager. • SessionPreferenceDocument Type: String Default: SSM-SessionManagerRunShell Description: (Optional) The name of your session preferences document. If you don't specify a custom session preferences document when starting sessions, use the default value. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:CreateNetworkInsightsPath • ec2:DeleteNetworkInsightsAnalysis • ec2:DeleteNetworkInsightsPath • ec2:StartNetworkInsightsAnalysis • tiros:CreateQuery • ec2:DescribeAvailabilityZones • ec2:DescribeCustomerGateways • ec2:DescribeDhcpOptions • ec2:DescribeInstances • ec2:DescribeInstanceStatus AWSSupport-TroubleshootSessionManager 811 AWS Systems Manager Automation runbook reference User Guide • ec2:DescribeInternetGateways • ec2:DescribeManagedPrefixLists • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInsightsAnalyses • ec2:DescribeNetworkInsightsPaths • ec2:DescribeNetworkInterfaces • ec2:DescribePrefixLists • ec2:DescribeRegions • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeSubnets • ec2:DescribeTransitGatewayAttachments • ec2:DescribeTransitGatewayConnects • ec2:DescribeTransitGatewayPeeringAttachments • ec2:DescribeTransitGatewayRouteTables • ec2:DescribeTransitGateways • ec2:DescribeTransitGatewayVpcAttachments • ec2:DescribeVpcAttribute • ec2:DescribeVpcEndpoints • ec2:DescribeVpcEndpointServiceConfigurations • ec2:DescribeVpcPeeringConnections • ec2:DescribeVpcs • ec2:DescribeVpnConnections • ec2:DescribeVpnGateways • ec2:GetManagedPrefixListEntries • ec2:GetTransitGatewayRouteTablePropagations • ec2:SearchTransitGatewayRoutes • elasticloadbalancing:DescribeListeners AWSSupport-TroubleshootSessionManager 812 AWS Systems Manager Automation runbook reference User Guide • elasticloadbalancing:DescribeLoadBalancerAttributes • elasticloadbalancing:DescribeLoadBalancers • elasticloadbalancing:DescribeRules • elasticloadbalancing:DescribeTags • elasticloadbalancing:DescribeTargetGroups • elasticloadbalancing:DescribeTargetHealth • iam:GetInstanceProfile • iam:ListAttachedRolePolicies • iam:ListRoles • iam:PassRole • ssm:DescribeAutomationStepExecutions • ssm:DescribeInstanceInformation • ssm:GetAutomationExecution • ssm:GetDocument • ssm:ListCommands • ssm:ListCommandInvocations • ssm:SendCommand • ssm:StartAutomationExecution • tiros:GetQueryAnswer • tiros:GetQueryExplanation Document Steps 1. aws:waitForAwsResourceProperty: Waits up to 6 minutes for your target instance to pass status checks. 2. aws:executeScript: Parses the session preference document. 3. aws:executeAwsApi: Gets the ARN of the instance profile attached to your instance. 4. aws:executeAwsApi: Checks whether your instance is reporting as managed by Systems Manager. 5. aws:branch: Branches based on whether your instance is reporting as managed by Systems Manager. AWSSupport-TroubleshootSessionManager 813 AWS Systems Manager Automation runbook reference User Guide 6. aws:executeScript: Checks whether the SSM Agent installed on your instance supports Session Manager. 7. aws:branch: Branches based on the platform of your instance to collect ssm-cli logs. 8. aws:runCommand: Collects logs output from ssm-cli from a Linux or macOS instance. 9. aws:runCommand: Collects logs output from ssm-cli from a Windows instance. 10.aws:executeScript: Parses the ssm-cli logs. 11.aws:executeScript: Checks whether a recommended IAM policy is attached to the instance profile. 12.aws:branch: Determines whether to evaluate ssmmessages endpoint connectivity based on ssm-cli logs. 13.aws:executeAutomation: Evaluates whether the instance can connect to an ssmmessages endpoint. 14.aws:branch: Determines whether to evaluate Amazon S3 endpoint connectivity based on ssm- cli logs and your session preferences. 15.aws:executeAutomation: Evaluates whether the instance can connect to an Amazon S3 endpoint. 16.aws:branch: Determines whether to evaluate AWS KMS endpoint connectivity based on ssm- cli logs and your session preferences. 17.aws:executeAutomation: Evaluates whether the instance can connect to an AWS KMS endpoint. 18.aws:branch: Determines whether to evaluate CloudWatch Logs endpoint connectivity based on ssm-cli logs and your session preferences. 19.aws:executeAutomation: Evaluates whether the instance can connect to an CloudWatch Logs endpoint. 20.aws:executeAutomation: Runs the AWSSupport-TroubleshootManagedInstance runbook. 21.aws:executeScript: Compiles the output of the previous steps and outputs a report. Ouputs • generateReport.EvalReport - The results of the checks performed by the runbook in plain text. AWSSupport-TroubleshootSessionManager 814 AWS Systems Manager Automation runbook reference User Guide Third-party AWS Systems Manager Automation provides predefined runbooks for third-party products and services. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CreateJiraIssue • AWS-CreateServiceNowIncident • AWS-RunPacker AWS-CreateJiraIssue Description Create an issue in Jira. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AssigneeName Type: String Description: (Optional) The username of the person the issue should be assigned to. • DueDate Third-party 815 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The due date for the issue in yyyy-mm-dd format. • IssueDescription Type: String Description: (Required) A detailed description of the issue. • IssueSummary Type: String Description: (Required) A brief summary of the issue. • IssueTypeName Type: String Description: (Required) The name of the type of issue you want to create (for example, Task, Sub- task, Bug, etc.). • JiraURL Type: String Description: (Required) The url of the Jira instance. • JiraUsername Type: String Description: (Required) The name of the user the issue will be created with. • PriorityName Type: String Description: (Optional) The name of the priority of the issue. • ProjectKey Type: String Description: (Required) The key of the project the issue should be created in. AWS-CreateJiraIssue
|
systems-manager-automation-runbook-guide-190
|
systems-manager-automation-runbook-guide.pdf
| 190 |
of the issue. • IssueSummary Type: String Description: (Required) A brief summary of the issue. • IssueTypeName Type: String Description: (Required) The name of the type of issue you want to create (for example, Task, Sub- task, Bug, etc.). • JiraURL Type: String Description: (Required) The url of the Jira instance. • JiraUsername Type: String Description: (Required) The name of the user the issue will be created with. • PriorityName Type: String Description: (Optional) The name of the priority of the issue. • ProjectKey Type: String Description: (Required) The key of the project the issue should be created in. AWS-CreateJiraIssue 816 AWS Systems Manager Automation runbook reference User Guide • SSMParameterName Type: String Description: (Required) The name of an encrypted SSM Parameter containing the API key or password for the Jira user. Document Steps aws:createStack - Create CloudFormation stack to create Lambda IAM role and function. aws:invokeLambdaFunction - Invoke Lambda function to create the Jira issue aws:deleteStack - Delete the CloudFormation stack created. Outputs IssueId: ID of the newly created Jira issue AWS-CreateServiceNowIncident Description Create an incident in the ServiceNow incident table. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWS-CreateServiceNowIncident 817 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Category Type: String Description: (Optional) The category of the incident. Valid values: None | Inquiry/Help | Software | Hardware | Network | Database Default Value: None • Description Type: String Description: (Required) A detailed explanation on the incident. • Impact Type: String Description: (Optional) The effect an incident has on business. Valid values: High | Medium | Low Default Value: Low • ServiceNowInstanceUsername Type: String Description: (Required) The name of the user the incident will be created with. • ServiceNowInstancePassword Type: String Description: (Required) The name of an encrypted SSM Parameter containing the password for the ServiceNow user. • ServiceNowInstanceURL AWS-CreateServiceNowIncident 818 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The URL of the ServiceNow instance • ShortDescription Type: String Description: (Required) A brief description of the incident. • Subcategory Type: String Description: (Optional) The subcategory of the incident. Valid values: None | Antivirus | Email | Internal Application | Operating System | CPU | Disk | Keyboard | Hardware | Memory | Monitor | Mouse | DHCP | DNS | IP Address | VPN | Wireless | DB2 | MS SQL Server | Oracle Default Value: None Document Steps Push_incident – Pushes the incident information to ServiceNow. Outputs Push_incident.incidentID – The created incident ID. AWS-RunPacker Description This runbook uses the HashiCorp Packer tool to validate, fix, or build packer templates that are used to create machine images. This runbook uses Packer v1.7.2. Note If you specify a vpc_id value, you must also specify the subnet_id value of a public subnet. Unless you modify your subnet's IPv4 public addressing attribute, you must also set associate_public_ip_address to true. AWS-RunPacker 819 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Force Type: Boolean Description: A Packer option to force a builder to run when artifacts from a previous build otherwise prevent a build from running. • Mode Type: String Description: The mode, or command, in which to use Packer when validating against the template. Options include Build , Validate , and Fix . • TemplateFileName Type: String Description: The name, or key, of the template file in the S3 bucket. • TemplateS3BucketName AWS-RunPacker 820 AWS Systems Manager Automation runbook reference User Guide Type: String Description: The name of the S3 bucket containing the packer template. Document Steps RunPackerProcessTemplate – Runs the selected mode against the template using the Packer tool. Outputs RunPackerProcessTemplate.output – The stdout from the Packer tool. RunPackerProcessTemplate.fixed_template_key – The name of the template stored in an S3 bucket to use only when running in "Fix" mode. RunPackerProcessTemplate.s3_bucket – The name of the S3 bucket that contains the fixed template to use only when running in "Fix" mode. Amazon VPC AWS Systems Manager Automation provides predefined runbooks for Amazon Virtual Private Cloud. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics •
|
systems-manager-automation-runbook-guide-191
|
systems-manager-automation-runbook-guide.pdf
| 191 |
RunPackerProcessTemplate – Runs the selected mode against the template using the Packer tool. Outputs RunPackerProcessTemplate.output – The stdout from the Packer tool. RunPackerProcessTemplate.fixed_template_key – The name of the template stored in an S3 bucket to use only when running in "Fix" mode. RunPackerProcessTemplate.s3_bucket – The name of the S3 bucket that contains the fixed template to use only when running in "Fix" mode. Amazon VPC AWS Systems Manager Automation provides predefined runbooks for Amazon Virtual Private Cloud. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CloseSecurityGroup • AWSSupport-ConfigureDNSQueryLogging • AWSSupport-ConfigureTrafficMirroring • AWSSupport-ConnectivityTroubleshooter • AWSSupport-TroubleshootVPN • AWSConfigRemediation-DeleteEgressOnlyInternetGateway • AWSConfigRemediation-DeleteUnusedENI • AWSConfigRemediation-DeleteUnusedSecurityGroup • AWSConfigRemediation-DeleteUnusedVPCNetworkACL • AWSConfigRemediation-DeleteVPCFlowLog • AWSConfigRemediation-DetachAndDeleteInternetGateway Amazon VPC 821 AWS Systems Manager Automation runbook reference User Guide • AWSConfigRemediation-DetachAndDeleteVirtualPrivateGateway • AWS-DisableIncomingSSHOnPort22 • AWS-DisablePublicAccessForSecurityGroup • AWSConfigRemediation-DisableSubnetAutoAssignPublicIP • AWSSupport-EnableVPCFlowLogs • AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch • AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket • AWS-ReleaseElasticIP • AWS-RemoveNetworkACLUnrestrictedSSHRDP • AWSConfigRemediation-RemoveUnrestrictedSourceIngressRules • AWSConfigRemediation-RemoveVPCDefaultSecurityGroupRules • AWSSupport-SetupIPMonitoringFromVPC • AWSSupport-TerminateIPMonitoringFromVPC AWS-CloseSecurityGroup Description This runbook removes all ingress and egress rules from the security group you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole AWS-CloseSecurityGroup 822 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • SecurityGroupId Type: String Description: (Required) The ID of the security group you want to close. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeSecurityGroups • ec2:RevokeSecurityGroupEgress • ec2:RevokeSecurityGroupIngress Document Steps • aws:executeScript - Removes all ingress and egress rules from the security group you specify in the SecurityGroupId parameter. AWSSupport-ConfigureDNSQueryLogging Description The AWSSupport-ConfigureDNSQueryLogging runbook configures logging for DNS queries that originate in your virtual private cloud (VPC) or for Amazon Route 53 hosted zones. You can choose to publish query logs to Amazon CloudWatch Logs, Amazon Simple Storage Service (Amazon S3), or Amazon Data Firehose. For more information about query logging and resolver query logs, see Public DNS query logging and Resolver query logging . Run this Automation (console) AWSSupport-ConfigureDNSQueryLogging 823 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LogDestinationArn Type: String Description: (Optional) The ARN of the CloudWatch Logs group, Amazon S3 bucket or Firehose stream you want to send query logs to. Note that Route 53 public DNS query logging only supports CloudWatch Logs groups. If you do not specify a value for this parameter, the automation creates a CloudWatch Logs group with the format AWSSupport- ConfigureDNSQueryLogging-{automation: EXECUTION_ID } , and an IAM resource policy to publish the query logs. The CloudWatch Logs group created by the automation has a retention period of 14 days. • QueryLogType Type: String Description: (Optional) The types of queries you want to log. Valid values: Public | Resolver/Private Default: Public AWSSupport-ConfigureDNSQueryLogging 824 AWS Systems Manager Automation runbook reference User Guide • ResourceId Type: String Description: (Required) The ID of the resource whose queries you want to log. If you specify Public for the QueryLogType parameter, the resource must be the ID of a Route 53 private hosted zone. If you specify Resolver/Private for the QueryLogType parameter, the resource must be the ID of a VPC. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeVpcs • firehose:ListTagsForDeliveryStream • firehose:PutRecord • firehose:PutRecordBatch • firehose:TagDeliveryStream • iam:AttachRolePolicy • iam:CreatePolicy • iam:CreateRole • iam:CreateServiceLinkedRole • iam:DeletePolicy • iam:DeleteRole • iam:DeleteRolePolicy • iam:GetPolicy • iam:GetRole • iam:PassRole • iam:PutRolePolicy • iam:TagRole • iam:UpdateRole • logs:CreateLogDelivery AWSSupport-ConfigureDNSQueryLogging 825 AWS Systems Manager Automation runbook reference User Guide • logs:CreateLogGroup • logs:DeleteLogDelivery • logs:DeleteLogGroup • logs:DescribeLogGroups • logs:DescribeLogStreams • logs:DescribeResourcePolicies • logs:ListLogDeliveries • logs:PutResourcePolicy • logs:PutRetentionPolicy • logs:UpdateLogDelivery • route53:CreateQueryLoggingConfig • route53:DeleteQueryLoggingConfig • route53:GetHostedZone • route53resolver:AssociateResolverQueryLogConfig • route53resolver:CreateResolverQueryLogConfig • route53resolver:DeleteResolverQueryLogConfig • s3:GetBucketAcl Document Steps • aws:executeScript - Verifies the resource you specify for the ResourceId parameter exists, and checks whether the resource type matches the required QueryLogType option. • aws:executeScript - Verifies that the value you specify for the LogDestinationArn parameter matches the required QueryLogType . • aws:executeScript - Verifies the required permissions for Route 53 to publish logs to the CloudWatch Logs log group, and creates the required IAM resource policy if it doesn't exist. • aws:executeScript - Enables the DNS query logging
|
systems-manager-automation-runbook-guide-192
|
systems-manager-automation-runbook-guide.pdf
| 192 |
• logs:PutRetentionPolicy • logs:UpdateLogDelivery • route53:CreateQueryLoggingConfig • route53:DeleteQueryLoggingConfig • route53:GetHostedZone • route53resolver:AssociateResolverQueryLogConfig • route53resolver:CreateResolverQueryLogConfig • route53resolver:DeleteResolverQueryLogConfig • s3:GetBucketAcl Document Steps • aws:executeScript - Verifies the resource you specify for the ResourceId parameter exists, and checks whether the resource type matches the required QueryLogType option. • aws:executeScript - Verifies that the value you specify for the LogDestinationArn parameter matches the required QueryLogType . • aws:executeScript - Verifies the required permissions for Route 53 to publish logs to the CloudWatch Logs log group, and creates the required IAM resource policy if it doesn't exist. • aws:executeScript - Enables the DNS query logging on the selected destination. AWSSupport-ConfigureTrafficMirroring Description AWSSupport-ConfigureTrafficMirroring 826 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-ConfigureTrafficMirroring runbook configures traffic mirroring to help you troubleshoot connectivity issues between a load balancer and Amazon Elastic Compute Cloud (Amazon EC2) instances. Traffic mirroring copies inbound and outbound traffic from the network interfaces that are attached to your instances. To configure traffic mirroring, this runbook creates the required targets, filters, and sessions. By default, the runbook configures mirroring for all inbound and outbound traffic for all protocols except Amazon DNS. If you want to mirror traffic from specific sources and destinations, you can modify the inbound and outbound rules after the automation completes. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • SourceENI Type: String Description: (Required) The elastic network interface you want to configure traffic mirroring for. • Target Type: String AWSSupport-ConfigureTrafficMirroring 827 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The destination for the mirrored traffic. You must specify the ID of a network interface, a Network Load Balancer, or a Gateway Load Balancer endpoint. If you specify a Network Load Balancer, there must be UDP listeners on port 4789. • SessionNumber Type: String Valid values: 1-32766 Description: (Required) The number of the mirror session you want to use. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:CreateTrafficMirrorTarget • ec2:CreateTrafficMirrorFilter • ec2:CreateTrafficMirrorFilterRule • ec2:CreateTrafficMirrorSession • ec2:DeleteTrafficMirrorSession • ec2:DeleteTrafficMirrorFilter • ec2:DeleteTrafficMirrorSession • ec2:DeleteTrafficMirrorFilterRule • iam:ListRoles • ssm:GetAutomationExecution • ssm:StartAutomationExecution Document Steps • aws:executeScript - Runs a script to create a target. • aws:executeAwsApi - Creates a filter rule. • aws:executeAwsApi - Creates a mirror filter rule for all inbound traffic. • aws:executeAwsApi - Creates a mirror filter rule for all outbound traffic. AWSSupport-ConfigureTrafficMirroring 828 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Creates a traffic mirror session. • aws:executeAwsApi - Deletes the filter if filter or session creation fails. • aws:executeAwsApi - Deletes the target if filter or session creation fails. Outputs CreateFilter.FilterId CreateSession.SessionId CreateTarget.TargetIDOutput AWSSupport-ConnectivityTroubleshooter Description The AWSSupport-ConnectivityTroubleshooter runbook diagnoses connectivity issues between the following: • AWS resources within an Amazon Virtual Private Cloud (Amazon VPC) • AWS resources in different Amazon VPCs within the same AWS Region that are connected using VPC peering • AWS resources in an Amazon VPC and an internet resource using an internet gateway • AWS resources in an Amazon VPC and an internet resource using a network address translation (NAT) gateway Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWSSupport-ConnectivityTroubleshooter 829 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DestinationIP Type: String Description: (Required) The IPv4 address of the resource you want to connect to. • DestinationPort Type: String Default: true Description: (Required) The port number you want to connect to on the destination resource. • DestinationVpc Type: String Default: All Description: (Optional) The ID of the Amazon VPC you want to test connectivity to. • SourceIP Type: String Description: (Required) The private IPv4 address of the AWS resource in your Amazon VPC you want to test connectivity from. • SourcePortRange Type: String Description: (Optional) The port range used by the AWS resource in your Amazon VPC you want to test connectivity from. • SourceVpc AWSSupport-ConnectivityTroubleshooter 830 AWS Systems Manager Automation runbook reference User Guide Type: String Default: All Description: (Optional) The ID of the Amazon VPC you want to test connectivity from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeVpcPeeringConnections Document Steps • aws:executeScript - Gathers details about the AWS resource you specify in the SourceIP
|
systems-manager-automation-runbook-guide-193
|
systems-manager-automation-runbook-guide.pdf
| 193 |
test connectivity from. • SourcePortRange Type: String Description: (Optional) The port range used by the AWS resource in your Amazon VPC you want to test connectivity from. • SourceVpc AWSSupport-ConnectivityTroubleshooter 830 AWS Systems Manager Automation runbook reference User Guide Type: String Default: All Description: (Optional) The ID of the Amazon VPC you want to test connectivity from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeNatGateways • ec2:DescribeNetworkAcls • ec2:DescribeNetworkInterfaces • ec2:DescribeRouteTables • ec2:DescribeSecurityGroups • ec2:DescribeVpcPeeringConnections Document Steps • aws:executeScript - Gathers details about the AWS resource you specify in the SourceIP parameter. • aws:executeScript - Determines the destination of network traffic from the AWS resource using the routes gathered from the previous step. • aws:branch - Branches based on the destination of the network traffic. • aws:executeAwsApi - Gathers details about the destination resource. • aws:executeScript - Confirms that the ID returned for the destination Amazon VPC matches the value specified, if any, in the DestinationVpc parameter. • aws:executeAwsApi - Gathers the security group rules for the source and destination resources. • aws:executeScript - Confirms whether the security group rules allow the needed traffic between the source and destination resources. • aws:executeAwsApi - Gathers the network access control lists (NACLs) associated with the subnets for the source and destination resources. AWSSupport-ConnectivityTroubleshooter 831 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Confirms whether the NACLs allow the needed traffic between the source and destination resources. • aws:executeScript - Confirms whether the source has a public IP address associated with the resource, if the route destination is an internet gateway. • aws:executeAwsApi - Gathers the security group rules for the source resource. • aws:executeScript - Confirms whether the security group rules allow the needed traffic from the source to the destination resource. • aws:executeAwsApi - Gathers the NACLs associated with the subnet for the source resource. • aws:executeScript - Confirms whether the NACLs allow the needed traffic from the source resource. • aws:executeAwsApi - Gathers details about the NAT gateway. • aws:executeAwsApi - Gathers the NACLs associated with the subnet for the NAT gateway. • aws:executeScript - Confirms whether the NACLs allow the needed traffic from the subnet for the NAT gateway. • aws:executeScript - Gathers the routes associated with the subnet for the NAT gateway. • aws:executeScript - Confirms whether the NAT gateway has a route to an internet gateway. • aws:executeAwsApi - Gathers details about the VPC peering connection. • aws:executeScript - Confirms both VPCs are in the same Region and that the ID returned for the destination VPC matches the value specified, if any, in the DestinationVpc parameter. • aws:executeAwsApi - Returns the subnet of the destination resource. • aws:executeScript - Gathers the routes associated with the subnet for the peered VPC. • aws:executeScript - Confirms whether the peered VPC has a route to the peering connection. • aws:executeScript - Confirms whether traffic is allowed from the source resource if the destination is not supported by the automation. AWSSupport-TroubleshootVPN Description The AWSSupport-TroubleshootVPN runbook helps you to trace and resolve errors in an AWS Site-to-Site VPN connection. The automation includes several automated checks designed to trace IKEv1 or IKEv2 errors related to AWS Site-to-Site VPN connection tunnels. The automation tries to match specific errors and its corresponding resolution form a list of common issues. AWSSupport-TroubleshootVPN 832 AWS Systems Manager Automation runbook reference User Guide Note: This automation does not rectify the errors. It runs for the mentioned time range and scans the log group for errors in VPN CloudWatch logs group. How does it work? The runbook runs a parameter validation to confirm if the Amazon CloudWatch log group included in the input parameter exists, if there are any log streams in the log group that correspond to VPN tunnel logging, if VPN connection id exists, and if the Tunnel IP address exists. It makes Logs Insights API calls on your CloudWatch log group that are configured for VPN logging. Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LogGroupName Type: String Description: (Required) The Amazon CloudWatch log group name configured for AWS Site-to-Site VPN connection logging Allowed Pattern: ^[\.\-_/#A-Za-z0-9]{1,512} • VpnConnectionId AWSSupport-TroubleshootVPN 833 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The AWS Site-to-Site VPN connection id to be troubleshooted. Allowed Pattern: ^vpn-[0-9a-f]{8,17}$ • TunnelAIPAddress Type: String Description: (Required) The tunnel number 1 IPv4 address associated with your AWS Site-to-Site VPN. Allowed Pattern: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)[.]){3}(25[0-5]| 2[0-4][0-9]|[01]?[0-9][0-9]?){1}$ • TunnelBIPAddress Type: String Description: (Optional)
|
systems-manager-automation-runbook-guide-194
|
systems-manager-automation-runbook-guide.pdf
| 194 |
actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LogGroupName Type: String Description: (Required) The Amazon CloudWatch log group name configured for AWS Site-to-Site VPN connection logging Allowed Pattern: ^[\.\-_/#A-Za-z0-9]{1,512} • VpnConnectionId AWSSupport-TroubleshootVPN 833 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Required) The AWS Site-to-Site VPN connection id to be troubleshooted. Allowed Pattern: ^vpn-[0-9a-f]{8,17}$ • TunnelAIPAddress Type: String Description: (Required) The tunnel number 1 IPv4 address associated with your AWS Site-to-Site VPN. Allowed Pattern: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)[.]){3}(25[0-5]| 2[0-4][0-9]|[01]?[0-9][0-9]?){1}$ • TunnelBIPAddress Type: String Description: (Optional) The tunnel number 2 IPv4 address associated with your AWS Site-to-Site VPN. Allowed Pattern: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)[.]){3}(25[0-5]| 2[0-4][0-9]|[01]?[0-9][0-9]?){1}|^$ • IKEVersion Type: String Description: (Required) Select what IKE Version you are using. Allowed values : IKEv1, IKEv2 Valid values: ['IKEv1', 'IKEv2'] • StartTimeinEpoch Type: String Description: (Optional) Start time for log analysis. You can either use StartTimeinEpoch/ EndTimeinEpoch or LookBackPeriod for logs analysis Allowed Pattern: ^\d{10}|^$ • EndTimeinEpoch AWSSupport-TroubleshootVPN 834 AWS Systems Manager Automation runbook reference User Guide Type: String Description: (Optional) End time for log analysis. You can either use StartTimeinEpoch/ EndTimeinEpoch or LookBackPeriod for logs analysis. If given both StartTimeinEpoch/ EndTimeinEpoch and LookBackPeriod then LookBackPeriod takes precedence Allowed Pattern: ^\d{10}|^$ • LookBackPeriod Type: String Description: (Optional) Two digit time in hours to look back for log analysis. Valid range : 01 - 99. This value takes precedence if you also give StartTimeinEpoch and EndTime Allowed Pattern: ^(\d?[1-9]|[1-9]0)|^$ Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • logs:DescribeLogGroups • logs:GetQueryResults • logs:DescribeLogStreams • logs:StartQuery • ec2:DescribeVpnConnections Instructions Note: This automation works on the CloudWatch log groups that is configured for your VPN tunnel logging, when the logging Output format is JSON. Follow these steps to configure the automation: 1. Navigate to the AWSSupport-TroubleshootVPN in the AWS Systems Manager console. 2. For the input parameters enter the following: • AutomationAssumeRole (Optional): AWSSupport-TroubleshootVPN 835 AWS Systems Manager Automation runbook reference User Guide The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • LogGroupName (Required): The Amazon CloudWatch log group name to be validated. This must be the CloudWatch log group which is configured for VPN to send logs to. • VpnConnectionId (Required): The AWS Site-to-Site VPN connection id whose log group is traced for VPN error. • TunnelAIPAddress (Required): The tunnel A IP address associated with your AWS Site-to-Site VPN connection. • TunnelBIPAddress (Optional): The tunnel B IP address associated with your AWS Site-to-Site VPN connection. • IKEVersion (Required): Select what IKEversion you are using. Allowed values : IKEv1, IKEv2. • StartTimeinEpoch (Optional): The beginning of the time range to query for error. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC. • EndTimeinEpoch (Optional): The end of the time range to query for errors. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC. • LookBackPeriod (Required): Time in hours to look back to query for error. Note: Configure a StartTimeinEpoch, EndTimeinEpoch, or LookBackPeriod to fix the time range for log analysis. Give a two-digit number in hours to check for errors in the past from AWSSupport-TroubleshootVPN 836 AWS Systems Manager Automation runbook reference User Guide the automation start time. Or, if the error is in the past within a specific time range, include StartTimeinEpoch and EndTimeinEpoch, instead of LookBackPeriod. 3. Select Execute. 4. The automation initiates. 5. The automation runbook performs the following steps: • parameterValidation: Runs a series of validation on input parameters included in automation. • branchOnValidationOfLogGroup: Checks if log group mentioned in the parameter is valid. If invalid, it halts the further initiation of automation steps. • branchOnValidationOfLogStream: Checks if log stream exists in the included CloudWatch log group. If invalid, it halts the further initiation of automation steps. • branchOnValidationOfVpnConnectionId: Checks if the VPN Connection id included in the parameter is valid. If invalid, it halts the further initiation of automation steps. • branchOnValidationOfVpnIp: Checks if Tunnel IP address mentioned in parameter is valid or not. If invalid then it halts the further execution of automation steps. • traceError: Makes a logs insight API call in your included CloudWatch log group and searches for the error related to IKEv1/IKEv2 along with a related suggested resolution. AWSSupport-TroubleshootVPN 837 AWS Systems Manager Automation runbook reference User Guide 6. After completed, review the Outputs section for the detailed results of the execution.
|
systems-manager-automation-runbook-guide-195
|
systems-manager-automation-runbook-guide.pdf
| 195 |
branchOnValidationOfVpnConnectionId: Checks if the VPN Connection id included in the parameter is valid. If invalid, it halts the further initiation of automation steps. • branchOnValidationOfVpnIp: Checks if Tunnel IP address mentioned in parameter is valid or not. If invalid then it halts the further execution of automation steps. • traceError: Makes a logs insight API call in your included CloudWatch log group and searches for the error related to IKEv1/IKEv2 along with a related suggested resolution. AWSSupport-TroubleshootVPN 837 AWS Systems Manager Automation runbook reference User Guide 6. After completed, review the Outputs section for the detailed results of the execution. References Systems Manager Automation • Run this Automation (console) • Run an automation • Setting up an Automation • Support Automation Workflows landing page AWS service documentation • Contents of Site-to-Site VPN logs AWSConfigRemediation-DeleteEgressOnlyInternetGateway Description The AWSConfigRemediation-DeleteEgressOnlyInternetGateway runbook deletes the egress-only internet gateway you specify. AWSConfigRemediation-DeleteEgressOnlyInternetGateway 838 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • EgressOnlyInternetGatewayId Type: String Description: (Required) The ID of the egress-only internet gateway that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteEgressOnlyInternetGateway • ec2:DescribeEgressOnlyInternetGateways Document Steps AWSConfigRemediation-DeleteEgressOnlyInternetGateway 839 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Deletes the egress-only internet gateway specified in the EgressOnlyInternetGatewayId parameter. • aws:executeScript - Verifies the egress-only internet gateway has been deleted. AWSConfigRemediation-DeleteUnusedENI Description The AWSConfigRemediation-DeleteUnusedENI runbook deletes an elastic network interface (ENI) that has an attachment status of detached . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • NetworkInterfaceId Type: String Description: (Required) The ID of the ENI that you want to delete. Required IAM permissions AWSConfigRemediation-DeleteUnusedENI 840 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteNetworkInterface • ec2:DescribeNetworkInterfaces Document Steps • aws:executeAwsApi - Deletes the ENI you specify in the NetworkInterfaceId parameter. • aws:executeScript - Verifies the ENI has been deleted. AWSConfigRemediation-DeleteUnusedSecurityGroup Description The AWSConfigRemediation-DeleteUnusedSecurityGroup runbook deletes the security group you specify in the GroupId parameter. If you attempt to delete a security group that is associated with an Amazon Elastic Compute Cloud (Amazon EC2) instance, or is referenced by another security group, the automation fails. This automation does not delete a default security group. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters AWSConfigRemediation-DeleteUnusedSecurityGroup 841 AWS Systems Manager Automation runbook reference User Guide • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • GroupId Type: String Description: (Required) The ID of the security group that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeSecurityGroups • ec2:DeleteSecurityGroup Document Steps • aws:executeAwsApi - Returns the security group name using the value you provide in the GroupId parameter. • aws:branch - Confirms that the group name is not "default". • aws:executeAwsApi - Deletes the security group specified in the GroupId parameter. • aws:executeScript - Confirms the security group was deleted. AWSConfigRemediation-DeleteUnusedVPCNetworkACL Description The AWSConfigRemediation-DeleteUnusedVPCNetworkACL runbook deletes a network access control list (ACL) that is not associated with a subnet. AWSConfigRemediation-DeleteUnusedVPCNetworkACL 842 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • NetworkAclId Type: String Description: (Required) The ID of the network ACL that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteNetworkAcl • ec2:DescribeNetworkAcls Document Steps AWSConfigRemediation-DeleteUnusedVPCNetworkACL 843 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Deletes the network ACL specified in the NetworkAclId parameter. • aws:executeScript - Confirms the network ACL specified in the NetworkAclId parameter was deleted. AWSConfigRemediation-DeleteVPCFlowLog Description The AWSConfigRemediation-DeleteVPCFlowLog runbook deletes the virtual private cloud (VPC) flow log you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole
|
systems-manager-automation-runbook-guide-196
|
systems-manager-automation-runbook-guide.pdf
| 196 |
the network ACL that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteNetworkAcl • ec2:DescribeNetworkAcls Document Steps AWSConfigRemediation-DeleteUnusedVPCNetworkACL 843 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Deletes the network ACL specified in the NetworkAclId parameter. • aws:executeScript - Confirms the network ACL specified in the NetworkAclId parameter was deleted. AWSConfigRemediation-DeleteVPCFlowLog Description The AWSConfigRemediation-DeleteVPCFlowLog runbook deletes the virtual private cloud (VPC) flow log you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • FlowLogId Type: String Description: (Required) The ID of the flow log that you want to delete. Required IAM permissions AWSConfigRemediation-DeleteVPCFlowLog 844 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteFlowLogs • ec2:DescribeFlowLogs Document Steps • aws:executeAwsApi - Deletes the flow log you specify in the FlowLogId parameter. • aws:executeScript - Verifies the flow log has been deleted. AWSConfigRemediation-DetachAndDeleteInternetGateway Description The AWSConfigRemediation-DetachAndDeleteInternetGateway runbook detaches and deletes the internet gateway you specify. If any Amazon EC2 instances in your virtual private cloud (VPC) have elastic IP addresses or public IPv4 addresses associated with them, the runbook fails. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSConfigRemediation-DetachAndDeleteInternetGateway 845 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • InternetGatewayId Type: String Description: (Required) The ID of the internet gateway that you want to delete. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteInternetGateway • ec2:DescribeInternetGateways • ec2:DetachInternetGateway Document Steps • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's state property changes to available or times out. • aws:executeAwsApi - Retrieves a specified virtual private gateway configuration. • aws:branch - Branches based on the VpcAttachments.state parameter value. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes to attached or times out. • aws:executeAwsApi - Accepts the ID of the virtual private gateway and the ID of the Amazon VPC as input, and detaches the virtual private gateway from the Amazon VPC. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes to detached or times out. AWSConfigRemediation-DetachAndDeleteInternetGateway 846 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Accepts the ID of the virtual private gateway as input and deletes it. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway as input and verifies its deletion. aws:executeAwsApi - Gathers the VPC ID from the internet gateway ID. • aws:executeAwsApi - Detaches the internet gateway ID from the VPC. • aws:executeAwsApi - Deletes the internet gateway. AWSConfigRemediation- DetachAndDeleteVirtualPrivateGateway Description The AWSConfigRemediation-DetachAndDeleteVirtualPrivateGateway runbook detaches and deletes a given Amazon Elastic Compute Cloud (Amazon EC2) virtual private gateway attached to a virtual private cloud (VPC) created with Amazon Virtual Private Cloud (Amazon VPC). Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-DetachAndDeleteVirtualPrivateGateway 847 AWS Systems Manager Automation runbook reference User Guide • VpnGatewayId Type: String Description: (Required) The ID of the virtual private gateway to be deleted. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteVpnGateway • ec2:DetachVpnGateway • ec2:DescribeVpnGateways Document Steps • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's state property changes to available or times out. • aws:executeAwsApi - Retrieves a specified virtual private gateway configuration. • aws:branch - Branches based on the VpcAttachments.state parameter value. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes to attached or times out. • aws:executeAwsApi - Accepts the ID of the virtual private gateway and the ID of the Amazon VPC as input, and detaches the virtual private gateway from the Amazon VPC. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes
|
systems-manager-automation-runbook-guide-197
|
systems-manager-automation-runbook-guide.pdf
| 197 |
or times out. • aws:executeAwsApi - Retrieves a specified virtual private gateway configuration. • aws:branch - Branches based on the VpcAttachments.state parameter value. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes to attached or times out. • aws:executeAwsApi - Accepts the ID of the virtual private gateway and the ID of the Amazon VPC as input, and detaches the virtual private gateway from the Amazon VPC. • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway and waits until the virtual private gateway's VpcAttachments.state's property changes to detached or times out. • aws:executeAwsApi - Accepts the ID of the virtual private gateway as input and deletes it. AWSConfigRemediation-DetachAndDeleteVirtualPrivateGateway 848 AWS Systems Manager Automation runbook reference User Guide • aws:waitForAwsResourceProperty - Accepts the ID of the virtual private gateway as input and verifies its deletion. AWS-DisableIncomingSSHOnPort22 Description The AWS-DisableIncomingSSHOnPort22 runbook removes rules that allow unrestricted incoming SSH traffic on TCP port 22 for security groups. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • SecurityGroupIds Type: String Description: (Required) A comma separated list of the IDs of the security groups you want to restrict SSH traffic for. AWS-DisableIncomingSSHOnPort22 849 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ec2:DescribeSecurityGroups • ec2:RevokeSecurityGroupIngress Document Steps • aws:executeAwsApi - Removes all rules allowing incoming SSH traffic on TCP port 22 from the security groups you specify in the SecurityGroupIds parameter. Outputs DisableIncomingSSHTemplate.RestrictedSecurityGroupIds - A list of the IDs of the security groups that had inbound SSH rules removed. AWS-DisablePublicAccessForSecurityGroup Description This runbook disables default SSH and RDP ports that are opened to all IP addresses. Important This runbook fails with an "InvalidPermission.NotFound" error for security groups that meet both of the following criteria: 1) The security group is located in a non-default VPC; and 2) The inbound rules for the security group don't specify open ports using all four of the following patterns: • 0.0.0.0/0 • ::/0 • SSH or RDP port + 0.0.0.0/0 • SSH or RDP port + ::/0 AWS-DisablePublicAccessForSecurityGroup 850 AWS Systems Manager Automation runbook reference User Guide Note This runbook is not available in the AWS Regions located within China. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • GroupId Type: String Description: (Required) The ID of the security group for which the ports should be disabled. • IpAddressToBlock Type: String Description: (Optional) Additional IPv4 addresses from which access should be blocked, in the format 1.2.3.4/32 . AWS-DisablePublicAccessForSecurityGroup 851 AWS Systems Manager Automation runbook reference User Guide AWSConfigRemediation-DisableSubnetAutoAssignPublicIP Description The AWSConfigRemediation-DisableSubnetAutoAssignPublicIP runbook disables the IPv4 public addressing attribute for the subnet you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • SubnetId Type: String Description: (Required) The ID of the subnet that you want to disable the auto-assign public IPv4 address attribute on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. AWSConfigRemediation-DisableSubnetAutoAssignPublicIP 852 AWS Systems Manager Automation runbook reference User Guide • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeSubnets • ec2:ModifySubnetAttribute Document Steps • aws:executeAwsApi - Disables the auto-assign public IPv4 address attribute for the subnet you specified in the SubnetId parameter. • aws:assertAwsResourceProperty - Verifies the attribute has been disabled. AWSSupport-EnableVPCFlowLogs Description The AWSSupport-EnableVPCFlowLogs runbook creates Amazon Virtual Private Cloud (Amazon VPC) Flow Logs for subnets, network interfaces, and VPCs in your AWS account. If you create a flow log for a subnet or VPC, each elastic network interface in that subnet or Amazon VPC is monitored. Flow log data is published to the Amazon CloudWatch Logs log group or the Amazon Simple Storage Service (Amazon S3) bucket you specify. For more information about flow logs, see VPC Flow Logs in the Amazon VPC User Guide . Important Data ingestion and archival charges for vended logs apply when you publish flow logs to CloudWatch
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.