=== {eac}Doojigger Simple AWS Extension for WordPress ===
Plugin URI: https://eacdoojigger.earthasylum.com/eacsimpleaws/
Author: [EarthAsylum Consulting](https://www.earthasylum.com)
Stable tag: 1.1.1
Last Updated: 30-Jul-2025
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Requires EAC: 3.1
Contributors: kevinburkholder
Donate link: https://github.com/sponsors/EarthAsylum
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl.html
Tags: aws, amazon web services, AWS PHP SDK, S3 Bucket, EventBridge, {eac}Doojigger
WordPress URI: https://wordpress.org/plugins/eacsimpleaws
GitHub URI: https://github.com/EarthAsylum/eacSimplaAWS
Enables the AWS SDK for PHP; adds a Webhook for WooCommerce to write to an S3 bucket; adds a REST endpoint for EventBridge to post to WordPress.
== Description ==
= Simple AWS =
This extension, when enabled, provides easy access to Amazon Web Services (AWS) from other plugins, extensions and custom functions through the [AWS SDK for PHP](https://aws.amazon.com/sdk-for-php/).
From the settings page, enter your AWS Region and your IAM account credentials, then access AWS programmatically using the provided methods and filters along with the AWS SDK classes and methods.
Please review:
+ [Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
+ [Managing access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
= Available Methods =
`getAwsRegion()` returns your selected region
`getAwsAccessKey()` returns your access key
`getAwsAccessSecret()` returns your access secret
`getAwsCredentials()` returns a 'credentials' array with your key and secret
`getAwsClientParams()` returns an AWS client instantiation array
`getAwsEndpoints()` returns a (large) array of all AWS endpoint parameters
`getAwsRegions()` returns an array of all regions (name=>description)
`setAwsVersion()` override default ('latest') version
`setAwsRegion()` override set region
`setAwsEndPoint()` override default endpoint
= Available Filters =
`SimpleAWS_version` returns the AWS version string
`SimpleAWS_region` returns your selected region
`SimpleAWS_access_key` returns your access key
`SimpleAWS_access_secret` returns your access secret
`SimpleAWS_credentials` returns a 'credentials' array with your key and secret
`SimpleAWS_client_params` returns an AWS client instantiation array
`SimpleAWS_endpoints` returns a (large) array of all AWS endpoint parameters
`SimpleAWS_regions` returns an array of all regions (name=>description)
= Examples =
```php
$cloudFront = new Aws\CloudFront\CloudFrontClient([
'version' => 'latest',
'region' => apply_filters('SimpleAWS_region',''),
'credentials' => [
'key' => apply_filters('SimpleAWS_access_key',''),
'secret' => apply_filters('SimpleAWS_access_secret','')
]
]);
if ($aws = $this->getExtension('Simple_AWS')) {
$cloudFront = new Aws\CloudFront\CloudFrontClient([
'version' => 'latest',
'region' => $aws->getAwsRegion(),
'credentials' => $aws->getAwsCredentials(),
]);
}
if ($aws = eacDoojigger()->getExtension('Simple_AWS')) {
$cloudFront = new Aws\CloudFront\CloudFrontClient([
'version' => $aws->getAwsVersion(),
'region' => $aws->getAwsRegion(),
'credentials' => $aws->getAwsCredentials(),
]);
}
if ($aws = $this->getExtension('Simple_AWS')) {
$cloudFront = new Aws\CloudFront\CloudFrontClient(
$aws->getAwsClientParams()
);
}
if ($aws = eacDoojigger()->getExtension('Simple_AWS')) {
$cloudFront = new Aws\CloudFront\CloudFrontClient(
$aws->getAwsClientParams()
);
}
if ($aws = $this->plugin->getExtension('Simple_AWS')) {
if ($awsParams = $aws->getAwsClientParams()) {
try {
$s3client = new \Aws\S3\S3Client($awsParams);
$result = $s3client->createBucket([
'Bucket' => $bucketName,
]);
$result = $s3client->putObject([
'Bucket' => $bucketName,
'Key' => $fileName,
'Metadata' => $metadata,
'Body' => json_encode($payload,JSON_PRETTY_PRINT),
]);
}
catch (\AwsException $exception) {
$this->logError($exception,"AWS S3Client Error");
}
}
}
```
= Simple AWS S3 Events =
The *Simple AWS S3 Events* extension is intended to facilitate events through AWS EventBridge, passing data from and to WordPress/WooCommerce ... but you may find other uses.
1. A *webhook delivery URL* is created to be used by WooCommerce to send data (order, product, or coupon) as a file to an AWS S3 bucket.
2. An *EventBridge Target URL* is created to accepts data from AWS EventBridge derived from the file saved to the S3 bucket.
These 2 features may be used by the same WordPress installation (though I'm not sure why) or by different, even several, installations to route WooCommerce data to other destinations.
For example:
One or many WooCommerce sites can use the *WebHook Delivery URL* of another site to send orders through that site and then on to an S3 bucket as individual files.
EventBridge can be configured to deliver S3 files to one (or many) WordPress sites using the *EventBridge Target URL*.
This extension creates the APIs and formats the data to be sent to or received from AWS. To process data beyond what this extension does, you may use any of these actions:
```php
/**
* action _eventbridge_