Navigate to <CF_HOME>/cfusion/bin.
Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services (AWS) that provides object storage through a web service interface. Amazon S3 can be employed to store any type of object which allows for uses like storage for Internet applications, backup and recovery, disaster recovery, data archives, data lakes for analytics, and hybrid cloud storage.
Amazon S3 stores data as objects within buckets. An object consists of a file and optionally any metadata that describes that file.
To store an object in Amazon S3, you upload the file you want to store to a bucket. When you upload a file, you can set permissions on the object as well as any metadata.
Buckets are the roots for objects. You can have one or more buckets. For each bucket, you can control access to it (who can create, delete, and list objects in the bucket), view access logs for it and its objects, and choose the geographical region where Amazon S3 will store the bucket and its contents.
For more information, see Amazon S3 storage.
Amazon S3 storage service is used to store and retrieve any amount of data, at any time, from anywhere on the web. ColdFusion (2016 release) and ColdFusion (2018 release) supported this feature using tags and functions that take file or directory as input or output. In ColdFusion (2021 release), we’ve extended the feature further to support Multi-cloud service.
You can use S3 storage in the following scenarios:
Adobe ColdFusion (2021 release) is modularized, if you are only using the ZIP installer. By default, the module for AWS S3 is not installed. The first step is to install the S3 package in ColdFusion.
Note: If you are using the GUI installer, The package for S3 is called awss3.
The package for SNS is called awss3.
To install the package awss3, use the Package Manager page in the ColdFusion Administrator, or follow the steps below:
Navigate to <CF_HOME>/cfusion/bin.
Enter the command:
Enter the command, install awss3.
Wait for the AWS S3 package to get installed.
For more information, see ColdFusion Package Manager.
When you interact with AWS, you specify your AWS security credentials to verify your credentials and check whether you have permission to access the resources that you are requesting.
AWS uses the security credentials to authenticate and authorize your requests.
You must get the AWS Access Key ID and the AWS Secret Access Key. For more information, see Access Keys.
In ColdFusion (2021 release), there is a method getCloudService() that gives you a handle to create objects for accessing various cloud services.
The syntax of the service handle is as follows:
service=getCloudService(cloudCred,cloudConfig), where:
After you've acquired the AWS credentials, you must declare these credentials in one of the following ways. Only then you can use these credentials to create an S3 object, after which you can use the object to make calls to the various S3 methods.
You must store the result of getCloudService in a shared scope (for example, application scope) and re-use that object.
In the ColdFusion Administrator, click Data & Services > Cloud Credentials.
An alias is a named representation of a cloud service and its configuration details. You can set the config alias through ColdFusion Administrator.
After entering the details, click Add Credential.
In the ColdFusion Administrator, click Data & Services > Cloud Configuration.
Enter the following details, like configuration Alias, Vendor, and the name of the service.
After adding the configuration options, you may need to add a few more options. You can do so in the next screen. The following are a few options that you may need to add:
For more information, see Cloud configuration options.
Once you've created the aliases for S3 credential and configuration options, you can create the object by using the getCloudService API, and include the following in your CFM.
s3Object= getCloudService("s3Cred", "s3Conf")
You can specify the S3 credentials and configuration options in Application.cfc. For example,
component { this.name="S3_app"; void function onApplicationStart(){ application.awsCred = { "alias" : "aws_std_queue", "vendorName" : "AWS", "region" : "us-east-2", "secretAccessKey" : "xxxxxxxxxxxxxxxxx", "accessKeyId" : "xxxxxxxxxxxxxxxx" } application.s3Conf = { "serviceName" : "S3" } } }
s3Object = getCloudService(application.awsCred, application.s3Conf)
On a CFM page, you can specify the S3 credentials and configuration options in one of the four methods, specified below:
After you've created the aliases for S3 credential and configuration options, you can use these aliases in the getCloudService
handle as shown below:
<cfscript> // define the credential and the configuration aliases in the ColdFusion Admin s3=getCloudService("awsCred","s3Conf") // code below. ........... </cfscript>
<cfscript> // Using credential alias and struct for service config s3Conf = { "alias":"s3Conf", "serviceName" : "S3", "clientOverrideConfig":{ "retryPolicy":{ "numRetries":4 } }, "httpClientConfig":{ "maxConnections":50 } } s3= getCloudService("s3Cred", s3Conf) // code below ..................... </cfscript>
<cfscript> // Using config alias and struct for service credentials // s3 credentials s3Creds={ "vendorName":"AWS", "alias": "s3Cred", "region":"us-east-2", "accessKeyId": "access key", "secretAccessKey": "secret access" } s3= getCloudService(s3Creds, "s3Conf") // code below ..................................... </cfscript>
<cfscript> // Using Structs for both cloud credential and config s3Cred={ "vendorName":"AWS", "alias": "s3_cred_alias", "region":"us-east-2", "accessKeyId": "access key", "secretAccessKey": "secret access key" } s3Conf = { "alias":"s3_conf_alias", "serviceName" : "S3", "clientOverrideConfig":{ "retryPolicy":{ "numRetries":4 } }, "httpClientConfig":{ "maxConnections":50 } } sqs = getCloudService(s3Cred, s3Conf ) // code below ................................................................... </cfscript>
You can also add SQS credentials and configuration options by using the Admin APIs. The methods to add credentials and configuration are available in cloud.cfc.
The examples below demonstrate the usage of the methods addCredential(struct credential) and addServiceConfig(struct config).
<cfscript> // Create an object of administrator component and call the login method adminObj = createObject("component","cfide.adminapi.administrator") adminObj.login("admin") // Create an object of cloud component cloudObj = createObject("component","cfide.adminapi.cloud") // define credentials struct credentialStruct={ "alias" : "CredS3", "vendorName" : "AWS", "region" : "us-east-2", "secretAccessKey" : "secret access key", "accessKeyId" : "access key" } // add credential credentialStruct try{ cloudObj.addCredential(credentialStruct) writeOutput("Credentials added successfully") } catch(any e){ writeDump(e) } </cfscript>
<cfscript> // Create an object of administrator component and call the login method adminObj = createObject("component","cfide.adminapi.administrator") adminObj.login("admin") // Create an object of cloud component cloudObj = createObject("component","cfide.adminapi.cloud") // define configuration struct configStruct={ "alias":"ConfS3", "serviceName":"S3", "clientOverrideConfig":{ "retryPolicy":{ "numRetries":4 } }, "httpClientConfig":{ "maxConnections":50 } } // add config configStruct try{ cloudObj.addServiceConfig(configStruct) writeOutput("Configuration service added successfully") } catch(any e){ writeDump(e) } </cfscript>
You can also set up S3 credential and configuration via the CFSetup configuration utility.
Add cloud credential
Set credential
Add cloud configuration
Set configuration
Get the root object. If the root doesn't exist, the root gets created.
root(bucketname, createIfNotExists)
Parameter |
Description |
---|---|
bucketName |
The name of the bucket to be created. |
createIfNotExists |
True or False. If the bucket doesn't exist, it gets created. |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) try{ storageService.root("bucket.001","true") writeOutput("Bucket created successfully") } catch(any e){ writeDump(e) } </cfscript>
Get the root object with additional parameters.
createRoot(requestParameters)
Parameter |
Description |
---|---|
bucketName |
The name of the bucket to be created. |
objectLockEnabledForBucket |
Yes or No. Identifies if object lock is enabled for the bucket. For more information, see Object locks. |
acl |
Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
For more information, see ACLs in AWS. |
grant permission variables |
Permissions that Amazon S3 supports in an ACL. Valid values are:
For more information, see Permissions. |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.002", "objectLockEnabledForBucket" : true } // create a root myobj=storageService.createRoot(createBucketRequest) writeDump(myobj) </cfscript>
To upload your data to Amazon S3, you must get the bucket object in one of the AWS Regions. You can then upload any number of objects to the bucket.
For more information, see S3 buckets.
bucket(bucketName,createIfNotExists)
Parameter |
Description |
---|---|
bucketName |
The name of the bucket to be created. |
createIfNotExists |
True or False. If the bucket doesn't exist, it gets created. |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) try{ storageService.bucket("bucket.002","true") writeOutput("Bucket created successfully") } catch(any e){ writeDump(e) } </cfscript>
Create a bucket in S3 with additional parameters.
createBucket(parameterStruct)
Parameter |
Description |
---|---|
bucketName |
The name of the bucket to be created. |
objectLockEnabledForBucket |
Yes or No. Identifies if object lock is enabled for the bucket. For more information, see Object locks. |
acl |
Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
For more information, see ACLs in AWS. |
grant permission variables |
Permissions that Amazon S3 supports in an ACL. Valid values are:
For more information, see Permissions. |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // bucketList=storageService.listAll() // lists all buckets // writeDump(bucketList) // abort; createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.three.demo", "objectLockEnabledForBucket" : true } // create a bucket try{ myobj=storageService.createBucket(createBucketRequest) writeOutput("Bucket created successfully") writeDump(myobj) } catch (any e){ writeOutput("Failed to create the bucket") writeDump(e) } </cfscript>
You can get a list of buckets in storage account. You can also retrieve a list of objects inside the bucket.
listAll(parameterStruct)
listAll()
Parameter |
Description |
---|---|
delimiter |
Character to group keys. |
encodingType |
Encode the object keys in the response and specifies the encoding method to use. |
marker |
Key to start with when listing objects in a bucket. |
maxKeys |
The maximum number of keys returned in the response. |
prefix |
Limits the response to keys that begin with the specified prefix. |
requestpayer |
Confirms that the requester knows that he/she will be charged for the request. Valid value is REQUESTER. |
For more information, see request parameters.
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // lists all buckets bucketList=storageService.listAll() writeOutput("List of buckets") writeDump(bucketList) </cfscript>
You can delete an empty bucket, and when you're using the AWS Management Console, you can delete a bucket that contains objects. If you delete a bucket that contains objects, all the objects in the bucket are permanently deleted.
For more information, see DeleteObjects.
delete(parameterStruct)
delete(bucketName)
Parameter |
Description |
---|---|
bucketName |
The name of the bucket to delete. |
forcedDelete |
True or False. Force deletes a bucket that has obejcts in it. |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.name", "objectLockEnabledForBucket" : true } storageService.createBucket(createBucketRequest) // delete the bucket deleteBucketRequest = { "bucket" : "bucket.name", "forcedDelete" : "true" // default: false } try{ myobj=storageService.delete(deleteBucketRequest) writeOutput("Bucket deleted successfully") writeDump(myobj) } catch (any e){ writeOutput("Unable to delete the bucket") writeDump(e) } </cfscript>
You can upload a file to a bucket. In the function uploadFile, as argument, pass a struct with the following values:
For more information, see the official docs.
uploadFile(parameterStruct)
Parameter | Description | Required |
---|---|---|
srcFile |
The path of the file that you want to upload in the bucket. | Yes |
key |
Unique identifier of the object. | Yes |
acl |
The ACL to apply to the object. For more information, see Canned ACL.The valid values are:
|
No |
cacheControl |
Specify the caching behavior as defined here. | No |
contentDisposition |
Specify the content format of the object as defined here. | No |
contentEncoding |
Specify the type of encoding on the object as defined here. | No |
contentLanguage |
The language of the object that you want to upload. | No |
contentLength |
The size of the object in bytes. | No |
validateContentMD5 |
True or False. The base64-encoded 128-bit MD5 digest of the message (without the headers). |
No |
contentType |
The format of the content as defined here. | No |
expires |
The date and time when the object cannot be cached any longer. |
No |
grantFullControl |
Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. |
No |
grantRead |
Allows grantee to only read the object data. |
No |
grantWrite |
Allows grantee to write to the object data. |
No |
grantReadACP |
Allows grantee to read the object ACL. |
No |
grantWriteACP |
Allows grantee to write the ACL for the object. |
No |
metadata |
The object metadata to use. | No |
serverSideEncryption |
The server-side encryption algorithm to be used. |
No |
storageClass |
Valid values are:
For more information, see S3 storage class. |
No |
websiteRedirectLocation |
If the bucket is configured as a website, specify the redirect request to another object in the same bucket or to an external URL. |
No |
sseCustomerAlgorithm |
Specifies the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specifies the customer-provided encryption key for S3 to use in encrypting data. |
No |
ssekmsKeyId |
Specifies the ID of the AWS Key Management Service (AWS KMS). |
No |
ssekmsEncryptionContext |
Specifies the AWS KMS Encryption Context to use for object encryption. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
tagging |
The tag-set for the object. Must be a struct of key-value pairs. |
No |
objectLockMode |
The Object locking mode that you want to apply to this object. Valid values are:
|
No |
objectLockRetainUntilDate |
The date and time when you want this object's Object Lock to expire. |
No |
objectLockLegalHoldStatus |
Indicates whether the specified object has a Legal Hold in place.. Valid values are:
|
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) //writeOutput(ExpandPath('./')) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.name", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // upload an object uploadStruct = { "srcFile" : "#ExpandPath('./')#/file.txt", "key" : "key12", "metadata":{ "place":"London", "deployment":"Testing" } } try{ uploadResponse=bucketObj.uploadFile(uploadStruct) writeOutput("Object uploaded successfully") writeDump(uploadResponse) } catch (any e){ writeOutput("Could not upload the object") writeDump(e) } </cfscript>
You can download a file from an S3 bucket. To download a file, use the function downloadToFile. As an argument, pass a struct with the following values:
For more information, see the official docs.
downloadToFile(parameterStruct)
Parameter | Description | Required |
---|---|---|
destinationFile |
The path of the file that that contains the object, which you want to download. | Yes |
key |
Unique identifier of the object. | Yes |
cacheControl |
Set the cache control header of the object, | No |
contentDisposition |
Set the Content-Disposition header of the response. |
No |
contentEncoding |
Set the Content-Encoding header of the response. |
No |
contentLanguage |
Set the Content-Language header of the response. |
No |
contentType |
Set the Content-Type header of the response. |
No |
expires |
Sets the Response header of the response. |
No |
versionId |
Refer to a specific version of the object. | No |
sseCustomerAlgorithm |
Specify the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specify the customer-provided encryption key for S3 to use in encrypting data. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.four", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // upload an object uploadStruct = { "srcFile" : "#ExpandPath('./')#/file.txt", "key" : "key22", "metadata":{ "filename":"file.txt", "place":"bangalore", "category":"finance" } } bucketObj.uploadFile(uploadStruct) // download the file downloadStruct = { "destinationFile" : "file.txt", "key" : "key22" } try{ downloadResponse=bucketObj.downloadToFile(downloadStruct) writeOutput("Object downloaded successfully") writeDump(downloadResponse) } catch (any e){ writeOutput("Failed to download object") writeDump(e) } </cfscript>
You can copy an object from one bucket to another. All copy requests must be authenticated. Additionally, you must have read access to the source object and write access to the destination bucket.
For more information, see Copy objects.
copy(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
sourceBucket |
The bucket from where you want to copy the object. |
Yes |
sourceKey |
The key associated with the object. |
Yes |
sourceVersionId |
The version id that was associated with the object. |
No |
key |
The destination key of the object. |
Yes |
storageClass |
For more information, see S3 storage class.. Valid value is: GLACIAR. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create two buckets createBucketRequest1 = { "acl":"PRIVATE", "bucket" : "cf.source.bucket.1", "objectLockEnabledForBucket" : true } createBucketRequest2 = { "acl":"PRIVATE", "bucket" : "cf.dest.bucket.1", "objectLockEnabledForBucket" : true } // source bucket source_obj=storageService.createBucket(createBucketRequest1) // destination bucket dest_object=storageService.createBucket(createBucketRequest2) // upload file struct uploadStruct = { "srcFile" : "#ExpandPath('./')#/file.txt", "key" : "key12" } // upload file to source bucket uploadResponse=source_obj.uploadFile(uploadStruct) // copy file struct copyRequest = { "sourceBucket": "cf.source.bucket.1", "sourceKey" : "key12", "key" : "destKey" } copyResponse=dest_object.copy(copyRequest); objList=dest_object.listAll() writeDump(objList) </cfscript>
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
For more information, see Put bucket policy.
putPolicy(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
confirmRemoveSelfBucketAccess |
True or False. Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future. |
No |
policy |
The policy to be enforced for the bucket. For more information, see S3 policies. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) bucketList=storageService.listAll() //writeDump(bucketList) rootObj=storageService.bucket("bucket.policy","true") policy = { "Id": "Policy1571390473326", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1574139965216", "Action": [ "s3:GetBucketAcl" ], "Effect": "Allow", "Resource": "bucket.policy", "Principal": "*" } ] } policyRequest = { "policy" : policy } rootObj.putPolicy(policyRequest); writedump(rootObj.getPolicies()) </cfscript>
Delete a policy that was applied on a bucket.
For more information, see Delete bucket policy.
deletePolicies()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) bucketList=storageService.listAll() //writeDump(bucketList) rootObj=storageService.bucket("bucket.policy","true") policy = { "Id": "Policy1571390473326", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1574139965216", "Action": [ "s3:GetBucketAcl" ], "Effect": "Allow", "Resource": "bucket.policy", "Principal": "*" } ] } policyRequest = { "policy" : policy } rootObj.putPolicy(policyRequest); writedump(rootObj.getPolicies()) // delete policy deletePolicyResponse=rootObj.deletePolicies() writeDump(deletePolicyResponse) </cfscript>
Return the policy of a specified bucket.
For more information, see Get bucket policy.
getPolicies()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) bucketList=storageService.listAll() //writeDump(bucketList) rootObj=storageService.bucket("bucket.policy","true") policy = { "Id": "Policy1571390473326", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1574139965216", "Action": [ "s3:GetBucketAcl" ], "Effect": "Allow", "Resource": "bucket.policy", "Principal": "*" } ] } policyRequest = { "policy" : policy } rootObj.putPolicy(policyRequest); writedump(rootObj.getPolicies()) // delete policy deletePolicyResponse=rootObj.deletePolicies() writeDump(deletePolicyResponse) </cfscript>
Versioning is a means of keeping multiple variants of an object in the same bucket. You can use versioning to preserve, retrieve, and restore every version of every object stored in your Amazon S3 bucket. With versioning, you can easily recover from both unintended user actions and application failures.
In one bucket, for example, you can have two objects with the same key, but different version IDs.
AWS S3 Version: uploading objects in non-versioned and versioning-enabled buckets are the same, although, in the case of versioning-enabled buckets, Amazon S3 assigns a version number. Otherwise, the version number is null. Enabling and suspending versioning is done at the bucket level.
Set the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.
You can set the versioning state with one of the following values:
For more information, see Enable versioning.
enableVersioning(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
mfa |
The combination of the authentication device's serial number, a space, and the value that is displayed on your authentication device. The format of the mfa is: "mfa":"arn:aws:iam::0123456789:mfa/username" |
No |
mfaDelete |
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values are:
|
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getstatus", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // enable versioning bucketObj.enableVersioning() // get version status versionStatus=bucketObj.getVersioningStatus() writeDump(versionStatus) </cfscript>
Get the versioning state of a bucket.
getVersioningStatus()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getstatus", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // enable versioning bucketObj.enableVersioning() // get version status versionStatus=bucketObj.getVersioningStatus() writeDump(versionStatus) </cfscript>
Return metadata about all versions of the objects in a bucket.
For more information, see List object versions.
listAllVersions(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
delimiter |
Character to group keys. |
No |
encodingType |
Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. |
No |
marker |
The object version you want to start listing from. |
No |
maxKeys |
Sets the maximum number of keys returned in the response. |
No |
prefix |
Select only those keys that begin with the specified prefix. |
No |
keyMarker |
The key to start with when listing objects in a bucket. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.listversions", "objectLockEnabledForBucket" : true } // create a bucket myobj=storageService.createBucket(createBucketRequest) // define file upload structs uploadStruct1 = { "srcFile" : "#ExpandPath('./')#/file1.txt", "key" : "key1" } uploadStruct2 = { "srcFile" : "#ExpandPath('./')#/file2.txt", "key" : "key122" } uploadStruct3 = { "srcFile" : "#ExpandPath('./')#/file3.txt", "key" : "key123" } uploadStruct4 = { "srcFile" : "#ExpandPath('./')#/file1.txt", "key" : "key124" } uploadResponse1=myobj.uploadFile(uploadStruct1); uploadResponse2=myobj.uploadFile(uploadStruct2); uploadResponse3=myobj.uploadFile(uploadStruct3); uploadResponse4=myobj.uploadFile(uploadStruct4); listAllVersionsRequest={ "prefix" : "key12" } // list all versions listVersion=myobj.listAllVersions(listAllVersionsRequest) writeDump(listVersion) </cfscript>
Disable versioning for the objects in the bucket.
For more information, see Suspend versioning.
suspendVersioning(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
mfa |
The combination of the authentication device's serial number, a space, and the value that is displayed on your authentication device. The format of the mfa is: "mfa":"arn:aws:iam::0123456789:mfa/username" |
No |
mfaDelete |
Specifies whether MFA delete is enabled or disabled. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.suspendversioning", // to suspend versioning, turn off object locking for the bucket "objectLockEnabledForBucket" : false } // create a bucket myobj=storageService.createBucket(createBucketRequest) // enable versioning on the bucket myobj.enableVersioning(); // get the version status versionStatus1=myobj.getVersioningStatus(); writeDump(versionStatus1) // suspend the versioning myobj.suspendVersioning(); versionStatus2=myobj.getVersioningStatus(); writeDump(versionStatus2) </cfscript>
Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Each bucket and object have an ACL attached to it as a sub-resource. It defines which AWS accounts or groups are granted access and the type of access. When a request is received against a resource, Amazon S3 checks the corresponding ACL to verify that the requester has the necessary access permissions.
When you create a bucket or an object, Amazon S3 creates a default ACL that grants the resource owner full control over the resource.
For more information, see S3 ACL.
Set the permissions on an existing bucket using access control lists (ACL).
For more information, see Using ACLs.
To set the ACL of a bucket, you must have WRITE_ACP permission.
putBucketAcl(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
acl |
Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
For more information, see ACLs in AWS. |
No |
grant permission variables |
Permissions that Amazon S3 supports in an ACL. Valid values are:
For more information, see Permissions. |
No |
<cfscript> storageService = getCloudService(this.s3Cred,this.s3Conf) createBucketRequest1 = { "bucket" : "cfqa.003" } rootObj = storageService.createRoot(createBucketRequest1); putBucketAclRequest = { "acl" : "PRIVATE" } putBucketAclResponse=rootObj.putBucketAcl(putBucketAclRequest); writeDump(putBucketAclResponse) </cfscript>
Example with grant permissions.
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest1 = { "bucket" : "cfqa.003" } rootObj = storageService.createRoot(createBucketRequest1) putBucketAclRequest = { "grantFullControl": "emailAddress=john@example.com", // "grantFullControl": "id=f1db27629293ee8354a2874de1959b39bec20ffe98417b931fb381f97007cf97" "grantReadACP" : "uri=http://acs.amazonaws.com/groups/s3/LogDelivery" } putBucketAclResponse=rootObj.putBucketAcl(putBucketAclRequest); writeDump(putBucketAclResponse) </cfscript>
Use this function to get a list of ACLs in a bucket.
For more information, see the getBucketAcl official docs.
getBucketAcl()
<cfscript> storageService = getCloudService(this.s3Cred,this.s3Conf) createBucketRequest1 = { "bucket" : "cfqa.004", "grantFullControl": "uri=http://acs.amazonaws.com/groups/global/AuthenticatedUsers" } rootObj = storageService.createRoot(createBucketRequest1); getBucketAclResponse=rootObj.getBucketAcl() writeDump(getBucketAclResponse) </cfscript>
The function uses the ACL sub-resource to set the access control list (ACL) permissions for an object that already exists in a bucket.
In putObjectAcl, there is an extra attribute “key”: ”object_key” in the struct.
For more information, see the official docs.
putObjectAcl(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
acl |
Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
For more information, see ACLs in AWS. |
No |
grant permission variables |
Permissions that Amazon S3 supports in an ACL. Valid values are:
For more information, see Permissions. |
No |
key |
The key for the operation. |
Yes |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.putobjectacl.demo" } bucketObj = storageService.createBucket(createBucketRequest) // upload an object uploadStruct = { "srcFile" : "#ExpandPath('./')#/s3-notes.pdf", "key" : "key12" } bucketObj.uploadFile(uploadStruct) // put ACL on the object putObjectAclRequest = { "key" : "key12", "acl" : "PRIVATE" } try{ objectAclResponse=bucketObj.putObjectAcl(putObjectAclRequest) writeOutput("ACL applied successfully on the object") writeDump(objectAclResponse) } catch(any e){ writeOutput("Unable to apply ACL on the object") writeDump(e) } putObjectAclResponse=bucketObj.GetObjectAcl("key12") writeDump(putObjectAclResponse) </cfscript>
Return the access control list (ACL) of an object.
To use this operation, you must have READ_ACP access to the object.
getObjectAcl(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key of the object for which to get the ACL information. |
Yes |
versionId |
Refer to a specific version of the object. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.putobjectacl.demo" } bucketObj = storageService.createBucket(createBucketRequest) // upload an object uploadStruct = { "srcFile" : "#ExpandPath('./')#/s3-notes.pdf", "key" : "key12" } bucketObj.uploadFile(uploadStruct) // put ACL on the object putObjectAclRequest = { "key" : "key12", "acl" : "PRIVATE" } try{ objectAclResponse=bucketObj.putObjectAcl(putObjectAclRequest) writeOutput("ACL applied successfully on the object") writeDump(objectAclResponse) } catch(any e){ writeOutput("Unable to apply ACL on the object") writeDump(e) } putObjectAclResponse=bucketObj.getObjectAcl("key12") writeDump(putObjectAclResponse) </cfscript>
Lifecycle rule that defines how AWS s3 manages objects during their lifetime. There are two types of actions:
Define lifecycle configuration rules for objects that have a well-defined lifecycle. For example:
You can use setRules function to set lifecycle rules to objects in the bucket. The function accepts the following struct as argument.
"rules" : [ { "id" : "rule1", "prefix" : "a/b", "lifecycleRuleFilter" : { "prefix" : "", "tagging" : { "key": "", "value" : "" }, "lifecycleRuleAndOperator" : { "prefix" : "", "tagging" : [{ "key": "", "value" : "" }] } }, "status" : "ENABLED", "expiration" : { "date" : "YYYY-MM-DD", "days" : 3 }, "noncurrentVersionExpirationDays" : 30, "noncurrentVersionTransitions" : [ { "days" : 35, "storageClass" : "GLACIER" }], "abortIncompleteMultipartUploadInDays" : 7, "transitions" : [ { "days" : 90, "storageClass" : "ONEZONE_IA" } ] } ]
The following is not supported in ColdFusion (2021 release). It will be supported in a future update.
"lifecycleRuleFilter" : { "prefix" : "", "tagging" : { "key": "", "value" : "" }, "lifecycleRuleAndOperator" : { "prefix" : "", "tagging" : [{ "key": "", "value" : "" }] } }
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) deleteStruct = { "bucket" : "bucket.rule.append1", "forcedDelete" : "true" } // Adding lifecycle rules by specifying date // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.rule.four", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key114" } bucketObj.uploadFile(uploadStruct) exp_date=DateFormat(DateAdd("d",8,now()),"yyyy-mm-dd") trans_date=DateFormat(DateAdd("d",2,now()),"yyyy-mm-dd") ruleStruct = { "rules" : [{ "id" : "rule1", "prefix":"key", "status" : "ENABLED", "expiration" : { "date":exp_date }, "transitions" : [{ "date":trans_date, "storageClass" : "ONEZONE_IA" }] }] } try{ bucketObj.setRules(ruleStruct) writeOutput("Lifecycle rule set successfully") rules=bucketObj.getRules().rules writedump(rules) } catch(any e){ writeOutput("Unable to set lifecycle") writeDump(e) } </cfscript>
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.rule.three", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key112" } bucketObj.uploadFile(uploadStruct) ruleStruct={ "rules":[{ "id" : "rule1", "prefix":"key", "status" : "ENABLED", "noncurrentVersionTransitions" : [{ "days":30, "storageClass" : "INTELLIGENT_TIERING" }] }] } try{ bucketObj.setRules(ruleStruct) writeOutput("Lifecycle rule set successfully") //writeDump(setRuleResponse) // rules=bucketObj.getRules().rules // writedump(rules) } catch(any e){ writeOutput("Unable to set lifecycle") writeDump(e) } </cfscript>
You can use the method appendRules to add the rules to the existing set of rules. The function accepts the following struct as argument.
"rules" : [ { "id" : "rule1", "prefix" : "a/b", "lifecycleRuleFilter" : { "prefix" : "", "tagging" : { "key": "", "value" : "" }, "lifecycleRuleAndOperator" : { "prefix" : "", "tagging" : [{ "key": "", "value" : "" }] } }, "status" : "ENABLED", "expiration" : { "date" : "YYYY-MM-DD", "days" : 3 }, "noncurrentVersionExpirationDays" : 30, "noncurrentVersionTransitions" : [ { "days" : 35, "storageClass" : "GLACIER" }], "abortIncompleteMultipartUploadInDays" : 7, "transitions" : [ { "days" : 90, "storageClass" : "ONEZONE_IA" } ] } ]
The following is not supported in ColdFusion (2021 release). It will be supported in a future update.
"lifecycleRuleFilter" : { "prefix" : "", "tagging" : { "key": "", "value" : "" }, "lifecycleRuleAndOperator" : { "prefix" : "", "tagging" : [{ "key": "", "value" : "" }] } }
<cfscript> storageService = getCloudService(this.s3Cred,this.s3Conf) rules={ "rules" : [ { "id" : "rule1", "prefix" : "a/b", "status" : "ENABLED", "expiration" : { //"date" : "DD/MM/YYY", "days" : 3 }, "noncurrentVersionExpirationDays" : 30, "noncurrentVersionTransitions" :[ { "days" : 35, "storageClass" : "GLACIER" }], "abortIncompleteMultipartUploadInDays" : 7, "transitions" : [ { "days" : 90, "storageClass" : "ONEZONE_IA" } ] } ] } createBucketRequest = { "acl":"PRIVATE", "bucket" : "cf.bucket", "objectLockEnabledForBucket" : true } rootObj=storageService.createBucket(createBucketRequest) appendRulesResponse=rootObj.appendRules(rules) writeDump(appendRulesResponse) </cfscript>
You can use the getRules function to retrieve all lifecycle rules for the bucket. This function does not accept any argument.
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.rule.delete", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key100" } bucketObj.uploadFile(uploadStruct) // create rule ruleStruct={ "rules":[{ "id" : "rule1", "prefix":"key", "status" : "ENABLED", "noncurrentVersionTransitions" : [{ "days":30, "storageClass" : "INTELLIGENT_TIERING" }] }] } // set the rule bucketObj.setRules(ruleStruct) // get the rule rules=bucketObj.getRules().rules writeDump(rules) </cfscript>
Object tagging gives you a way to categorize storage.
For more information, see the official docs.
addTags(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
Unique identifier of the object. |
Yes |
versionId |
Refer to a specific version of the object. |
No |
tags |
Array of tag structs. |
Yes |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demoaddtagstest", "objectLockEnabledForBucket" : true } bucketobj=storageService.createBucket(createBucketRequest) // upload a file uploadStruct = { "srcFile" : "#ExpandPath('./')#/s3-notes.pdf", "key" : "key12" } bucketobj.uploadFile(uploadStruct) // add tags to the object addTagStruct={ "key" : "key12", "tags" : [ { "key" : "label", "value" : "red" }, { "key": "category", "value": "important" } ] } try{ addTagResponse=bucketobj.addTags(addTagStruct) writeOutput("Tags added successfully") writeDump(addTagResponse) } catch(any e){ writeOutput("Failed to add tags") writeDump(e) } </cfscript>
Retrieve the list of tags that you’d added to the bucket. Use the getTagObjects function.
This function accepts the key that you’d specified while adding the tags.
getTagObjects(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
Unique identifier of the object. |
Yes |
versionId |
Refer to a specific version of the object. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demoaddtagstest", "objectLockEnabledForBucket" : true } bucketobj=storageService.createBucket(createBucketRequest) // upload a file uploadStruct = { "srcFile" : "#ExpandPath('./')#/s3-notes.pdf", "key" : "key12" } bucketobj.uploadFile(uploadStruct) // add tags to the object addTagStruct={ "key" : "key12", "versionId":"v1", "tags" : [ { "key" : "label", "value" : "red" }, { "key": "category", "value": "important" } ] } getTagResponse=bucketobj.GettagObjects("key12") writeDump(getTagResponse) </cfscript>
Get details of an object that was uploaded in a bucket.
getObjectDetails(parameterStruct)
Parameter | Description | Required |
---|---|---|
srcFile |
The path of the file that you want to upload in the bucket. | Yes |
key |
Unique identifier of the object. | Yes |
acl |
The ACL to apply to the object. For more information, see Canned ACL.The valid values are:
|
No |
cacheControl |
Specify the caching behavior as defined here. | No |
contentDisposition |
Specify the content format of the object as defined here. | No |
contentEncoding |
Specify the type of encoding on the object as defined here. | No |
contentLanguage |
The language of the object that you want to upload. | No |
contentLength |
The size of the object in bytes. | No |
validateContentMD5 |
True or False. The base64-encoded 128-bit MD5 digest of the message (without the headers). |
No |
contentType |
The format of the content as defined here. | No |
expires |
The date and time when the object cannot be cached any longer. |
No |
grantFullControl |
Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. |
No |
grantRead |
Allows grantee to only read the object data. |
No |
grantWrite |
Allows grantee to write to the object data. |
No |
grantReadACP |
Allows grantee to read the object ACL. |
No |
grantWriteACP |
Allows grantee to write the ACL for the object. |
No |
metadata |
The object metadata to use. | No |
serverSideEncryption |
The server-side encryption algorithm to be used. |
No |
storageClass |
Valid values are:
For more information, see S3 storage class. |
No |
websiteRedirectLocation |
If the bucket is configured as a website, specify the redirect request to another object in the same bucket or to an external URL. |
No |
sseCustomerAlgorithm |
Specifies the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specifies the customer-provided encryption key for S3 to use in encrypting data. |
No |
ssekmsKeyId |
Specifies the ID of the AWS Key Management Service (AWS KMS). |
No |
ssekmsEncryptionContext |
Specifies the AWS KMS Encryption Context to use for object encryption. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
tagging |
The tag-set for the object. Must be a struct of key-value pairs. |
No |
objectLockMode |
The Object locking mode that you want to apply to this object. Valid values are:
|
No |
objectLockRetainUntilDate |
The date and time when you want this object's Object Lock to expire. |
No |
objectLockLegalHoldStatus |
Indicates whether the specified object has a Legal Hold in place.. Valid values are:
|
No |
<cfscript> storageService = getcloudService(application.awsCred,application.s3Conf) // create a bucket bucketStruct={ "acl":"PRIVATE", "bucket" : "bucket.demo.objectdetailsdemo", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(bucketStruct) // upload an object into the bucket uploadStruct = { "srcFile" : "#ExpandPath('./')#/Colors.jpg", "key" : "key001", "metadata": { "filename": "Colors.jpg", "creator":"john", "place":"london", "creation_date":"2020/04/20", "filetype":"image" }, "contentLanguage":"en", "websiteRedirectLocation":"http://bucket", "expires":"2020-05-28" } bucketObj.uploadFile(uploadStruct) // get object details objectDetailsResponse=bucketObj.getObjectDetails("key001") writeDump(objectDetailsResponse) </cfscript>
You can upload objects in a bucket in parts, or parallelly. You can use parallel uploads for objects from 5 MB to 5 TB in size. If you're uploading large objects over a stable high-bandwidth network, use parallel uploading to make better use of your available bandwidth by uploading object parts in parallel for multi-threaded performance.
parallelUploadFile(parameterStruct)
Parameter | Description | Required |
---|---|---|
srcFile | The location of the file that you want to upload. | Yes |
chunkLengthInBytes | Size of the content chunk. | No |
timeOutInSeconds | The time out of the upload operation. | No |
acl | Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
|
No |
cacheControl | Specify the caching behavior as defined here. | No |
contentDisposition | Specify the content format of the object as defined here. | No |
contentEncoding | Specify the type of encoding on the object as defined here. | No |
contentLanguage | The language of the object that you want to upload. | No |
contentLength | The size of the object in bytes. | No |
validateContentMD5 : | True | False. The base64-encoded 128-bit MD5 digest of the message (without the headers). | No |
contentType | The format of the content as defined here. | No |
expires | The date and time when the object cannot be cached any longer. | No |
grantFullControl | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. | No |
grantRead | Allows grantee to read the object ACL. | No |
grantReadACP | Allows grantee to read the object ACL. | No |
grantWriteACP | Allows grantee to write the ACL for the object. | No |
metadata | The object metadata to use. | No |
serverSideEncryption | The server-side encryption algorithm to be used. | No |
storageClass | Valid values are:
For more information, see S3 storage class. |
No |
websiteRedirectLocation | If the bucket is configured as a website, specify the redirect request to another object in the same bucket or to an external URL. | No |
sseCustomerAlgorithm | Specifies the algorithm to use to when encrypting the object. | No |
sseCustomerKey | Specifies the customer-provided encryption key for S3 to use in encrypting data. | No |
sseCustomerKeyMD5 | Specifies the MD5 of the key. | No |
ssekmsKeyId | Specifies the ID of the AWS Key Management Service (AWS KMS). | No |
ssekmsEncryptionContext | Specifies the AWS KMS Encryption Context to use for object encryption. | No |
requestPayer | Confirms that the requester knows that they will be charged for the request. | No |
tagging | NOTE: This will be supported from s3 sdk 2.10.46 onwards. | No |
objectLockMode | The Object locking mode that you want to apply to this object. Valid values are:
|
|
objectLockRetainUntilDate | The date and time when you want this object's Object Lock to expire. | No |
objectLockLegalHoldStatus | Indicates whether the specified object has a Legal Hold in place.. Valid values are:
|
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.parallel.upload" } rootObj = storageService.createBucket(createBucketRequest) // parallel upload struct parallelUploadRequest = { "srcFile" : "#ExpandPath('..')#/files/file.txt", "chunkLengthInBytes": "5e+6", "timeOutInSeconds": "60", "key": "key1" } try{ uploadResponse = rootObj.parallelUploadFile(parallelUploadRequest) writeOutput("Parallel upload successful") writeDump(uploadResponse) } catch(any e){ writeDump(e) } </cfscript>
Once you’ve uploaded a large object in a bucket, you can then download the object parallelly, in parts.
parallelDownloadFile(parameterStruct)
Parameter | Description | Required |
---|---|---|
key | The key with which an object was uploaded. | Yes |
destinationFile | The location where you want to download the file to. | Yes |
chunkLengthInBytes | Size of the content chunk. | No |
cacheControl |
Set the cache control header of the object, | No |
contentDisposition |
Set the Content-Disposition header of the response. |
No |
contentEncoding |
Set the Content-Encoding header of the response. |
No |
contentLanguage |
Set the Content-Language header of the response. |
No |
contentType |
Set the Content-Type header of the response. |
No |
expires |
Sets the Response header of the response. |
No |
versionId |
Refer to a specific version of the object. | No |
sseCustomerAlgorithm |
Specify the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specify the customer-provided encryption key for S3 to use in encrypting data. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
<cfscript> storageService = cloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.parallel.download" } rootObj = storageService.createBucket(createBucketRequest) // parallel upload struct parallelUploadRequest = { "srcFile" : "#ExpandPath('..')#/files/file.txt", "chunkLengthInBytes": "5e+6", "timeOutInSeconds": "60", "key": "key1" } // upload object parallelly rootObj.parallelUploadFile(parallelUploadRequest) // parallel download struct parallelDownloadRequest = { "key" : "key1", "destinationFile" : "file.txt", "chunkLengthInBytes": "5e+6" } downloadResponse=rootObj.parallelDownloadFile(parallelDownloadRequest) writeDump(downloadResponse) </cfscript>
Multipart upload allows you to upload a single object as a set of parts. Each part is a contiguous portion of the object's data.
You can upload these object parts independently and in any order.
For more information, see Multi-part uploads in AWS.
multipartUpload(parameterStruct)
Parameter | Description | Required |
---|---|---|
srcFile | The location of the file that you want to upload. | Yes |
chunkLengthInBytes | Size of the content chunk. | No |
timeOutInSeconds | The time out of the upload operation. | No |
acl | Amazon S3 access control lists (ACLs) enable you to manage access to buckets and objects. Valid values are:
|
No |
cacheControl | Specify the caching behavior as defined here. | No |
contentDisposition | Specify the content format of the object as defined here. | No |
contentEncoding | Specify the type of encoding on the object as defined here. | No |
contentLanguage | The language of the object that you want to upload. | No |
contentLength | The size of the object in bytes. | No |
validateContentMD5 : | True | False. The base64-encoded 128-bit MD5 digest of the message (without the headers). | No |
contentType | The format of the content as defined here. | No |
expires | The date and time when the object cannot be cached any longer. | No |
grantFullControl | Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. | No |
grantRead | Allows grantee to read the object ACL. | No |
grantReadACP | Allows grantee to read the object ACL. | No |
grantWriteACP | Allows grantee to write the ACL for the object. | No |
metadata | The object metadata to use. | No |
serverSideEncryption | The server-side encryption algorithm to be used. | No |
storageClass | Valid values are:
For more information, see S3 storage class. |
No |
websiteRedirectLocation | If the bucket is configured as a website, specify the redirect request to another object in the same bucket or to an external URL. | No |
sseCustomerAlgorithm | Specifies the algorithm to use to when encrypting the object. | No |
sseCustomerKey | Specifies the customer-provided encryption key for S3 to use in encrypting data. | No |
sseCustomerKeyMD5 | Specifies the MD5 of the key. | No |
ssekmsKeyId | Specifies the ID of the AWS Key Management Service (AWS KMS). | No |
ssekmsEncryptionContext | Specifies the AWS KMS Encryption Context to use for object encryption. | No |
requestPayer | Confirms that the requester knows that they will be charged for the request. | No |
tagging | NOTE: This will be supported from s3 sdk 2.10.46 onwards. | No |
objectLockMode | The Object locking mode that you want to apply to this object. Valid values are:
|
|
objectLockRetainUntilDate | The date and time when you want this object's Object Lock to expire. | No |
objectLockLegalHoldStatus | Indicates whether the specified object has a Legal Hold in place.. Valid values are:
|
No |
<cfscript> storageService = cloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.parallel.multipartupload" } rootObj = storageService.createBucket(createBucketRequest) // multi part upload struct mulitipartUploadRequest = { "srcFile" : "#ExpandPath('..')#/files/file.mp4", "chunkLengthInBytes": "5e+6", "timeOutInSeconds": "2", "key": "key1" } try{ uploadResponse = rootObj.multipartUpload(mulitipartUploadRequest) writeOutput("File uploaded sucessfully in multiple parts") writeDump(uploadResponse) } catch(any e){ writeDump(e) } </cfscript>
Upload an object to a bucket.
uploadObject(parameterStruct)
Parameter | Description | Required |
---|---|---|
key |
Unique identifier of the object. | Yes |
acl |
The ACL to apply to the object. For more information, see Canned ACL.The valid values are:
|
No |
cacheControl |
Specify the caching behavior as defined here. | No |
contentDisposition |
Specify the content format of the object as defined here. | No |
contentEncoding |
Specify the type of encoding on the object as defined here. | No |
contentLanguage |
The language of the object that you want to upload. | No |
contentLength |
The size of the object in bytes. | No |
validateContentMD5 |
The base64-encoded 128-bit MD5 digest of the message (without the headers). |
No |
contentType |
The format of the content as defined here. | No |
expires |
The date and time when the object cannot be cached any longer. |
No |
grantFullControl |
Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. |
No |
grantRead |
Allows grantee to only read the object data. |
No |
grantWrite |
Allows grantee to write to the object data. |
No |
grantReadACP |
Allows grantee to read the object ACL. |
No |
grantWriteACP |
Allows grantee to write the ACL for the object. |
No |
metadata |
The object metadata to use. | No |
serverSideEncryption |
The server-side encryption algorithm to be used. |
No |
storageClass |
Valid values are:
For more information, see S3 storage class. |
No |
websiteRedirectLocation |
If the bucket is configured as a website, specify the redirect request to another object in the same bucket or to an external URL. |
No |
sseCustomerAlgorithm |
Specifies the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specifies the customer-provided encryption key for S3 to use in encrypting data. |
No |
ssekmsKeyId |
Specifies the ID of the AWS Key Management Service (AWS KMS). |
No |
ssekmsEncryptionContext |
Specifies the AWS KMS Encryption Context to use for object encryption. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
tagging |
The tag-set for the object. Must be a struct of key-value pairs. |
No |
objectLockMode |
The Object locking mode that you want to apply to this object. Valid values are:
|
No |
objectLockRetainUntilDate |
The date and time when you want this object's Object Lock to expire. |
No |
object | Object to be uploaded. | No |
type | Object type- json | No |
useCustomSerializer | True or False. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for XML deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown. For more information, see Serialize. |
No |
objectLockLegalHoldStatus |
Indicates whether the specified object has a Legal Hold in place.. Valid values are:
|
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create the bucket rootObj=storageService.bucket("bucket.download.object","true") key = "key12" a=["a","b","c","d"]; // define upload struct uploadStruct = { "type": "json", "object" : a, "key" : key } // upload an object try{ rootObj.uploadObject(uploadStruct) writeOutput("Object uploaded successfully") } catch(any e){ writeOutput("Failed to upload object") writeDump(e) } // define download struct downloadStruct = { "type": "json", "key" : key } // download the object try{ rootObj.downloadObject(downloadStruct) writeOutput("Object downloaded successfully") } catch(any e){ writeOutput("Failed to download object") writeDump(e) } </cfscript>
Download an object that was uploaded previously.
downloadObject(parameterStruct)
Parameter | Description | Required |
---|---|---|
key |
Unique identifier of the object. | Yes |
cacheControl |
Set the cache control header of the object, | No |
contentDisposition |
Set the Content-Disposition header of the response. |
No |
contentEncoding |
Set the Content-Encoding header of the response. |
No |
contentLanguage |
Set the Content-Language header of the response. |
No |
contentType |
Set the Content-Type header of the response. |
No |
expires |
Sets the Response header of the response. |
No |
versionId |
Refer to a specific version of the object. | No |
sseCustomerAlgorithm |
Specify the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specify the customer-provided encryption key for S3 to use in encrypting data. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. |
No |
type | Object type- json | No |
useCustomSerializer | True or False | No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create the bucket rootObj=storageService.bucket("bucket.download.object","true") key = "key12" a=["a","b","c","d"]; // define upload struct uploadStruct = { "type": "json", "object" : a, "key" : key } // upload an object try{ rootObj.uploadObject(uploadStruct) writeOutput("Object uploaded successfully") } catch(any e){ writeOutput("Failed to upload object") writeDump(e) } // define download struct downloadStruct = { "type": "json", "key" : key } // download the object try{ rootObj.downloadObject(downloadStruct) writeOutput("Object downloaded successfully") } catch(any e){ writeOutput("Failed to download object") writeDump(e) } </cfscript>
Upload a directory in a bucket. You can also perform a bulk upload.
uploadDirectory(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
prefix |
It is the prefix that will be added to the object key while uploading. |
Yes |
sourceDirectory |
The location of the directory to upload. |
Yes |
uploadNestedDirectory |
True or False. Specify if you want to include sub-directories inside the main folder. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.b.four", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(createBucketRequest) // define request parameters for upload dirUploadReq = { "prefix" : "test_bulk\", "sourceDirectory" : "../files", "uploadNestedDirectory" : true } try{ uploadResponse=storageService.uploadDirectory(dirUploadReq) writeOutput("Directory uploaded successfully") writeDump(uploadResponse) } catch(any e){ writeDump(e) } </cfscript>
Place an Object Lock configuration on the specified bucket.
For more information, see the official docs.
putObjectLockConfiguration(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
objectLockConfiguration |
The root level tag for the ObjectLockConfiguration parameters. |
Yes |
objectLockEnabled |
Whether this bucket has an Object Lock configuration enabled. Valid values are: ENABLED |
No |
defaultRetention |
Struct containing the following: mode: The Object locking mode that you want to apply to this object. Valid values are:
days: Number of days to lock the object for. years: Number of years to lock the object for. Note: Specify either days or years, not both. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getobjectlock", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key161" } bucketObj.uploadFile(uploadStruct) // put object lock putObjectLockRequest = { "objectLockConfiguration" : { "objectLockEnabled" : "ENABLED", "defaultRetention" : { "mode" : "GOVERNANCE", "days" : 31 } } } bucketObj.putObjectLockConfiguration(putObjectLockRequest) // get object lock objectLockResponse=bucketObj.getObjectLockConfiguration() writeDump(objectLockResponse) </cfscript>
Get the Object Lock configuration for a bucket.
For more information, see the official docs.
getObjectLockConfiguration()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getobjectlock", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key161" } bucketObj.uploadFile(uploadStruct) // put object lock putObjectLockRequest = { "objectLockConfiguration" : { "objectLockEnabled" : "ENABLED", "defaultRetention" : { "mode" : "GOVERNANCE", "days" : 31 } } } bucketObj.putObjectLockConfiguration(putObjectLockRequest) // get object lock objectLockResponse=bucketObj.getObjectLockConfiguration() writeDump(objectLockResponse) </cfscript>
Apply a Legal Hold to object.
For more information, see Locking Objects and the official doc.
acquireLegalHold(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key name for the object that you want to place a Legal Hold on. |
Yes |
versionId |
The version ID of the object that you want to place a Legal Hold on. |
No |
legalHold |
The root level tag for the LegalHold parameters. Struct containing the following: status: ON or OFF |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. Valid value is: REQUESTER |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.acquirelegalhold", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key121" } bucketObj.uploadFile(uploadStruct) // enable versioning bucketObj.enableVersioning() // list all versions list=bucketObj.listAllVersions() // get version Id v_id=list.response[1].versionId // acquire legal hold request acquireLegalHoldRequest = { "key" : "key121", "versionId" : "#v_id#", "legalHold" : { "status" : "ON" }, "requestPayer" : "REQUESTER" } try{ acquireHoldResponse=bucketObj.acquireLegalHold(acquireLegalHoldRequest) writeDump(acquireHoldResponse) } catch (any e){ writeDump(e) } </cfscript>
Apply a Legal Hold to object.
For more information, see Locking Objects.
getLegalHold(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key name for the object whose Legal Hold status you want to get. |
Yes |
versionId |
The version ID of the object whose Legal Hold status you want to get. |
No |
requestPayer |
Confirms that the requester knows that they will be charged for the request. Valid value is: REQUESTER |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getlegalhold", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key141" } bucketObj.uploadFile(uploadStruct) // enable versioning bucketObj.enableVersioning() // list all versions list=bucketObj.listAllVersions() // get version Id v_id=list.response[1].versionId // get legal hold status on the object getLegalHoldRequest = { "key" : "key141", "versionId" : "#v_id#", "requestPayer" : "REQUESTER" } getLegalHoldResponse=bucketObj.getLegalHold(getLegalHoldRequest) writeDump(getLegalHoldResponse) </cfscript>
Place an Object Retention configuration on an object.
For more information, see the official docs.
acquireRetentionLock(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key name for the object that you want to apply this Object Retention configuration to. |
Yes |
versionID |
The version ID for the object that you want to apply this Object Retention configuration to. |
No |
retention |
Struct containing the following:
|
No |
requestPayer |
Confirms that the requester knows that he/she will be charged for the request. |
No |
bypassGovernanceRetention |
Whether this operation must bypass Governance-mode restrictions. |
|
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.acquireretentionlock", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // upload an object to the bucket uploadStruct={ "srcFile":"#ExpandPath('./')#/s3-notes.pdf", "key":"key131" } bucketObj.uploadFile(uploadStruct) // enable versioning bucketObj.enableVersioning() // list all versions list=bucketObj.listAllVersions() // get version Id v_id=list.response[1].versionId retainDate=DateFormat(DateAdd("d",8,now()),"yyyy-mm-dd") retentionRequestStruct = { "key" : "key131", "versionId" : "#v_id#", "retention" : { "mode" : "GOVERNANCE", "retainUntilDate" : "#retainDate#" }, "requestPayer" : "REQUESTER", "bypassGovernanceRetention" : false } try{ acquireRetentionLockResponse=bucketObj.acquireRetentionLock(retentionRequestStruct) writeDump(acquireRetentionLockResponse) } catch(any e){ writeDump(e) } </cfscript>
Retrieve an object's retention settings.
getRetentionLock(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key name for the object for which you want to retrieve this Object Retention configuration. |
Yes |
versionId |
The version id for the object for which you want to retrieve this Object Retention configuration. |
No |
requestPayer |
Confirms that the requester knows that he/she will be charged for the request. Valid value is: REQUESTER |
No |
<cfscript> storageService = getCloudService(application.awsCred, application.s3Conf) createBucketRequest = { "bucket" : "bucket.demo.lock", "objectLockEnabledForBucket" : "true" } rootObj=storageService.createBucket(createBucketRequest) //rootObj=storageService.bucket("cfqa2.test123456",true); rootObj.enableVersioning() // upload a file uploadRequest = { "srcFile" : "test.txt", "key" : "test", "validateContentMD5":"true", "objectLockMode" : "GOVERNANCE", "objectLockRetainUntilDate" : "2019-12-11", "objectLockLegalHoldStatus" : "ON" } rootObj.uploadFile(uploadRequest); //writedump(uploadResponse) request1 = { "objectLockConfiguration" : { "objectLockEnabled" : "ENABLED", "defaultRetention" : { "mode" : "GOVERNANCE", "days" : "2", "years": "1" } } } rootObj.putObjectLockConfiguration(request1) retentionRequest = { "key" : "test", "retention" : { "mode" : "GOVERNANCE", "retainUntilDate" : "{ts '2019-11-27 12:13:50'}" }, "bypassGovernanceRetention" :"true" } rootObj.acquireRetentionLock(retentionRequest) getRetentionRequest={ "key" : "test" } writedump(rootObj.getRetentionLock(getRetentionRequest)) </cfscript>
In general, bucket owners pay for the storage and data transfer costs associated with their bucket. A bucket owner can configure a bucket to be a Requester Pays bucket. With Requester Pays buckets, the requester instead of the bucket owner pays the cost of the request and the data download from the bucket. The bucket owner always pays the cost of storing data.
Typically, you configure buckets to be Requester Pays when you want to share data but not incur charges associated with others accessing the data. You might, for example, use Requester Pays buckets when making available large datasets, such as zip code directories, reference data, geospatial information, or web crawling data.
If you enable Requester Pays on a bucket, anonymous access to that bucket is not allowed.
You must authenticate all requests involving Requester Pays buckets. The request authentication enables Amazon S3 to identify and charge the requester for their use of the Requester Pays bucket.
Enable requester pay on a bucket.
enableRequesterpay()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "sg.bucket", "objectLockEnabledForBucket" : true } // create a bucket myobj=storageService.createBucket(createBucketRequest) // Enabling "Requester Pays" on bucket: myobj.enableRequesterpay() // Get Requester Pay status: getResponse=myobj.getRequesterPayStatus() writeDump(getResponse) </cfscript>
Disable requester pay on a bucket.
disableRequesterPay()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.disablerequester", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // Enabling "Requester Pays" on bucket bucketObj.enableRequesterpay() // Disable requester pay status on the bucket try{ disableRequesterPayResponse=bucketObj.disableRequesterPay() writeOutput("Requester pay disabled") writeDump(disableRequesterPayResponse) } catch (any e){ writeOutput("Unable to disable requester pay") writeDUmp(e) } </cfscript>
Check if requester pay is enabled on bucket.
getRequesterPayStatus()
<cfscript> storageService = cloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getrequester", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // Enabling "Requester Pays" on bucket bucketObj.enableRequesterpay() // Get the requester pay details getRequesterPayResponse=bucketObj.getRequesterPayStatus() writeDump(getRequesterPayResponse) </cfscript>
AWS provides Identity and Access Management (IAM) user policies that specify the users that can access specific buckets and objects.
AWS S3 provides writing bucket policies that define access to specific buckets and objects. You can use a bucket policy to grant access across AWS accounts, grant public or anonymous permissions, and allow or block access based on conditions.
Using Amazon S3 Block Public Access as a centralized way to limit public access. Block Public Access settings override bucket policies and object permissions. Be sure to enable Block Public Access for all accounts and buckets that you don't want publicly accessible.
Amazon S3 block public access provides four settings. You can apply these settings in any combination to individual buckets or to entire AWS accounts. If you apply a setting to an account, it applies to all buckets that are owned by that account.
Block public access on bucket. For more information, see Public access block.
putSecurityAccessBlock(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
blockPublicAcls |
TRUE or FALSE. Whether S3 must block public access control lists (ACLs) for this bucket and objects in this bucket. |
No |
ignorePublicAcls |
TRUE or FALSE. Whether S3 must ignore public access control lists (ACLs) for this bucket and objects in this bucket. |
No |
blockPublicPolicy |
TRUE or FALSE. Whether S3 must block public bucket policies for this bucket. |
No |
restrictPublicBuckets |
TRUE or FALSE. Whether S3 must restrict public bucket policies for this bucket. |
No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getpublicaccess", "objectLockEnabledForBucket" : true } bucketobj=storageService.createBucket(createBucketRequest) pubAccessReq = { "publicAccessBlockConfiguration" : { "blockPublicAcls" : true, "ignorePublicAcls" : true, "blockPublicPolicy" : true, "restrictPublicBuckets" : true } } try{ accessBlockResponse=bucketobj.putSecurityAccessBlock(pubAccessReq) writeOutput("Block to public access enforced successfully") writeDump(accessBlockResponse) } catch(any e){ writeOutput("Failed to block public access") writeDump(e) } // get the block details getBlockResponse=bucketobj.getSecurityAccessBlock() writeDump(getBlockResponse) </cfscript>
Get public access configuration on bucket. For more information, see Get public access block.
getSecurityAccessBlock()
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.getpublicaccess", "objectLockEnabledForBucket" : true } bucketobj=storageService.createBucket(createBucketRequest) pubAccessReq = { "publicAccessBlockConfiguration" : { "blockPublicAcls" : true, "ignorePublicAcls" : true, "blockPublicPolicy" : true, "restrictPublicBuckets" : true } } try{ accessBlockResponse=bucketobj.putSecurityAccessBlock(pubAccessReq) writeOutput("Block to public access enforced successfully") writeDump(accessBlockResponse) } catch(any e){ writeOutput("Failed to block public access") writeDump(e) } // get the block details getBlockResponse=bucketobj.getSecurityAccessBlock() writeDump(getBlockResponse) </cfscript>
Get the region that contains a bucket.
For more information, see Get bucket location.
getLocation()
<cfscript> storageService = getCloudService(application.awsCred, application.s3Conf) // create a bucket createBucketRequest = { "acl":"PRIVATE", "bucket" : "bucket.demo.loc", "objectLockEnabledForBucket" : true } // create a bucket bucketObj=storageService.createBucket(createBucketRequest) // get bucket location bucketLoc=bucketObj.getLocation() writeDump(bucketLoc) </cfscript>
Get the metadata of an object in a bucket. While uploading an object, you'd have already set the object's metadata.
getObjectMetadata(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
key |
The key with which the object was uploaded. |
Yes |
versionId |
The version id associated with the object. |
No |
<cfscript> storageService = cloudService(application.awsCred,application.s3Conf) // create a bucket bucketStruct={ "acl":"PRIVATE", "bucket" : "bucket.demo.objectmetadatademo", "objectLockEnabledForBucket" : true } bucketObj=storageService.createBucket(bucketStruct) // upload an object into the bucket uploadStruct={ "srcFile" : "#ExpandPath('./')#/Colors.jpg", "key" : "key001", "metadata": { "filename": "Colors.jpg", "creator":"john", "place":"london", "creation_date":"2020/04/20", "filetype":"image" } } bucketObj.uploadFile(uploadStruct) // get object metadata objectMetadataResponse=bucketObj.getObjectMetadata("key001") writeDump(objectMetadataResponse) </cfscript>
A pre-signed URL gives you access to the object identified in the URL, provided that the creator of the pre-signed URL has permissions to access that object. If you receive a pre-signed URL to upload an object, you can upload the object only if the creator of the pre-signed URL has the necessary permissions to upload that object.
For more information, see Uploading objects using pre-signed urls.
Generate a url to get an object.
generateGetPresignedUrl(parameterStruct)
Parameter | Description | Required |
---|---|---|
duration | Duration of the url in days. | No |
key | The key associated with the object. | Yes |
cacheControl |
Specify the caching behavior as defined here. | No |
contentDisposition |
Specify the content format of the object as defined here. | No |
contentEncoding |
Specify the type of encoding on the object as defined here. | No |
contentLanguage |
The language of the object that you want to upload. | No |
contentType |
The format of the content as defined here. | No |
expires |
The date and time when the object cannot be cached any longer. |
No |
versionId | The version id of the object. | No |
sseCustomerAlgorithm |
Specifies the algorithm to use to when encrypting the object. |
No |
sseCustomerKey |
Specifies the customer-provided encryption key for S3 to use in encrypting data. |
No |
sseCustomerKeyMD5 | Specifies the MD5 of the key. | No |
requestPayer | Confirms that the requester knows that they will be charged for the request. | No |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.parallel.getpresignedurl" } rootObj = storageService.createBucket(createBucketRequest) // upload a file src = "#ExpandPath('..')#/files/file.txt" key = "key12" uploadStruct = { "srcFile" : src, "key" : key } rootObj.uploadFile(uploadStruct) // Pre signed url struct getPresignedUrlRequest = { "duration": "1d", // 1 day "key":key } getPresignedUrlResp = rootObj.generateGetPresignedUrl(getPresignedUrlRequest) writeDump(getPresignedUrlResp) </cfscript>
Generates a url to put an object.
generatePutPresignedUrl(parameterStruct)
Parameter |
Description |
Required |
---|---|---|
duration |
Duration of the url in days. |
No |
key |
The key associated with the object. |
Yes |
<cfscript> storageService = getCloudService(application.awsCred,application.s3Conf) // create a bucket createBucketRequest = { "bucket" : "bucket.parallel.putpresignedurl" } rootObj = storageService.createBucket(createBucketRequest) putPresignedReq = { "duration": "1d", // 1 day "key" : "key12" } putPresignedUrlResp = rootObj.generatePutPresignedUrl(putPresignedReq); writedump(putPresignedUrlResp) </cfscript>
Bei Ihrem Konto anmelden