Skip to content

Commit 2b2ecbf

Browse files
committed
Fixes geerlingguy#9: Add documentation on AWS CloudFormation setup.
1 parent a141ae8 commit 2b2ecbf

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,44 @@ Then, log into the site using the credentials:
5454

5555
> Alternatively, you can provide your own `--account-name`, `--account-email`, and `--account-pass`.
5656
57-
## Updating configuration
57+
## Updating Drupal site configuration
5858

5959
This site uses a full configuration export, and to update the site's configuration, you can run (from within the docroot):
6060

6161
drush --uri=local.d8pix.com cex -y
6262

6363
This should update the configuration as stored in `config/default`. Commit this new config, then test the configuration by reinstalling the site (to make sure the config works on a fresh install).
64+
65+
## AWS setup
66+
67+
To allow AWS Lambda to call back to your Drupal site (so faces and labels can be integrated with your media entities), you must have Drupal running on a publicly-accessible URL. Therefore before any of the AWS integration for Rekognition can be tested, make sure you're running an installation of this site on a server with a publicly-accessible URL.
68+
69+
After that, make sure you create a Drupal user account with permission to create and update nodes and taxonomy terms, then store that account's credentials for use by the Rekognition AWS Lambda function.
70+
71+
After you have a Drupal site installed, and the API user created, do the following to prepare your local workstation and AWS account for the Rekognition resources:
72+
73+
1. Install AWS CLI.
74+
1. Generate a 'programmatic access' AWS access key for an AWS IAM User with admin rights.
75+
1. Store the access key ID and secret in a location suitable for use with the AWS CLI.
76+
1. Create an S3 bucket named `drupal-lambda`, and upload a .zip archive containing the file `web/modules/contrib/rekognition_api/lambda/index.js`, after renaming the .zip archive to `drupal-media-rekognition.zip` (so the full S3 path is `s3://drupal-lambda/drupal-media-rekognition.zip`)
77+
78+
Now that you're workstation is ready, and the lambda code is in place, run the following command to deploy the required AWS resources via AWS CloudFormation:
79+
80+
aws cloudformation deploy \
81+
--region us-east-1 \
82+
--profile mm \
83+
--template-file web/modules/contrib/rekognition_api/lambda/DrupalMediaRekognition.yml \
84+
--stack-name drupal-media-rekognition \
85+
--capabilities CAPABILITY_NAMED_IAM \
86+
--parameter-overrides \
87+
DrupalUrl='http://www.example.com/' \
88+
DrupalUsername='rekognition-api-user' \
89+
DrupalPassword='secure-password-here'
90+
91+
After this operation completes, you should see a message like:
92+
93+
Successfully created/updated stack - drupal-media-rekognition
94+
95+
If you don't see that message, take a look in the AWS Console in the CloudFormation section, or use the AWS CLI to view detailed logs of what caused any issues.
96+
97+
TODO: Any other setup required?

composer.lock

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)