Amazon AWS EC2
57 min
the amazon aws ec2 connector enables management and automation of ec2 instances and security features, facilitating seamless integration with cloud based workflows amazon aws ec2 is a secure, resizable compute service that offers cloud based virtual servers to support a wide range of applications this connector enables swimlane turbine users to automate key ec2 operations such as instance management, security group updates, and network acl configurations by integrating with amazon aws ec2, users can streamline security workflows, rapidly respond to threats, and manage cloud resources efficiently, all within the swimlane platform prerequisites to utilize the amazon aws ec2 connector with swimlane turbine, ensure you have the following aws authentication credentials with appropriate permissions region name the name of the region your ec2 instances are hosted in this connector allows turbine to connect to aws ec2 asset setup this integration authenticates with aws ec2 using the following input values requirements aws access key id a long term aws access key id with access to athena aws secret key id a long term secret access key associated with the above accesskey id region name the aws region role arn an arn of an aws iam role to assume this is optional external id an external id to use when assuming the role this is optional obtaining aws credentials to use this integration, you will need to have an aws account and obtain the necessary aws credentials you can obtain these credentials by following the steps below log in to your aws account and navigate to the iam console in the left navigation pane, click on the "users" tab and select the user for which you want to create credentials click on the "security credentials" tab, and then click on the "create access key" make sure to save the access key id and secret access key in a secure location, as you will not be able to see the secret access key again after this step if you want to use an aws iam role, you will need to have the arn of the role and an optional external id, if one was specified by the aws account administrator notes https //docs aws amazon com/powershell/latest/userguide/pstools appendix sign up html https //boto3 amazonaws com/v1/documentation/api/latest/reference/services/ec2 html#ec2 configurations aws ec2 authentication authenticates using aws credentials configuration parameters parameter description type required access key aws access key, see https //docs aws amazon com/general/latest/gr/managing aws access keys html for more information string optional secret key aws secret key, see https //docs aws amazon com/general/latest/gr/managing aws access keys html for more information string optional region name the aws region where you want to create new connections string required role arn optional role arn to assume leave blank unless tasks need to assume a different role see https //docs aws amazon com/sts/latest/apireference/api assumerole html for more information string optional external id external id to assume iam role optional value used for assuming roles can be added, or removed in trusted relationships of target role string optional session token use if a session token is provided when switching roles string optional role session name defaults to sessionfromswimlane \<hash> when no value is provide string optional actions allow ip in network acls grants access to a specified ip address by updating the network acls in amazon aws ec2 endpoint method get input argument name type required description ip address string required parameter for allow ip in network acls input example {"ip address" "192 168 1 1"} output parameter type description success boolean whether the operation was successful output example {"success"\ true} block ip in network acls blocks a specified ip address using amazon aws ec2 network access control lists (acls) requires an ip address as input endpoint method get input argument name type required description ip address string required parameter for block ip in network acls input example {"ip address" "192 168 1 1"} output parameter type description success boolean whether the operation was successful output example {"success"\ true} create instance launches a specified number of amazon aws ec2 instances with required permissions, monitoring options, and instance counts endpoint method get input argument name type required description blockdevicemappings array optional parameter for create instance blockdevicemappings devicename string optional name of the resource blockdevicemappings virtualname string optional name of the resource blockdevicemappings ebs object optional parameter for create instance blockdevicemappings ebs deleteontermination boolean optional parameter for create instance blockdevicemappings ebs iops number optional parameter for create instance blockdevicemappings ebs snapshotid string optional unique identifier blockdevicemappings ebs volumesize number optional parameter for create instance blockdevicemappings ebs volumetype string optional type of the resource blockdevicemappings ebs kmskeyid string optional unique identifier blockdevicemappings ebs throughput number optional parameter for create instance blockdevicemappings ebs outpostarn string optional parameter for create instance blockdevicemappings ebs encrypted boolean optional parameter for create instance blockdevicemappings nodevice string optional parameter for create instance imageid string optional unique identifier instancetype string optional type of the resource ipv6addresscount number optional count value ipv6addresses array optional parameter for create instance ipv6addresses ipv6address string optional parameter for create instance ipv6addresses isprimaryipv6 boolean optional parameter for create instance kernelid string optional unique identifier keyname string optional name of the resource maxcount number required count value mincount number required count value monitoring object required parameter for create instance input example {"imageid" "string","instancetype" "a1 medium","ipv6addresscount" 123,"ipv6addresses" \[{"ipv6address" "string","isprimaryipv6"\ true}],"kernelid" "string","keyname" "string","maxcount" 123,"mincount" 123,"monitoring" {"enabled"\ true},"placement" {"availabilityzone" "string","affinity" "string","groupname" "string","partitionnumber" 123,"hostid" "string","tenancy" "default","spreaddomain" "string","hostresourcegrouparn" "string","groupid" "string"},"ramdiskid" "string","securitygroupids" \["string"],"securitygroups" \["string"],"subnetid" "string","userdata" "string","additionalinfo" "string","clienttoken" "string","disableapitermination"\ true,"dryrun"\ true,"ebsoptimized"\ true,"iaminstanceprofile" {"arn" "string","name" "string"},"instanceinitiatedshutdownbehavior" "stop","networkinterfaces" \[{"associatepublicipaddress"\ true,"deleteontermination"\ true,"description" "string","deviceindex" 123,"groups" \["string"],"ipv6addresscount" 123,"ipv6addresses" \[{"ipv6address" "string","isprimaryipv6"\ true}],"networkinterfaceid" "string","privateipaddress" "string","privateipaddresses" \[{"primary"\ true,"privateipaddress" "string"}],"secondaryprivateipaddresscount" 123,"subnetid" "string","associatecarrieripaddress"\ true,"interfacetype" "string","networkcardindex" 123,"ipv4prefixes" \[{"ipv4prefix" "string"}],"ipv4prefixcount" 123,"ipv6prefixes" \[{"ipv6prefix" "string"}],"ipv6prefixcount" 123,"primaryipv6"\ true}],"privateipaddress" "string","elasticgpuspecification" \[{"type" "string"}],"elasticinferenceaccelerators" \[{"type" "string","count" 123}],"tagspecifications" \[{"resourcetype" "capacity reservation","tags" \[{"key" "string","value" "string"}]}],"launchtemplate" {"launchtemplateid" "string","launchtemplatename" "string","version" "string"},"instancemarketoptions" {"markettype" "spot","spotoptions" {"maxprice" "string","spotinstancetype" "one time","blockdurationminutes" 123,"validuntil" "string","instanceinterruptionbehavior" "hibernate"}},"creditspecification" {"cpucredits" "string"},"cpuoptions" {"corecount" 123,"threadspercore" 123,"amdsevsnp" "enabled"},"capacityreservationspecification" {"capacityreservationpreference" "open","capacityreservationtarget" {"capacityreservationid" "string","capacityreservationresourcegrouparn" "string"}},"hibernationoptions" {"configured"\ true},"licensespecifications" \[{"licenseconfigurationarn" "string"}],"metadataoptions" {"httptokens" "optional","httpputresponsehoplimit" 123,"httpendpoint" "disabled","httpprotocolipv6" "disabled","instancemetadatatags" "disabled"},"enclaveoptions" {"enabled"\ true},"privatednsnameoptions" {"hostnametype" "ip name","enableresourcenamednsarecord"\ true,"enableresourcenamednsaaaarecord"\ true},"maintenanceoptions" {"autorecovery" "disabled"},"disableapistop"\ true,"enableprimaryipv6"\ true} output parameter type description groups array output field groups groups groupname string name of the resource groups groupid string unique identifier instances array output field instances instances amilaunchindex number output field instances amilaunchindex instances imageid string unique identifier instances instanceid string unique identifier instances instancetype string type of the resource instances keyname string name of the resource instances launchtime string time value instances monitoring object output field instances monitoring instances monitoring state string output field instances monitoring state instances placement object output field instances placement instances placement availabilityzone string output field instances placement availabilityzone instances placement affinity string output field instances placement affinity instances placement groupname string name of the resource instances placement partitionnumber number output field instances placement partitionnumber instances placement hostid string unique identifier instances placement tenancy string output field instances placement tenancy instances placement spreaddomain string output field instances placement spreaddomain instances placement hostresourcegrouparn string output field instances placement hostresourcegrouparn instances placement groupid string unique identifier instances platform string output field instances platform instances privatednsname string name of the resource instances privateipaddress string output field instances privateipaddress output example {"groups" \[{"groupname" "string","groupid" "string"}],"instances" \[{"amilaunchindex" 123,"imageid" "string","instanceid" "string","instancetype" "a1 medium","keyname" "string","launchtime" "datetime(2015, 1, 1)","monitoring" {},"placement" {},"platform" "windows","privatednsname" "string","privateipaddress" "string","productcodes" \[],"publicdnsname" "string","publicipaddress" "string","ramdiskid" "string"}],"ownerid" "string","requesterid" "string","reservationid" "string"} create security group creates a new security group in amazon aws ec2 with a specified name and description endpoint method get input argument name type required description description string required parameter for create security group groupname string required name of the resource vpcid string optional unique identifier tagspecifications array optional parameter for create security group tagspecifications resourcetype string optional type of the resource tagspecifications tags array optional parameter for create security group tagspecifications tags key string optional parameter for create security group tagspecifications tags value string optional value for the parameter dryrun boolean optional parameter for create security group input example {"description" "string","groupname" "string","vpcid" "string","tagspecifications" \[{"resourcetype" "capacity reservation","tags" \[{"key" "string","value" "string"}]}],"dryrun"\ true} output parameter type description groupid string unique identifier tags array output field tags tags key string output field tags key tags value string value for the parameter output example {"groupid" "string","tags" \[{"key" "string","value" "string"}]} delete security group removes a specified security group from amazon aws ec2 ensure no instances are associated with it before deletion endpoint method get input argument name type required description groupid string optional unique identifier groupname string optional name of the resource dryrun boolean optional parameter for delete security group input example {"groupid" "string","groupname" "string","dryrun"\ true} output parameter type description responsemetadata object response data output example {"responsemetadata" {}} get instances info retrieves details for specified amazon aws ec2 instances or all instances if no specific criteria are provided endpoint method get input argument name type required description filters array optional parameter for get instances info filters name string optional name of the resource filters values array optional value for the parameter instanceids array optional unique identifier dryrun boolean optional parameter for get instances info maxresults number optional result of the operation nexttoken string optional parameter for get instances info input example {"filters" \[{"name" "string","values" \["string"]}],"instanceids" \["string"],"dryrun"\ true,"maxresults" 123,"nexttoken" "string"} output parameter type description reservations array output field reservations reservations groups array output field reservations groups reservations groups groupname string name of the resource reservations groups groupid string unique identifier reservations instances array output field reservations instances reservations instances amilaunchindex number output field reservations instances amilaunchindex reservations instances imageid string unique identifier reservations instances instanceid string unique identifier reservations instances instancetype string type of the resource reservations instances kernelid string unique identifier reservations instances keyname string name of the resource reservations instances launchtime string time value reservations instances monitoring object output field reservations instances monitoring reservations instances monitoring state string output field reservations instances monitoring state reservations instances placement object output field reservations instances placement reservations instances placement availabilityzone string output field reservations instances placement availabilityzone reservations instances placement affinity string output field reservations instances placement affinity reservations instances placement groupname string name of the resource reservations instances placement partitionnumber number output field reservations instances placement partitionnumber reservations instances placement hostid string unique identifier reservations instances placement tenancy string output field reservations instances placement tenancy reservations instances placement spreaddomain string output field reservations instances placement spreaddomain reservations instances placement hostresourcegrouparn string output field reservations instances placement hostresourcegrouparn reservations instances placement groupid string unique identifier reservations instances platform string output field reservations instances platform output example {"reservations" \[{"groups" \[],"instances" \[],"ownerid" "string","requesterid" "string","reservationid" "string"}],"nexttoken" "string"} list security groups retrieves details of specified security groups or all security groups associated with your amazon aws ec2 account endpoint method get input argument name type required description filters array optional parameter for list security groups filters name string optional name of the resource filters values array optional value for the parameter groupids array optional unique identifier groupnames array optional name of the resource dryrun boolean optional parameter for list security groups maxresults number optional the maximum number of items to return for this request this value can be between 5 and 1000 nexttoken string optional parameter for list security groups input example {"filters" \[{"name" "string","values" \["string"]}],"groupids" \["string"],"groupnames" \["string"],"dryrun"\ true} output parameter type description securitygroups array output field securitygroups securitygroups description string output field securitygroups description securitygroups groupname string name of the resource securitygroups ippermissions array output field securitygroups ippermissions securitygroups ippermissions fromport number output field securitygroups ippermissions fromport securitygroups ippermissions ipprotocol string output field securitygroups ippermissions ipprotocol securitygroups ippermissions ipranges array output field securitygroups ippermissions ipranges securitygroups ippermissions ipranges cidrip string unique identifier securitygroups ippermissions ipranges description string output field securitygroups ippermissions ipranges description securitygroups ippermissions ipv6ranges array output field securitygroups ippermissions ipv6ranges securitygroups ippermissions ipv6ranges cidripv6 string unique identifier securitygroups ippermissions ipv6ranges description string output field securitygroups ippermissions ipv6ranges description securitygroups ippermissions prefixlistids array unique identifier securitygroups ippermissions prefixlistids description string unique identifier securitygroups ippermissions prefixlistids prefixlistid string unique identifier securitygroups ippermissions toport number output field securitygroups ippermissions toport securitygroups ippermissions useridgrouppairs array unique identifier securitygroups ippermissions useridgrouppairs description string unique identifier securitygroups ippermissions useridgrouppairs groupid string unique identifier securitygroups ippermissions useridgrouppairs groupname string unique identifier securitygroups ippermissions useridgrouppairs peeringstatus string unique identifier securitygroups ippermissions useridgrouppairs userid string unique identifier securitygroups ippermissions useridgrouppairs vpcid string unique identifier securitygroups ippermissions useridgrouppairs vpcpeeringconnectionid string unique identifier securitygroups ownerid string unique identifier output example {"securitygroups" \[{"description" "string","groupname" "string","ippermissions" \[],"ownerid" "string","groupid" "string","ippermissionsegress" \[],"tags" \[],"vpcid" "string"}],"nexttoken" "string"} quarantine instance isolate an amazon aws ec2 instance by modifying its associated security groups, requiring 'instance id' and 'vpc id' endpoint method get input argument name type required description instance id string required unique identifier vpc id string required unique identifier input example {"instance id" "string","vpc id" "string"} output parameter type description success boolean whether the operation was successful group name string name of the resource output example {"success"\ true,"group name" "string"} snapshot instance create a snapshot of an amazon aws ec2 instance using the specified instance id endpoint method get input argument name type required description instance id string required unique identifier input example {"instance id" "string"} output parameter type description snapshot array output field snapshot snapshot description string output field snapshot description snapshot tags object output field snapshot tags snapshot tags type number type of the resource snapshot tags name string name of the resource snapshot encrypted boolean output field snapshot encrypted snapshot volumeid string unique identifier snapshot state string output field snapshot state snapshot volumesize number output field snapshot volumesize snapshot progress string output field snapshot progress snapshot starttime string time value snapshot ownerid string unique identifier snapshot snapshotid string unique identifier output example {"snapshot" \[{"description" "string","tags" {},"encrypted"\ true,"volumeid" "string","state" "string","volumesize" 1024,"progress" "string","starttime" "string","ownerid" "string","snapshotid" "string"}]} start instance initiates the start process for an amazon ebs backed ec2 instance that was previously stopped, requiring the 'instanceids' parameter endpoint method get input argument name type required description instanceids array required unique identifier additionalinfo string optional parameter for start instance dryrun boolean optional parameter for start instance input example {"instanceids" \["string"],"additionalinfo" "string","dryrun"\ true} output parameter type description startinginstances array output field startinginstances startinginstances currentstate object output field startinginstances currentstate startinginstances currentstate code number output field startinginstances currentstate code startinginstances currentstate name string name of the resource startinginstances instanceid string unique identifier startinginstances previousstate object output field startinginstances previousstate startinginstances previousstate code number output field startinginstances previousstate code startinginstances previousstate name string name of the resource output example {"startinginstances" \[{"currentstate" {},"instanceid" "string","previousstate" {}}]} stop instance stops an amazon ebs backed instance by specifying the required instanceids endpoint method get input argument name type required description instanceids array required unique identifier dryrun boolean optional parameter for stop instance hibernate boolean optional hibernates the instance if the instance was enabled for hibernation at launch force boolean optional forces the instances to stop input example {"instanceids" \["string"],"dryrun"\ true} output parameter type description stoppinginstances array output field stoppinginstances stoppinginstances currentstate object output field stoppinginstances currentstate stoppinginstances currentstate code number output field stoppinginstances currentstate code stoppinginstances currentstate name string name of the resource stoppinginstances instanceid string unique identifier stoppinginstances previousstate object output field stoppinginstances previousstate stoppinginstances previousstate code number output field stoppinginstances previousstate code stoppinginstances previousstate name string name of the resource output example {"stoppinginstances" \[{"currentstate" {},"instanceid" "string","previousstate" {}}]} update security group add or remove a security rule from an amazon aws ec2 security group, specifying direction, ports, protocol, and ip range endpoint method get input argument name type required description group id string required unique identifier ingress or egress string required parameter for update security group add or delete string required parameter for update security group from port number required parameter for update security group to port number required parameter for update security group ip protocol string required parameter for update security group cidr string required unique identifier description string optional parameter for update security group input example {"group id" "string","ingress or egress" "string","add or delete" "string","from port" 1234,"to port" 1234,"ip protocol" "string","cidr" "string","description" "string"} output parameter type description metadata string response data output example {"success"\ true} response headers header description example content type the media type of the resource application/json date the date and time at which the message was originated thu, 01 jan 2024 00 00 00 gmt