Fugue.AWS.S3.Bucket

Table of Contents

Module Members

external

(Function)

Create a reference to an externally managed bucket.

Example usage:

instance: S3.Bucket.external("example-bucket", AWS.Us-east-1)

Type Signature

 fun (String, Region) -> Bucket
Argument: name

The name of the target bucket.

Type: String

Argument: region

The Region containing the target bucket.

Type: Region

Returns:

A reference to the specified bucket.

Type: Bucket

new

(Function)

new S3 Bucket (Constructor)

This function is used to declare S3 buckets in Ludwig. Details on usage of the function are below.

S3 buckets in Fugue are well-supported, but there are two notes you should understand:

  • First, Fugue will not delete a bucket that is not empty. Furthermore, Fugue does not manage objects in buckets, so emptying the bucket is something you must use other tools for. This is easily accomplished with the AWS CLI using the rm command (http://docs.aws.amazon.com/cli/latest/reference/s3/rm.html).
  • Second, Fugue is constantly monitoring your infrastructure configuration, and therefore is continuously running describe calls against the Amazon API. If you enable S3 bucket logging on a Fugue-managed bucket, you will see evidence of these describe calls in your logs. This happens even when the process defining the bucket is suspended. An example of this message is shown below, but it is expected and harmless.
8650ecd37b258d45fe5d626f453ba1635a39564e2be3e2e33074079526359bdf username-example-bucket5 [22/Sep/2016:20:52:24 +0000] 127.0.0.1 arn:aws:sts::1234567890:assumed-role/fugue-FugueIam-10NJSEIQWRE2D/i-0b5f0bc18af370451 8EC7F75AB4967B17 REST.GET.BUCKETPOLICY - "GET /?policy HTTP/1.1" 200 - 165 - 6 - "-" "Botocore/1.4.51 Python/3.4.2 Linux/3.16.0-4-amd64" -
8650ecd37b258d45fe5d626f453ba1635a39564e2be3e2e33074079526359bdf username-example-bucket5 [22/Sep/2016:20:52:24 +0000] 127.0.0.1 arn:aws:sts::1234567890:assumed-role/fugue-FugueIam-10NJSEIQWRE2D/i-0b5f0bc18af370451 D621938E1BA58D64 REST.GET.CORS - "GET /?cors HTTP/1.1" 404 NoSuchCORSConfiguration 326 - 14 - "-" "Botocore/1.4.51 Python/3.4.2 Linux/3.16.0-4-amd64" -
8650ecd37b258d45fe5d626f453ba1635a39564e2be3e2e33074079526359bdf username-example-bucket5 [22/Sep/2016:20:52:25 +0000] 127.0.0.1 arn:aws:sts::1234567890:assumed-role/fugue-FugueIam-10NJSEIQWRE2D/i-0b5f0bc18af370451 3374EE958AD95AE4 REST.GET.LOGGING_STATUS - "GET /?logging HTTP/1.1" 200 - 530 - 116 - "-" "Botocore/1.4.51 Python/3.4.2 Linux/3.16.0-4-amd64" -
8650ecd37b258d45fe5d626f453ba1635a39564e2be3e2e33074079526359bdf username-example-bucket5 [22/Sep/2016:20:52:25 +0000] 127.0.0.1 arn:aws:sts::1234567890:assumed-role/fugue-FugueIam-10NJSEIQWRE2D/i-0b5f0bc18af370451 9E6158A656CB6B1C REST.GET.TAGGING - "GET /?tagging HTTP/1.1" 200 - 330 - 51 48 "-" "Botocore/1.4.51 Python/3.4.2 Linux/3.16.0-4-amd64" -
8650ecd37b258d45fe5d626f453ba1635a39564e2be3e2e33074079526359bdf username-example-bucket5 [22/Sep/2016:20:52:25 +0000] 127.0.0.1 arn:aws:sts::1234567890:assumed-role/fugue-FugueIam-10NJSEIQWRE2D/i-0b5f0bc18af370451 E15FCD02E435F356 REST.GET.WEBSITE - "GET /?website HTTP/1.1" 200 - 242 - 12 9 "-" "Botocore/1.4.51 Python/3.4.2 Linux/3.16.0-4-amd64" -

Example function usage:

import Fugue.AWS as AWS
import Fugue.AWS.S3 as S3

bucket: S3.Bucket.new {
  name: "example-bucket",
  region: AWS.Us-east-1,
}

Type Signature

 fun { name: String,
       region: Region,
       tags: Optional<List<Tag>>,
       acl: Optional<BucketCannedACL>,
       policy: Optional<String>,
       corsConfiguration: Optional<List<CORSRule>>,
       websiteConfiguration: Optional<WebsiteConfiguration>,
       loggingConfiguration: Optional<LoggingConfiguration>,
       notificationConfiguration: Optional<List<TargetConfiguration>> } -> Bucket
Argument: name

The name of the bucket. Must be unique across all of AWS. Must be between 3 and 63 characters in length. May contain lower case letters, numbers, hyphens and periods (.). A bucket name may not start or end with a period and there must be at least one other character between periods.

Type: String

Argument: region

The region in which the bucket is created.

Type: Region

Argument: tags

A list of AWS tags to apply to the bucket. Mutable.

Type: Optional<List<Tag>>

Argument: acl

The canned ACL to attach. See http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl for more information on canned ACLs. Mutable.

Type: Optional<BucketCannedACL>

Argument: policy

The bucket policy to attach. See Fugue.AWS.S3.Bucket.Policy for functions to help generate common policies. Mutable.

Type: Optional<String>

Argument: corsConfiguration

A list of CORS rules to apply to the bucket. Rules can be created via Fugue.AWS.S3.CORS.Rule.new. See http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html for more information on CORS and S3. Mutable.

Type: Optional<List<CORSRule>>

Argument: websiteConfiguration

The website configuration to apply to the bucket. Mutable.

Type: Optional<WebsiteConfiguration>

Argument: loggingConfiguration

The logging configuration to apply to the bucket. Mutable.

Type: Optional<LoggingConfiguration>

Argument: notificationConfiguration

the notification configuration to apply to the bucket. Mutable.

Type: Optional<List<TargetConfiguration>>

Returns:

A Bucket value.

Type: Bucket