////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The AWS SNS transform enables you to send Notifications from a pipeline via AWS Simple Notification Service to subscribed users.

= image:transforms/icons/aws-sns.svg[Notify via AWS SNS, role="image-doc-icon"] AWS SNS Notify

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The AWS SNS Notify transform enables you to send notifications from an Apache Hop pipeline via Amazon Web Services Simple Notification Service to subscribed users.
|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Supported, 24]
!Flink! image:question_mark.svg[Supported, 24]
!Dataflow! image:question_mark.svg[Supported, 24]
!===
|===

== Preconditions

Before the first execution you need to create an IAM-Role (e.g. for usage on EC2/ECS) or an IAM-User with an AWS Key and Secret and attach the required policies for pushing notifications via SNS.

You also need to create one ore more subscription topics you want to push the messages to.

== Options

=== AWS Settings tab

[options="header", width="90%"]
|===
|option|description
|Use AWS Credentials chain|Apache Hop tries to pick up the AWS credentials from the host environment. For more information, check the https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html[Credentials] docs.
|AWS Access Key|your AWS Access Key (`AWS_ACCESS_KEY_ID`)
|AWS Secret Access Key|the secret for your AWS Access Key (`AWS_SECRET_ACCESS_KEY`)
|AWS Region|the AWS-Region the service is running in.
|===

=== Notifications

On the Notifications Tab you can define the behaviour when notifications will be send, the topicARN, the content and a Field for the MessageID.

[options="header", width="90%"]
|===
|Option|Description
|Event type
a| please choose whether a notifications should be send with:

* the first row (recommended)
* or for each row (be carefully not to spam your users!).
|Message ID| for each notification a Message-ID is retrieved from SNS. This can be written to an output field defined here.
|SNS-Fields table
a|**In the table only three rows** are valid (all others will be ignored an refused on save/load of transformation).

All rows can be specified either from a field (`Field` column) or as a static value (`Static value` column). Toggle between field or static value with the `Value in Field?` option.

** topicARN: the ARN for your SNS topic
** Subject: the subject for the notification you want to send
** Message: the message you want to send

|===
