{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":49135,"path":"servicenow-platform/service-graph-connectors/sgc-cmdb-aws-script-op.md","title":"Executing scripts required for setting up AWS","bundle":null,"doc_type":null,"release":"australia","body":"\n# Executing scripts required for setting up AWS\n\nYou must execute scripts provided with the Service Graph Connector for AWS to set up the AWS environment for importing data.\n\n**Important:** Before executing an AWS script, ensure that you have completed the prerequisites. See [Prerequisites for executing scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-scripts-prereq.md).\n\nThe AWS scripts provided with the connector configure AWS resources to import the configuration items \\(CIs\\) data into the CMDB. To learn more, see [AWS resources used by the Service Graph Connector for AWS](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-concepts.md).\n\nBased on the AWS environment requirements, the scripts provided with the Service Graph Connector for AWS are categorized as described in the following table.\n\n<table id=\"table_w2k_kkm_4zb\" class=\"nav-card\"><tbody><tr><td>\n\n[Basic scripts\\[Omitted image \"bus-optimize-manage.svg\"\\] Alt text:Scripts for configuring the AWS environment to import data by using the connector.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-script-op.md)\n\n</td><td>\n\n[Deep discovery scripts\\[Omitted image \"bus-discover.svg\"\\] Alt text:Scripts for setting up deep discovery on Amazon Elastic Compute Cloud \\(Amazon EC2\\) instances.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-script-op.md)\n\n</td><td>\n\n[Amazon EKS scripts\\[Omitted image \"bus-service-aware-cmdb.svg\"\\] Alt text:Scripts for setting up Amazon Elastic Kubernetes Service \\(EKS\\) clusters.](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-script-op.md)\n\n</td></tr></tbody>\n</table>## Basic scripts\n\nUse the basic scripts to configure the AWS environment for importing data using the Service Graph Connector for AWS.\n\nThe following table describes the basic AWS scripts available with the connector, the input parameters entered when executing a script, the conditions to execute the scripts, and the script execution results.\n\n<table id=\"table_jw4_yyf_4zb\" class=\"custom-rows\"><thead><tr><th class=\"filter\">\n\nScript\n\n</th><th>\n\nInput parameters\n\n</th><th>\n\nExecution condition\n\n</th><th class=\"filter\">\n\nResult\n\n</th></tr></thead><tbody><tr><td>\n\nEnableAWSConfig.yml\n\n</td><td>\n\nNone\n\n</td><td>\n\nExecute the script in all the AWS accounts and AWS regions by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nEnables the AWS Config recorder.\n\n</td></tr><tr><td>\n\nCreateServiceNowUser.yml\n\n</td><td>\n\n-   **SNUserName**\n\nName of the ServiceNow IAM user that was created as part of the setup. See [Prerequisites for executing scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-scripts-prereq.md).\n\nDefault value: `NOWSGCUser`\n\n-   **MbrActRoleName**\n\nName of the ServiceNow IAM role that was created as part of the setup. See [Prerequisites for executing scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-scripts-prereq.md).\n\nDefault value: `SnowOrganizationAccountAccessRole`\n\n\n</td><td>\n\nExecute the script by creating a stack either in the management account or in a designated member account.\n\n See [Creating a stack on the AWS CloudFormation console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) on the AWS documentation site.\n\n</td><td>\n\nCreates the ServiceNow IAM user.\n\n</td></tr><tr><td>\n\nCreateSnowOrganizationAccountAccessRoleInMemberAccount.yml\n\n</td><td>\n\n-   **ACNNBR**\n\nManagement account ID when the ServiceNow IAM user is in a management account\n\nOr\n\nDesignated member account ID when the ServiceNow IAM user is in a designated member account.\n\n-   **S3Bucket**\n\nAmazon S3 bucket name to get the `SendCommand` output.\n\n-   **ServiceNowUserName**\n\nName of the ServiceNow IAM user that was created as part of the setup. See [Prerequisites for executing scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-scripts-prereq.md).\n\nDefault value: `NOWSGCUser`\n\n\n</td><td>\n\nExecute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nEnables read-only IAM policies, roles, and groups for the ServiceNow IAM user.\n\n</td></tr><tr><td>\n\nSnowDesignatedAccountAccessRoleInManagementAccount.yml\n\n</td><td>\n\n-   **MEMBERACTNBR**\n\nMember account ID where the ServiceNow IAM user was created.\n\n\n</td><td>\n\nExecute the script by creating a stack in the management account.\n\n See [Creating a stack on the AWS CloudFormation console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) on the AWS documentation site.\n\n **Note:** Use the `SnowDesignatedAccountAccessRoleInManagementAccount.yml` script only when the ServiceNow IAM user was created in a member account.\n\n</td><td>\n\nCreates the ServiceNow IAM role in the management account.\n\n</td></tr><tr><td>\n\nAWS-SystemsManager-AutomationExecutionRole.yml\n\n</td><td>\n\nNone\n\n</td><td>\n\nExecute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nProvisions the execution role necessary to run automations in member accounts. A prerequisite for configuring Systems Manager Automation.\n\n</td></tr><tr><td>\n\nAWS-SystemsManager-AutomationAdministrationRole.yml\n\n</td><td>\n\nNone\n\n</td><td>\n\nExecute the script by creating a stack in the management account.\n\n See [Creating a stack on the AWS CloudFormation console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) on the AWS documentation site.\n\n</td><td>\n\nProvisions the administrator role in the management account necessary to run cross-account automation across multiple accounts. A prerequisite for configuring Systems Manager Automation.\n\n</td></tr></tbody>\n</table>## Deep discovery scripts\n\nUse the deep discovery scripts to set up deep discovery on Amazon EC2 instances.\n\n**Note:** Execute the deep discovery scripts only when you want to perform deep discovery on EC2 instances.\n\nThe following table describes the deep discovery scripts, the input parameters entered when executing a script, the conditions to execute the scripts, and the script execution results.\n\n<table id=\"table_fjg_vs4_jzb\"><thead><tr><th>\n\nScript\n\n</th><th>\n\nInput parameters\n\n</th><th>\n\nExecution condition\n\n</th><th>\n\nResult\n\n</th></tr></thead><tbody><tr><td>\n\nAmazonSSMForInstancesRoleSetup.yml\n\n</td><td>\n\n-   **S3Bucket**\n\nS3 bucket name that collects the details from EC2 instances. See [Prerequisites for executing scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-scripts-prereq.md).\n\n\n</td><td>\n\nExecute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nCreates the AmazonSSMForInstancesRole IAM instance profile role to be attached to the EC2 instances.\n\n</td></tr><tr><td>\n\nSG-AWS-RunShellScript-Setup.yml\n\n</td><td>\n\nNone\n\n</td><td>\n\nExecute the script in all the AWS accounts and the AWS regions by creating a CloudFormation StackSet in the management account.\n\n AWS administrators must update SSM documents and verify that EC2 instances can execute relevant commands for proper integration.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nCreates AWS Systems Manager \\(SSM\\) documents to fetch deep discovery data from a Linux EC2 instance.Retrieves version details for middleware applications, including Apache HTTP server, Nginx server, Apache Tomcat server, and MySQL instance.\n\n</td></tr><tr><td>\n\nSG-AWS-RunPowerShellScript-Setup.yml\n\n</td><td>\n\nNone\n\n</td><td>\n\nExecute the script in all the AWS accounts and the AWS regions by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nCreates AWS SSM documents to fetch deep discovery data from a Windows EC2 instance.\n\n</td></tr></tbody>\n</table>## Amazon EKS scripts\n\nUse the Amazon EKS scripts to set up Amazon Elastic Kubernetes Service \\(EKS\\) clusters.\n\n**Note:** Execute the Amazon EKS scripts only when the Amazon EKS service for Kubernetes clusters is required.\n\nThe following table describes the Amazon EKS scripts, the conditions to execute the scripts, and the script execution results.\n\n<table id=\"table_psh_4zf_4zb\"><thead><tr><th>\n\nScript\n\n</th><th>\n\nExecution condition\n\n</th><th>\n\nResult\n\n</th></tr></thead><tbody><tr><td>\n\nSG-AWS-RunKubeCtlEKSNamesShellScript.yml\n\n</td><td>\n\nExecute the script in all the AWS accounts and the AWS regions where the EC2 Bastion hosts are located by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nCreates an AWS SSM document to discover EKS clusters associated with EC2 Bastion hosts.\n\n **Note:** An AWS Cloud administrator can update the SSM document in their AWS setup.\n\n</td></tr><tr><td>\n\nSG-AWS-RunKubeCtlShellScript.yml\n\n</td><td>\n\nExecute the script in all the AWS accounts and the AWS regions where the EC2 Bastion hosts are located by creating a CloudFormation StackSet in the management account.\n\n See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site.\n\n</td><td>\n\nCreates an AWS SSM document to fetch CIs related to Kubernetes components, such as pods, services, and deployments, from EKS clusters.\n\n **Note:** An AWS Cloud administrator can update the SSM document in their AWS setup.\n\n</td></tr></tbody>\n</table>"}}