Amazon AppFlow allows 3rd party developers and partners to author connectors and share them with other AppFlow users using AWS Marketplace. As a developer you can upload the Lambda as a “Container” product on AWS Marketplace to sell it to Amazon AppFlow customers or to share it for free. This guide provides the details on the development and publishing process.
Amazon AppFlow customers discover and subscribe to connectors of interest on AWS Marketplace. This section helps the connector developers to build and test custom connectors, and deploy them for integration testing with Amazon AppFlow. Summary of steps:
- Develop a custom connector.
- Create a new product in AWS Marketplace.
- Create Repository for your container.
- Test/Validate your connector.
- After you've completed the above steps, post your product onto AWS Marketplace.
Amazon AppFlow provides support for developing the connector for various SaaS applications in Java and Python.
Amazon AppFlow only supports the “Container” product type for publishing custom connectors on Marketplace. Creating a product in AWS Marketplace involves the following steps:
- Create the product ID. https://docs.aws.amazon.com/marketplace/latest/userguide/container-product-getting-started.html#create-initial-container-product
- Create the pricing details. https://docs.aws.amazon.com/marketplace/latest/userguide/container-product-getting-started.html#container-product-load-form Note : Amazon AppFlow only supports Free and Monthly subscription based model for pricing. It does not provide support for Custom/Hourly metering.
- For paid products, integrate metering into your product.
- To validate if the customer is entitled to use the paid product, you can add a validation in lambda to call the EntitlementUtil helper class provided with the SDK.
- To call the Entitlement checker you need to provide the ProductId as input.
- Instead of calling this entitlement check for every Lambda invocation, you are recommended to call it at a specific frequency of your choice from the Lambda code. e.g. once per hour or once per day
Once your request is approved from the AWS Marketplace for Limited use, proceed to the next step.
-
Select your product: Choose
Server
from theProducts
drop down tab of your AWS Marketplace Management Portal (https://4hs3rzdz.r.us-east-1.awstrack.me/L0/https:%2F%2Faws.amazon.com%2Fmarketplace%2Fmanagement%2Fhomepage/1/0100017c18e8d88e-e5c55f5d-9c02-4aea-aaf8-313d15621a11-000000/a08CntXX0hvPwR0OBuFAHEtxlLM=237) to go to the Server Products (https://4hs3rzdz.r.us-east-1.awstrack.me/L0/https:%2F%2Faws.amazon.com%2Fmarketplace%2Fmanagement%2Fproducts%2Fserver/1/0100017c18e8d88e-e5c55f5d-9c02-4aea-aaf8-313d15621a11-000000/dHlwBH29mAefqfiNc4YhN0Os4vo=237) page. Select your product using the corresponding radio button or by clicking its Title. -
Add repositories: From the
Request changes
drop down, chooseAdd repositories
to create repositories that you can then push your product’s resources into. -
Push images to your repository: On the
Add repositories
page, click onView existing repositories
to see all available repositories that were successfully added. Select the repository name, and chooseView push commands
to view instructions to push your container images and resources to the selected repository. Follow the steps provided below in *Packaging and uploading Marketplace connectors section below. -
Create a new version: On the
Products
page, select your product, and chooseAdd new version
to create a version of your product using the container images and resources that you added to the repository. -
Update product details: Select
Update product information
to edit the data that buyers will see when they select your product.
Note: Currently, AWS marketplace does not support the Lambda product types. So, it is your responsibility to provide the usage instructions to the users.
Please Follow the steps provided in Unit testing and Integration testing guidelines.
After completing all the previous steps, you can publish your product to make it visible to all AWS AppFlow customers. Follow the instructions in Publishing container products (https://docs.aws.amazon.com/marketplace/latest/userguide/container-product-getting-started.html#container-product-publishing) in the AWS Marketplace Seller Guide.
This section describes how to create and publish a container product with the required connector JAR files to AWS Marketplace.
Prerequisites:
- Setup AWS Command Line Interface (AWSCLI).
- Install Docker Engine.
Steps:
-
Create a DockerFile in your connector directory. You can use the DockerFile provided in the example.
FROM public.ecr.aws/lambda/python:3.8 #Copy function code COPY custom_connector_example ${LAMBDA_TASK_ROOT} COPY custom_connector_sdk ${LAMBDA_TASK_ROOT} COPY custom_connector_queryfilter ${LAMBDA_TASK_ROOT} #Install the function's dependencies using file requirements.txt from your project folder. COPY requirements.txt . RUN pip3 install -r ../requirements.txt --target "${LAMBDA_TASK_ROOT}" #Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "custom_connector_example.handlers.lambda_handler.salesforce_lambda_handler" ]
-
Build your docker image by using the following command.
docker build -t salesforcepaid .
-
Authenticate to the registry created from step 2.4a.
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com (http://aws_account_id.dkr.ecr.region.amazonaws.com/)
-
Tag the image to push to repository.
docker tag hello-world:1.0 aws_account_id.dkr.ecr.us-east-1.amazonaws.com/hello-world:1.0
-
Push the image
docker push aws_account_id.dkr.ecr.us-east-1.amazonaws.com/hello-world:1.0
-
Validate the image is created in ECR or not.
aws ecr describe-images --registry-id 709825985650 --repository-name test-product/salesforcepaid —region us-east-1
Ensure you have installed the latest version of the AWS CLI and Docker. For more information, see ECR documentation
For macOS or Linux systems, use the AWS CLI:
aws ecr get-login-password --region us-east-1 | docker login --username AWS —password-stdin 709825985650.dkr.ecr.us-east-1.amazonaws.com
For Windows systems, use AWS Tools for PowerShell:
Invoke-Expression -Command (Get-ECRLoginCommand -Region us-east-1 -RegistryId "709825985650").Command
Note: If you receive an 'Unknown options: -no-include-email' error when using the AWS CLI, ensure that you have the latest version installed.
docker pull 709825985650.dkr.ecr.us-east-1.amazonaws.com/test-product/salesforcejava:1.0 (http://709825985650.dkr.ecr.us-east-1.amazonaws.com/test-product/salesforcejava:1.0)
Step 3: Create an ECR repository in your account. Follow this to create repository https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html
docker tag $SOURCE_IMAGE:$VERSION $TARGET_IMAGE:$VERSION
aws ecr get-login-password --region AWS_REGION | docker login --username AWS --password-stdin AWS_ACCOUNT.dkr.ecr.AWS_REGION.amazonaws.com (http://aws_account.dkr.ecr.us-east-1.amazonaws.com/)
docker push docker push $TARGET_IMAGE:$VERSION
You are all set to use this Lambda Connector.