Skip to main content

AwsEC2SyncAccounts

This Script is part of the AWS - EC2 Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.10.0 and later.

Update an AWS - EC2 instance with a list of accounts in an AWS organization, which will allow EC2 commands to run in all of them. This script can be run on a schedule to keep an AWS - EC2 instance in sync with the created, deleted or removed accounts of the organization.

Prerequisites#

  • An AWS - EC2 instance.
  • An AWS - Organizations instance with a working aws-org-account-list command.
  • A Core REST API instance.

Script Data#


NameDescription
Script Typepython3
TagsAmazon Web Services
Cortex XSOAR Version6.10.0

Inputs#


Argument NameDescription
ec2_instance_nameThe name of the AWS - EC2 instance integration to update.
org_instance_nameThe name of the AWS - Organizations instance to collect account from. If not provided, the primary instance will be used.
exclude_accountsA comma-separated list of accounts to exclude.
max_accountsThe maximum number of accounts to retrieve. Default is 50.

Outputs#


There are no outputs for this script.

Script Examples#

Example command#

!AwsEC2SyncAccounts ec2_instance_name="AWS_EC2_Instance" org_instance_name="AWS_Organizations_Instance"

Human Readable Output#

Successfully updated AWS_EC2_Instance with accounts:#


AWS Organization Accounts#

IdArnNameEmailJoinedMethodJoinedTimestampStatus
111222333444arn:aws:organizations::111222333444:account/o-abcde12345/111222333444Nameuser@xsoar.comCREATED2023-09-04 09:17:14.299000+00:00ACTIVE
111222333444arn:aws:organizations::111222333444:account/o-abcde12345/111222333444ferrum-techsuser@xsoar.comINVITED2022-07-25 09:11:23.528000+00:00SUSPENDED