The Amazon Web Services (AWS) Handler provides a simple and programmatic way to interact with AWS resources.
At a high level, the flow of actions is:
1. Initialize - It will read the AWS environment details from the Action Config values in the Synapse plan.
2. Execute - It will parse the incoming Action Parameter data, validate and interact with AWS accordingly. Result plan is returned upon completion. If a valid Extensible Stylesheet Language Transformation (XSLT) document is supplied, a transformed result will be returned instead.
3. Progress - It will advertise the run-time status.
The Config section of the plan specifies the one-to-one matching relationship between user-friendly profile names and actual AWS profiles.
|AwsEnvironmentProfile||Key-value pairs string array||Yes||The key name can be anything. The corresponding value must be an existing AWS profile handler has access to. Each AWS profile has its access id and secret key. See AWS Named Profiles for more information.|
The Parameter section specifies what a client should send in during run-time.
|Region||String||Yes||Specify the region AWS resources are located, e.g. eu-west-1, us-east-2. See AWS Regions and Endpoints for more information.|
|AwsEnvironmentProfile||String||Yes||Specify the AWS environment profile which must match one of the key names in AwsEnvironmentProfile from the Config section.|
|Action||String||No||Specify the action to be performed against the matching resources. Valid value supported is "none" at the moment.|
|Filters||Key-value pairs string array||Yes||Specify the filters used to search for the resources. Refer to EC2 Filter List for options available. Note that it is AND logic for all the filters but OR logic for each value in a filter. For example, the above examples instructs the handler to find all matching EC2s, which have tag "Cost Code" of value "xxxxxx" OR "yyyyyy" AND tag "Patch Group" of value "Quarterly" AND "instance-type" of value "t2.medium" AND "instance-state-name" of value "running".|
|ReturnFormat||string||Yes||Dynamic parameter. Valid values are "json", "xml" or "yaml".|
|Xslt||string||No||Specify the v1.0 XSLT to transform the raw handler response. Response will not be transformed if the value is null or empty.|
This test script can be modified to simulate a test request sent from client to Synapse to invoke the handler.
Handler response without any transformation contained in the
$result PowerShell variable may look like this in "xml" format.
After the raw response is transformed using the specified "xslt", it may look like this in "xml".
Or like this in "json".
Or like this in "yaml"