Derived from API version 2006-03-01 of the AWS service descriptions, licensed under Apache 2.0. The types from this library are intended to be used with amazonka, which provides mechanisms for specifying AuthN/AuthZ information, sending requests, and receiving responses. It is recommended to use generic lenses or optics from packages such as generic-lens or optics to modify optional fields and deconstruct responses. Generated lenses can be found in Amazonka.S3.Lens and are suitable for use with a lens package such as lens or lens-family-core. See Amazonka.S3 and the AWS documentation to get started.


Keywords
cloud, distributed-computing, library, mpl, network, Propose Tags, amazonka, generic-lens, optics, Amazonka.S3.Lens, lens, lens-family-core, Amazonka.S3, AWS documentation, Skip to Readme, , Index, Quick Jump, Amazonka.S3.AbortMultipartUpload, Amazonka.S3.CompleteMultipartUpload, Amazonka.S3.CopyObject, Amazonka.S3.CreateBucket, Amazonka.S3.CreateMultipartUpload, Amazonka.S3.DeleteBucket, Amazonka.S3.DeleteBucketAnalyticsConfiguration, Amazonka.S3.DeleteBucketCors, Amazonka.S3.DeleteBucketEncryption, Amazonka.S3.DeleteBucketIntelligentTieringConfiguration, Amazonka.S3.DeleteBucketInventoryConfiguration, Amazonka.S3.DeleteBucketLifecycle, Amazonka.S3.DeleteBucketMetricsConfiguration, Amazonka.S3.DeleteBucketOwnershipControls, Amazonka.S3.DeleteBucketPolicy, Amazonka.S3.DeleteBucketReplication, Amazonka.S3.DeleteBucketTagging, Amazonka.S3.DeleteBucketWebsite, Amazonka.S3.DeleteObject, Amazonka.S3.DeleteObjectTagging, Amazonka.S3.DeleteObjects, Amazonka.S3.DeletePublicAccessBlock, Amazonka.S3.GetBucketAccelerateConfiguration, Amazonka.S3.GetBucketAcl, Amazonka.S3.GetBucketAnalyticsConfiguration, Amazonka.S3.GetBucketCors, Amazonka.S3.GetBucketEncryption, Amazonka.S3.GetBucketIntelligentTieringConfiguration, Amazonka.S3.GetBucketInventoryConfiguration, Amazonka.S3.GetBucketLifecycleConfiguration, Amazonka.S3.GetBucketLocation, Amazonka.S3.GetBucketLogging, Amazonka.S3.GetBucketMetricsConfiguration, Amazonka.S3.GetBucketNotificationConfiguration, Amazonka.S3.GetBucketOwnershipControls, Amazonka.S3.GetBucketPolicy, Amazonka.S3.GetBucketPolicyStatus, Amazonka.S3.GetBucketReplication, Amazonka.S3.GetBucketRequestPayment, Amazonka.S3.GetBucketTagging, Amazonka.S3.GetBucketVersioning, Amazonka.S3.GetBucketWebsite, Amazonka.S3.GetObject, Amazonka.S3.GetObjectAcl, Amazonka.S3.GetObjectAttributes, Amazonka.S3.GetObjectLegalHold, Amazonka.S3.GetObjectLockConfiguration, Amazonka.S3.GetObjectRetention, Amazonka.S3.GetObjectTagging, Amazonka.S3.GetObjectTorrent, Amazonka.S3.GetPublicAccessBlock, Amazonka.S3.HeadBucket, Amazonka.S3.HeadObject, Amazonka.S3.Internal, Amazonka.S3.ListBucketAnalyticsConfigurations, Amazonka.S3.ListBucketIntelligentTieringConfigurations, Amazonka.S3.ListBucketInventoryConfigurations, Amazonka.S3.ListBucketMetricsConfigurations, Amazonka.S3.ListBuckets, Amazonka.S3.ListMultipartUploads, Amazonka.S3.ListObjectVersions, Amazonka.S3.ListObjects, Amazonka.S3.ListObjectsV2, Amazonka.S3.ListParts, Amazonka.S3.PutBucketAccelerateConfiguration, Amazonka.S3.PutBucketAcl, Amazonka.S3.PutBucketAnalyticsConfiguration, Amazonka.S3.PutBucketCors, Amazonka.S3.PutBucketEncryption, Amazonka.S3.PutBucketIntelligentTieringConfiguration, Amazonka.S3.PutBucketInventoryConfiguration, Amazonka.S3.PutBucketLifecycleConfiguration, Amazonka.S3.PutBucketLogging, Amazonka.S3.PutBucketMetricsConfiguration, Amazonka.S3.PutBucketNotificationConfiguration, Amazonka.S3.PutBucketOwnershipControls, Amazonka.S3.PutBucketPolicy, Amazonka.S3.PutBucketReplication, Amazonka.S3.PutBucketRequestPayment, Amazonka.S3.PutBucketTagging, Amazonka.S3.PutBucketVersioning, Amazonka.S3.PutBucketWebsite, Amazonka.S3.PutObject, Amazonka.S3.PutObjectAcl, Amazonka.S3.PutObjectLegalHold, Amazonka.S3.PutObjectLockConfiguration, Amazonka.S3.PutObjectRetention, Amazonka.S3.PutObjectTagging, Amazonka.S3.PutPublicAccessBlock, Amazonka.S3.RestoreObject, Amazonka.S3.SelectObjectContent, Amazonka.S3.Types, Amazonka.S3.Types.AbortIncompleteMultipartUpload, Amazonka.S3.Types.AccelerateConfiguration, Amazonka.S3.Types.AccessControlPolicy, Amazonka.S3.Types.AccessControlTranslation, Amazonka.S3.Types.AnalyticsAndOperator, Amazonka.S3.Types.AnalyticsConfiguration, Amazonka.S3.Types.AnalyticsExportDestination, Amazonka.S3.Types.AnalyticsFilter, Amazonka.S3.Types.AnalyticsS3BucketDestination, Amazonka.S3.Types.AnalyticsS3ExportFileFormat, Amazonka.S3.Types.ArchiveStatus, Amazonka.S3.Types.Bucket, Amazonka.S3.Types.BucketAccelerateStatus, Amazonka.S3.Types.BucketCannedACL, Amazonka.S3.Types.BucketLifecycleConfiguration, Amazonka.S3.Types.BucketLoggingStatus, Amazonka.S3.Types.BucketLogsPermission, Amazonka.S3.Types.BucketVersioningStatus, Amazonka.S3.Types.CORSConfiguration, Amazonka.S3.Types.CORSRule, Amazonka.S3.Types.CSVInput, Amazonka.S3.Types.CSVOutput, Amazonka.S3.Types.Checksum, Amazonka.S3.Types.ChecksumAlgorithm, Amazonka.S3.Types.ChecksumMode, Amazonka.S3.Types.CommonPrefix, Amazonka.S3.Types.CompletedMultipartUpload, Amazonka.S3.Types.CompletedPart, Amazonka.S3.Types.CompressionType, Amazonka.S3.Types.Condition, Amazonka.S3.Types.ContinuationEvent, Amazonka.S3.Types.CopyObjectResult, Amazonka.S3.Types.CopyPartResult, Amazonka.S3.Types.CreateBucketConfiguration, Amazonka.S3.Types.DefaultRetention, Amazonka.S3.Types.Delete, Amazonka.S3.Types.DeleteMarkerEntry, Amazonka.S3.Types.DeleteMarkerReplication, Amazonka.S3.Types.DeleteMarkerReplicationStatus, Amazonka.S3.Types.DeletedObject, Amazonka.S3.Types.Destination, Amazonka.S3.Types.EncodingType, Amazonka.S3.Types.Encryption, Amazonka.S3.Types.EncryptionConfiguration, Amazonka.S3.Types.EndEvent, Amazonka.S3.Types.ErrorDocument, Amazonka.S3.Types.Event, Amazonka.S3.Types.EventBridgeConfiguration, Amazonka.S3.Types.ExistingObjectReplication, Amazonka.S3.Types.ExistingObjectReplicationStatus, Amazonka.S3.Types.ExpirationStatus, Amazonka.S3.Types.ExpressionType, Amazonka.S3.Types.FileHeaderInfo, Amazonka.S3.Types.FilterRule, Amazonka.S3.Types.FilterRuleName, Amazonka.S3.Types.GetObjectAttributesParts, Amazonka.S3.Types.GlacierJobParameters, Amazonka.S3.Types.Grant, Amazonka.S3.Types.Grantee, Amazonka.S3.Types.IndexDocument, Amazonka.S3.Types.Initiator, Amazonka.S3.Types.InputSerialization, Amazonka.S3.Types.IntelligentTieringAccessTier, Amazonka.S3.Types.IntelligentTieringAndOperator, Amazonka.S3.Types.IntelligentTieringConfiguration, Amazonka.S3.Types.IntelligentTieringFilter, Amazonka.S3.Types.IntelligentTieringStatus, Amazonka.S3.Types.InventoryConfiguration, Amazonka.S3.Types.InventoryDestination, Amazonka.S3.Types.InventoryEncryption, Amazonka.S3.Types.InventoryFilter, Amazonka.S3.Types.InventoryFormat, Amazonka.S3.Types.InventoryFrequency, Amazonka.S3.Types.InventoryIncludedObjectVersions, Amazonka.S3.Types.InventoryOptionalField, Amazonka.S3.Types.InventoryS3BucketDestination, Amazonka.S3.Types.InventorySchedule, Amazonka.S3.Types.JSONInput, Amazonka.S3.Types.JSONOutput, Amazonka.S3.Types.JSONType, Amazonka.S3.Types.LambdaFunctionConfiguration, Amazonka.S3.Types.LifecycleExpiration, Amazonka.S3.Types.LifecycleRule, Amazonka.S3.Types.LifecycleRuleAndOperator, Amazonka.S3.Types.LifecycleRuleFilter, Amazonka.S3.Types.LoggingEnabled, Amazonka.S3.Types.MFADelete, Amazonka.S3.Types.MFADeleteStatus, Amazonka.S3.Types.MetadataDirective, Amazonka.S3.Types.MetadataEntry, Amazonka.S3.Types.Metrics, Amazonka.S3.Types.MetricsAndOperator, Amazonka.S3.Types.MetricsConfiguration, Amazonka.S3.Types.MetricsFilter, Amazonka.S3.Types.MetricsStatus, Amazonka.S3.Types.MultipartUpload, Amazonka.S3.Types.NoncurrentVersionExpiration, Amazonka.S3.Types.NoncurrentVersionTransition, Amazonka.S3.Types.NotificationConfiguration, Amazonka.S3.Types.NotificationConfigurationFilter, Amazonka.S3.Types.Object, Amazonka.S3.Types.ObjectAttributes, Amazonka.S3.Types.ObjectCannedACL, Amazonka.S3.Types.ObjectIdentifier, Amazonka.S3.Types.ObjectLockConfiguration, Amazonka.S3.Types.ObjectLockEnabled, Amazonka.S3.Types.ObjectLockLegalHold, Amazonka.S3.Types.ObjectLockLegalHoldStatus, Amazonka.S3.Types.ObjectLockMode, Amazonka.S3.Types.ObjectLockRetention, Amazonka.S3.Types.ObjectLockRetentionMode, Amazonka.S3.Types.ObjectLockRule, Amazonka.S3.Types.ObjectOwnership, Amazonka.S3.Types.ObjectPart, Amazonka.S3.Types.ObjectStorageClass, Amazonka.S3.Types.ObjectVersion, Amazonka.S3.Types.ObjectVersionStorageClass, Amazonka.S3.Types.OutputLocation, Amazonka.S3.Types.OutputSerialization, Amazonka.S3.Types.Owner, Amazonka.S3.Types.OwnerOverride, Amazonka.S3.Types.OwnershipControls, Amazonka.S3.Types.OwnershipControlsRule, Amazonka.S3.Types.ParquetInput, Amazonka.S3.Types.Part, Amazonka.S3.Types.Payer, Amazonka.S3.Types.Permission, Amazonka.S3.Types.PolicyStatus, Amazonka.S3.Types.Progress, Amazonka.S3.Types.ProgressEvent, Amazonka.S3.Types.Protocol, Amazonka.S3.Types.PublicAccessBlockConfiguration, Amazonka.S3.Types.QueueConfiguration, Amazonka.S3.Types.QuoteFields, Amazonka.S3.Types.RecordsEvent, Amazonka.S3.Types.Redirect, Amazonka.S3.Types.RedirectAllRequestsTo, Amazonka.S3.Types.ReplicaModifications, Amazonka.S3.Types.ReplicaModificationsStatus, Amazonka.S3.Types.ReplicationConfiguration, Amazonka.S3.Types.ReplicationRule, Amazonka.S3.Types.ReplicationRuleAndOperator, Amazonka.S3.Types.ReplicationRuleFilter, Amazonka.S3.Types.ReplicationRuleStatus, Amazonka.S3.Types.ReplicationStatus, Amazonka.S3.Types.ReplicationTime, Amazonka.S3.Types.ReplicationTimeStatus, Amazonka.S3.Types.ReplicationTimeValue, Amazonka.S3.Types.RequestCharged, Amazonka.S3.Types.RequestPayer, Amazonka.S3.Types.RequestPaymentConfiguration, Amazonka.S3.Types.RequestProgress, Amazonka.S3.Types.RestoreRequest, Amazonka.S3.Types.RestoreRequestType, Amazonka.S3.Types.RoutingRule, Amazonka.S3.Types.S3KeyFilter, Amazonka.S3.Types.S3Location, Amazonka.S3.Types.S3ServiceError, Amazonka.S3.Types.SSEKMS, Amazonka.S3.Types.SSES3, Amazonka.S3.Types.ScanRange, Amazonka.S3.Types.SelectObjectContentEventStream, Amazonka.S3.Types.SelectParameters, Amazonka.S3.Types.ServerSideEncryption, Amazonka.S3.Types.ServerSideEncryptionByDefault, Amazonka.S3.Types.ServerSideEncryptionConfiguration, Amazonka.S3.Types.ServerSideEncryptionRule, Amazonka.S3.Types.SourceSelectionCriteria, Amazonka.S3.Types.SseKmsEncryptedObjects, Amazonka.S3.Types.SseKmsEncryptedObjectsStatus, Amazonka.S3.Types.Stats, Amazonka.S3.Types.StatsEvent, Amazonka.S3.Types.StorageClass, Amazonka.S3.Types.StorageClassAnalysis, Amazonka.S3.Types.StorageClassAnalysisDataExport, Amazonka.S3.Types.StorageClassAnalysisSchemaVersion, Amazonka.S3.Types.Tag, Amazonka.S3.Types.Tagging, Amazonka.S3.Types.TaggingDirective, Amazonka.S3.Types.TargetGrant, Amazonka.S3.Types.Tier, Amazonka.S3.Types.Tiering, Amazonka.S3.Types.TopicConfiguration, Amazonka.S3.Types.Transition, Amazonka.S3.Types.TransitionStorageClass, Amazonka.S3.Types.Type, Amazonka.S3.Types.VersioningConfiguration, Amazonka.S3.Types.WebsiteConfiguration, Amazonka.S3.UploadPart, Amazonka.S3.UploadPartCopy, Amazonka.S3.Waiters, Amazonka.S3.WriteGetObjectResponse, amazonka-s3-2.0.tar.gz, browse, Package description, Package maintainers, BrendanHay, edit package information , Version, Description, Contribute, Licence, Hackage, AWS API Reference, the AWS documentation, here on GitHub, Mozilla Public License Version 2.0, aws, haskell
License
MPL-2.0
Install
cabal install amazonka-s3-2.0

Documentation

Amazonka

MPL2 Hackage Build

An Amazon Web Services SDK for Haskell with support for most public services. Parts of the code contained in this repository are auto-generated and automatically kept up to date with Amazon's latest service APIs.

  • You can find the latest Haddock documentation for each respective library on the Amazonka website.
  • A release changelog can be found in lib/amazonka/CHANGELOG.md.
  • For problems, comments, or feedback please create an issue here on GitHub.

Table of Contents

License

Amazonka is licensed under the Mozilla Public License Version 2.0.

The AWS service descriptions are licensed under Apache 2.0. Source files derived from the service descriptions contain an additional licensing clause in their header.

Directory Layout

This repository is organised under the following directory structure:

  • lib/amazonka: The main library containing setup, authentication, and send logic. This will be your primary dependency.
  • lib/service/amazonka-*: A library per supported Amazon Web Service, you'll need to add a dependency on each selected service library.
  • lib/amazonka-core: The amazonka-core library upon which each of the services depends.
  • lib/amazonka-test: Common test functionality.
  • examples: Basic examples for using the service libraries.
  • configs: Service configuration, templates, and assets used by the code generator.
  • docs: The documentation website.
  • gen: The code and configuration generators.
  • scripts: Scripts to manage the project, such as the release lifecycle.

Supported Platforms and GHC Versions

GHC versions 9.0.*, 9.4.* and 9.6.* are officially supported and tested on NixOS, Ubuntu, and macOS. Earlier or later versions of GHC may also work, but only the aforementioned versions are tested by our continuous integration pipeline.

Getting Started

This repository is built using a combination of Nix and Cabal. If you're just using Amazonka as a git dependency in your Cabal or Stack project, you can skip the following steps and read Amazonka as a Git dependency. But if you plan on contributing to the codebase - welcome, read on!

1. Clone this repository

git clone git@github.com:brendanhay/amazonka.git
cd amazonka

2. Setup Nix

Building the code in this repository requires various development dependencies that are obtained and built via the Nix package manager in a reproducible and hermetic environment. You can install Nix by following the official installation instructions:

sh <(curl -L https://nixos.org/nix/install) --daemon

Once Nix is setup, you can enable the cache to avoid building dependencies:

nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use amazonka

A flake.nix is provided which will require your Nix configuration to enable flake support if you haven't done so already.

Edit either ~/.config/nix/nix.conf or /etc/nix/nix.conf and add:

experimental-features = nix-command flakes

If the Nix installation is in multi-user mode, don’t forget to restart the nix-daemon.

3. Enter a Nix Shell

The build tools are installed and activated upon entering a Nix shell, which is achieved by running the following command in the root of the repository:

nix develop

You can also enter a shell and by specifying one of the GHC versions declared by flake.nix, which can be inspected by running:

nix flake show
...
└───<system>
    β”œβ”€β”€β”€default: development environment 'amazonka-ghc944'
    β”œβ”€β”€β”€ghc810:  development environment 'amazonka-ghc8107'
    β”œβ”€β”€β”€ghc90:   development environment 'amazonka-ghc902'
    β”œβ”€β”€β”€ghc92:   development environment 'amazonka-ghc927'
    β”œβ”€β”€β”€ghc94:   development environment 'amazonka-ghc944'
    └───ghc96:   development environment 'amazonka-ghc961'

And then running nix develop for the desired version from the attribute list above:

nix develop '.#ghc90'

Note: the naming pattern for shells follows the GHC major versions available in nixpkgs. This means the minor versions will increment automatically as the flake.lock is updated.

If you have Direnv installed you can use the provided .envrc to automatically enter the default nix develop, which will also add the scripts directory to your PATH. You can extend this by adding your own uncommitted .envrc.local file. See the Direnv Wiki for various recipes.

Building the Project

The following commands assume you're already in a nix shell outlined in the previous step.

Once you've entered a Nix shell you can build amazonka-* packages via:

cabal build amazonka amazonka-s3

Or the entire project (which will take a very long time!):

cabal build all

Running the Code Generator

The gen package contain a code generator for synthesising Haskell data types, packages, and configuration from the botocore service definitions.

scripts/generate will run the code generator for all services configured in config/services, for example:

./scripts/generate

Or, you can selectively run the generator on one or more services:

./scripts/generate ec2 s3 iam

To update the botocore service definitions used by the generator, you can run:

./scripts/update-botocore

scripts/generate-configs will run the config generator to produce placeholder config/services configurations for any botocore services.

To generate configurations for any new/missing services:

./scripts/generate-configs

Service configurations generated in this way are intended as examples only and the resulting configs/services/<name>.json:libraryName (Haskell package name) and configs/annexes/<name>.json:serviceAbbreviation (Haskell package namespace) should be manually verified and curated as necessary.

For pull requests which affect generated output please do not include the regenerated amazonka-* packages, only commit updates to the build rules, documentation, generator, and related configuration. This is to make code review more manageable by focusing pertinent changes such as configuration and logic changes in pull requests and designates the maintainers and Continuous Integration as the source of truth for the generated code.

Amazonka as a Git Dependency

If there are as-yet-unreleased features or fixes that have yet to make it to Hackage, you can use the main (or another) development branch by declaring Amazonka as a Git dependency by following the Cabal or Stack instructions below.

Note: amazonka-core is a required dependency of the main amazonka package, in addition to amazonka-sts and amazonka-sso for sts:AssumeRoleWithWebIdentity and SSO via AWS IAM Identity Center, respectively. These required dependencies can then be supplemented by any additional service libraries you use from lib/services/amazonka-<service>.

Cabal

To add Amazonka as a Git dependency to your Cabal project, you will need to add a source-repository-package section for amazonka to your cabal.project file:

-- For amazonka
-- Multiple subdirs in a single `source-repository-package` stanza are supported by cabal-install >= 3.2.0.0.
source-repository-package
    type: git
    location: https://github.com/brendanhay/amazonka
    tag: <current revision of the `main` branch>
    subdir: lib/amazonka lib/amazonka-core lib/services/amazonka-sso lib/services/amazonka-sts lib/services/amazonka-<service>

Stack

Stack users should add an extra-deps: stanza to their stack.yaml:

extra-deps:
- github: brendanhay/amazonka
  commit: <current revision of the `main` branch>
  subdirs:
  - lib/amazonka
  - lib/amazonka-core
  - lib/services/amazonka-sso
  - lib/services/amazonka-sts
  - lib/services/amazonka-<service>

Haskell.nix + Stack

Stack users who also use haskell.nix will need to configure haskell.nix to fetch Amazonka commits from a specific git branch/rev by using the branchMap parameter:

pkgs.haskell-nix.project {
  branchMap = {
    "https://github.com/brendanhay/amazonka" = {
      "<git-commit-sha>" = "main";
    };
  };

  ...
}

Code Formatting

Provided automatically by the pre-commit hooks configured in flake.nix --- please use nix develop.

Third Party Packages

When naming an additional library which provides supplemental functionality to amazonka, if you want to use the amazonka-* namespace, then please consider prefixing your package names with amazonka-contrib-*. For example, amazonka-contrib-rds-utils.

This minimises potential future collisions with auto-generated package names and new AWS service and product releases.