cloudfront:updateoriginbucket

Full name:

org.kuali.maven.plugins:maven-cloudfront-plugin:1.1.2-SNAPSHOT:updateoriginbucket

Description:

This mojo updates a bucket serving as an origin for a Cloud Front distribution. It generates an html directory listing for each "directory" in the bucket and stores the html under a key in the bucket such that a regular http request for a directory returns html. What would happen otherwise is XML for "object does not exist" would be returned by Amazon.

For example: The url "http://www.mybucket.com/foo/bar" will return an html page containing a listing of all the files and directories under "foo/bar" in the bucket.

If a directory contains an object with a key that is the same as the default object, the plugin copies the object to a key representing the directory structure.

For example, the url "http://www.mybucket.com/foo/bar/index.html" represents an object in an S3 bucket under the key "foo/bar/index.html". This plugin will copy the object from the key "foo/bar/index.html" to the key "foo/bar/". This causes the url "http://www.mybucket.com/foo/bar/" to return the same content as the url "http://www.mybucket.com/foo/bar/index.html"

It also generates an html directory listing at the root of the bucket hierarchy and places that html into the bucket as the default object, unless a default object already exists.

Attributes:

  • Requires a Maven project to be executed.

Required Parameters

Name Type Since Description
acl CannedAccessControlList - The default permissions for S3 objects created by this plugin
Default value is: PublicRead.
bucket String - The name of the bucket to update.
forceMojoExecution boolean - Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.
Default value is: false.

Optional Parameters

Name Type Since Description
accessKeyId String - Amazon AWS Access Key Id. See also serverId.
browseKey String - The html for browsing a directory will be created under this key
Default value is: browse.html.
cacheControl String - This controls the caching behavior for CloudFront. By default, CloudFront edge locations cache content from an S3 bucket for 24 hours. That interval is shortened to 1 hour for the html indexes generated by this plugin.
Default value is: max-age=3600, must-revalidate.
copyDefaultObjectWithDelimiter boolean - If true, "foo/bar/index.html" will get copied to "foo/bar/"
Default value is: true.
copyDefaultObjectWithoutDelimiter boolean - If true, "foo/bar/index.html" will get copied to "foo/bar". This is defaulted to false because the relative pathing in the html generated by the maven-site-plugin does not render correctly from a url without the trailing slash.
Default value is: false.
css String - The stylesheet to use for the directory listing
Default value is: http://s3browse.ks.kuali.org/css/style.css.
dateFormat String - When displaying the last modified timestamp use this format
Default value is: EEE, dd MMM yyyy HH:mm:ss z.
defaultObjectKey String - The key containing the default object for the Cloud Front distribution. If this object already exists, the plugin will not modify it. If it does not exist, this plugin will generate an html directory listing and place it into the bucket under this key.
Default value is: index.html.
delimiter String - The delimiter used to organize keys into a hierarchy.
Default value is: /.
directoryImage String - Image representing a directory
Default value is: http://s3browse.ks.kuali.org/images/folder.png.
encoding String - The encoding to use when reading/writing files. If not specified this defaults to the platform specific encoding of whatever machine the build is running on.
Default value is: ${project.build.sourceEncoding}.
fileImage String - Image representing a file
Default value is: http://s3browse.ks.kuali.org/images/page_white.png.
maxKeys Integer - Maximum number of keys to return per query.
orgPomGavs List - GAV strings representing organizational poms eg "org.kuali.pom:kuali" or "org.kuali.pom:kuali-common". Version is ignored, only groupId and artifactId are relevant.
organizationGroupId String - This parameter should represent the portion of the groupId that is implied by the hostname where content is published. For example, the Kuali Rice project has the groupId "org.kuali.rice" and content for the Kuali Rice project is published under "site.kuali.org/rice". The "org.kuali" portion of the groupId is implied from the hostname "site.kuali.org" and is thus removed when calculating the url in order to keep things a little more compact. If this parameter is not supplied, the complete groupId is used.
prefix String - Only update the bucket hierarchy underneath this prefix.
secretAccessKey String - Amazon AWS Secret Access Key. See also serverId.
serverId String - This is the id of the server from settings.xml containing Amazon AWS credentials.
skip boolean - When true, skip the execution of this mojo.
Default value is: false.
threads int - The max number of threads to use when making calls to S3
Default value is: 20.
timezone String - When displaying the last modified timestamp, use this timezone
Default value is: UTC.

Parameter Details

accessKeyId:

Amazon AWS Access Key Id. See also serverId.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.accessKeyId}

acl:

The default permissions for S3 objects created by this plugin
  • Type: com.amazonaws.services.s3.model.CannedAccessControlList
  • Required: Yes
  • Expression: ${cloudfront.acl}
  • Default: PublicRead

browseKey:

The html for browsing a directory will be created under this key
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.browseKey}
  • Default: browse.html

bucket:

The name of the bucket to update.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${cloudfront.bucket}

cacheControl:

This controls the caching behavior for CloudFront. By default, CloudFront edge locations cache content from an S3 bucket for 24 hours. That interval is shortened to 1 hour for the html indexes generated by this plugin.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.cacheControl}
  • Default: max-age=3600, must-revalidate

copyDefaultObjectWithDelimiter:

If true, "foo/bar/index.html" will get copied to "foo/bar/"
  • Type: boolean
  • Required: No
  • Expression: ${cloudfront.copyDefaultObjectWithDelimiter}
  • Default: true

copyDefaultObjectWithoutDelimiter:

If true, "foo/bar/index.html" will get copied to "foo/bar". This is defaulted to false because the relative pathing in the html generated by the maven-site-plugin does not render correctly from a url without the trailing slash.
  • Type: boolean
  • Required: No
  • Expression: ${cloudfront.copyDefaultObjectWithoutDelimiter}
  • Default: false

css:

The stylesheet to use for the directory listing
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.css}
  • Default: http://s3browse.ks.kuali.org/css/style.css

dateFormat:

When displaying the last modified timestamp use this format
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.dateFormat}
  • Default: EEE, dd MMM yyyy HH:mm:ss z

defaultObjectKey:

The key containing the default object for the Cloud Front distribution. If this object already exists, the plugin will not modify it. If it does not exist, this plugin will generate an html directory listing and place it into the bucket under this key.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.defaultObjectKey}
  • Default: index.html

delimiter:

The delimiter used to organize keys into a hierarchy.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.delimiter}
  • Default: /

directoryImage:

Image representing a directory
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.directoryImage}
  • Default: http://s3browse.ks.kuali.org/images/folder.png

encoding:

The encoding to use when reading/writing files. If not specified this defaults to the platform specific encoding of whatever machine the build is running on.
  • Type: java.lang.String
  • Required: No
  • Expression: ${encoding}
  • Default: ${project.build.sourceEncoding}

fileImage:

Image representing a file
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.fileImage}
  • Default: http://s3browse.ks.kuali.org/images/page_white.png

forceMojoExecution:

Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.
  • Type: boolean
  • Required: Yes
  • Expression: ${forceMojoExecution}
  • Default: false

maxKeys:

Maximum number of keys to return per query.
  • Type: java.lang.Integer
  • Required: No
  • Expression: ${cloudfront.maxKeys}

orgPomGavs:

GAV strings representing organizational poms eg "org.kuali.pom:kuali" or "org.kuali.pom:kuali-common". Version is ignored, only groupId and artifactId are relevant.
  • Type: java.util.List
  • Required: No

organizationGroupId:

This parameter should represent the portion of the groupId that is implied by the hostname where content is published. For example, the Kuali Rice project has the groupId "org.kuali.rice" and content for the Kuali Rice project is published under "site.kuali.org/rice". The "org.kuali" portion of the groupId is implied from the hostname "site.kuali.org" and is thus removed when calculating the url in order to keep things a little more compact. If this parameter is not supplied, the complete groupId is used.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.organizationGroupId}

prefix:

Only update the bucket hierarchy underneath this prefix.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.prefix}

secretAccessKey:

Amazon AWS Secret Access Key. See also serverId.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.secretAccessKey}

serverId:

This is the id of the server from settings.xml containing Amazon AWS credentials.
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.serverId}

skip:

When true, skip the execution of this mojo.
  • Type: boolean
  • Required: No
  • Default: false

threads:

The max number of threads to use when making calls to S3
  • Type: int
  • Required: No
  • Expression: ${cloudfront.threads}
  • Default: 20

timezone:

When displaying the last modified timestamp, use this timezone
  • Type: java.lang.String
  • Required: No
  • Expression: ${cloudfront.timezone}
  • Default: UTC