--- title: Executing scripts required for setting up AWS description: You must execute scripts provided with the Service Graph Connector for AWS to set up the AWS environment for importing data. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/service-graph-connectors/sgc-cmdb-aws-script-op.html release: australia product: Service Graph Connectors classification: service-graph-connectors topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 5 keywords: [Service Graph Connector for AWS, Service Graph Connector for AWS scripts] breadcrumb: [Configure the AWS environment, AWS, Service Graph Connectors, Integrating third-party data into CMDB, Configuration Management, Extend ServiceNow AI Platform capabilities] --- # Executing scripts required for setting up AWS You must execute scripts provided with the Service Graph Connector for AWS to set up the AWS environment for importing data. **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). The 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). Based on the AWS environment requirements, the scripts provided with the Service Graph Connector for AWS are categorized as described in the following table.
| [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) | [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) | [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) |
| Script | Input parameters | Execution condition | Result |
|---|---|---|---|
| EnableAWSConfig.yml | None | Execute the script in all the AWS accounts and AWS regions by creating a CloudFormation StackSet in the management account. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Enables the AWS Config recorder. |
| CreateServiceNowUser.yml | - **SNUserName** Name 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). Default value: `NOWSGCUser` - **MbrActRoleName** Name 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). Default value: `SnowOrganizationAccountAccessRole` | Execute the script by creating a stack either in the management account or in a designated member account. 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. | Creates the ServiceNow IAM user. |
| CreateSnowOrganizationAccountAccessRoleInMemberAccount.yml | - **ACNNBR** Management account ID when the ServiceNow IAM user is in a management account Or Designated member account ID when the ServiceNow IAM user is in a designated member account. - **S3Bucket** Amazon S3 bucket name to get the `SendCommand` output. - **ServiceNowUserName** Name 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). Default value: `NOWSGCUser` | Execute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Enables read-only IAM policies, roles, and groups for the ServiceNow IAM user. |
| SnowDesignatedAccountAccessRoleInManagementAccount.yml | - **MEMBERACTNBR** Member account ID where the ServiceNow IAM user was created. | Execute the script by creating a stack in the management account. 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. **Note:** Use the `SnowDesignatedAccountAccessRoleInManagementAccount.yml` script only when the ServiceNow IAM user was created in a member account. | Creates the ServiceNow IAM role in the management account. |
| AWS-SystemsManager-AutomationExecutionRole.yml | None | Execute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Provisions the execution role necessary to run automations in member accounts. A prerequisite for configuring Systems Manager Automation. |
| AWS-SystemsManager-AutomationAdministrationRole.yml | None | Execute the script by creating a stack in the management account. 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. | Provisions the administrator role in the management account necessary to run cross-account automation across multiple accounts. A prerequisite for configuring Systems Manager Automation. |
| Script | Input parameters | Execution condition | Result |
|---|---|---|---|
| AmazonSSMForInstancesRoleSetup.yml | - **S3Bucket** S3 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). | Execute the script in all the AWS accounts by creating a CloudFormation StackSet in the management account. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Creates the AmazonSSMForInstancesRole IAM instance profile role to be attached to the EC2 instances. |
| SG-AWS-RunShellScript-Setup.yml | None | Execute the script in all the AWS accounts and the AWS regions by creating a CloudFormation StackSet in the management account. AWS administrators must update SSM documents and verify that EC2 instances can execute relevant commands for proper integration. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Creates 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. |
| SG-AWS-RunPowerShellScript-Setup.yml | None | Execute the script in all the AWS accounts and the AWS regions by creating a CloudFormation StackSet in the management account. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Creates AWS SSM documents to fetch deep discovery data from a Windows EC2 instance. |
| Script | Execution condition | Result |
|---|---|---|
| SG-AWS-RunKubeCtlEKSNamesShellScript.yml | Execute 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. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Creates an AWS SSM document to discover EKS clusters associated with EC2 Bastion hosts. **Note:** An AWS Cloud administrator can update the SSM document in their AWS setup. |
| SG-AWS-RunKubeCtlShellScript.yml | Execute 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. See [Create a stack set](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html) on the AWS documentation site. | Creates an AWS SSM document to fetch CIs related to Kubernetes components, such as pods, services, and deployments, from EKS clusters. **Note:** An AWS Cloud administrator can update the SSM document in their AWS setup. |