// This module is included in the following assemblies:
// as_connecting-to-amazon-s3.adoc

[id='adding-s3-connection-finish_{context}']
= Adding data to Amazon S3 to finish an integration

To finish an integration by copying data to Amazon S3, 
add an Amazon S3 connection as a simple integration's finish connection. 

.Prerequisites
* You created an Amazon S3 connection.
* You are creating or editing a simple integration and {prodname} is prompting you
to choose a finish connection.  

.Procedure

. On the *Choose a  connection* page, click the Amazon S3 connection that
you want to use to finish the integration. 

. Select the action that you want the connection to perform:
+
* *Copy Object* adds one or more objects to the bucket. 
+
To add one file to the bucket, you can enter its name in the *File Name* field.
+
To add multiple files to the bucket, do not specify a file name.
In this case, the action adds all objects that it 
obtains from the previous integration step(s). 
+
If you used the poll action
to obtain multiple files and you specify a file name then the *Copy Object*
action adds only the last file that was received from the poll action. 

* *Delete Object* deletes an object from the bucket. In the
*File Name* field, specify the name of the object that you want to delete.
If the specified file is not in the bucket, the integration continues 
with no error. 

. After you configure the chosen action, click *Next* to specify 
the action's input type. 

. In the *Select Type* field, if the data type does not need to be known, 
accept *Type specification not required* 
and click *Next*. You do not need to follow the rest of these
instructions. 
+
However, a structured data type is recommended. For example, if you want 
to map the connection input in a data mapper step then you must specify 
the data type. The data mapper cannot display fields for unstructured data.
+
To specify the data type, click in the *Select Type* field and select one of the following as the schema type:
+
* *JSON schema* is a document that describes the structure of JSON data.
The document's media type is `application/schema+json`. 
* *JSON instance* is a document that contains JSON data. The document's 
media type is `application/json`. 
* *XML schema* is a document that describes the structure of XML data.
The document's file extension is `.xsd`.
* *XML instance* is a document that contains XML data. The
document's file extension is `.xml`. 
* *CSV instance* is a document that contains comma-separated value (CSV) data. The document's file extension is `.csv`. 
ifeval::["{location}" == "downstream"]
+
*Note* _Data Mapper support for CSV data is a Technology Preview feature only._
endif::[]

. In the *Definition* input box, paste a definition that conforms to the
schema type you selected. 
For example, if you select *JSON schema* then you would paste the content of
a JSON schema file, which has a media type of `application/schema+json`.

. In the *Data Type Name* field, enter a name that you choose for the
data type. For example, if you are specifying a JSON schema for
vendors then you might specify `*Vendor*` as the data type name. 
+
You will see this data type name when you are creating 
or editing an integration that uses the connection
for which you are specifying this type. {prodname} displays the type name
in the integration visualization and in the data mapper. 

. In the *Data Type Description* field, provide information that helps you
distinguish this type. This description appears in the data mapper when 
you hover over the step that processes this type. 
. Click *Next*. 

.Result
The connection appears at the end of the integration visualization. 
