---
title: "Amazon S3 Deployment Handler"
description: "Efficiently manage Amazon S3 bucket deployments with robust package handling and seamless configuration settings. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/engine/deployment/deployment-handlers/s3"
---

# Amazon S3 Deployment Handler

Handles the deployment of one or more Deployment Packages to an Amazon S3 bucket.

The Amazon S3 bucket is described by:

```
accessKey
secretKey
region
bucketName
```

And optionally:

```
prefix    
```

The contents of the Deployment Packages will be deployed sequentially to the target location. If any of the content within the Deployment Packages fails to copy, it will simply be skipped. Other content objects will be allowed to proceed unabated.

## Configuration

```
{
    "accessKey": "{accessKey}",
    "secretKey": "{secretKey}",
    "region": "{region}",
    "bucketName": "{bucketName}",
    "prefix": "{prefix}"
}
```

The `prefix` setting is optional. All other settings are required.

## Mappings

The S3 Deployment handler respects the `f:deployment-config` feature if applied to a node. This feature lets you configure a set of `mappings` that determine how a node's JSON object and any binary attachments should be mapped down and written to disk.

The default mappings are:

```
[{
    "type": "object-to-file",
    "config": {
        "filepath": "/{{dependency.id}}/{{dependency.typeId}}.json"
    }
}, {
    "type": "attachment-to-file",
    "config": {
        "attachmentId": "*",
        "filepath": "/{{dependency.id}}/{{attachment.filename}}"
    }
]
```

These default mappings make it so that your Node's JSON is written to the bucket along with any of its attachments.

- Nodes are written to disk like this:
    
    {prefix}/{nodeId}/node.json
    
- Node attachments are written as well, like this:
    
    {prefix}/{nodeId}/attachments/{attachmentId}.{ext}
    
- Associations are written to disk like this:
    
    {prefix}/{associationId}/association.json
    
- Association attachments are written as well, like this:
    
    {prefix}/{associationId}/attachments/{attachmentId}.{ext}
    

## Example

```
{
    "accessKey": "AKIAZZZZZZZZZZZZZZZZ",
    "secretKey": "PlrNZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
    "region": "us-east-1",
    "bucketName": "publishedbucket",
    "prefix": "/static"
}
```
