import Uploader from 'pipeline-transfer/functions/transfer/transfer/uploader.js'
Uploader
Constructor Summary
Public Constructor | ||
public |
constructor(data: Object) Uploads artifacts to a remote S3 bucket defined inside an array of file globs, of locations inside pipeline input artifacts. |
Member Summary
Public Members | ||
public |
An array of Artifact objects which have been made available to the CodePipeline action definition. |
|
public |
The data object as received from AWS CodePipeline. |
|
public |
The parsed contents of the |
Method Summary
Public Methods | ||
public |
async destinations(): Array[Destination] Maps all defined src/dest combinations (from Uploader#userParameters) to destination objects ready for upload. |
|
public |
Performs the intended operation and uploads source files from pipeine artifacts to remote S3 locations by assuming the provided roles to provide the correct permission sets. |
|
public |
async userParameters(): Object Retrieve validated (and defaulted) parameters which have been defined inside the action in the CodePipeline resource. |
Public Constructors
public constructor(data: Object) source
Uploads artifacts to a remote S3 bucket defined inside an array of file globs, of locations inside pipeline input artifacts.
Params:
Name | Type | Attribute | Description |
data | Object | A CodePipeline data event object. |
Example:
```
{
"CodePipeline.job": {
"id": "11111111-abcd-1111-abcd-111111abcdef",
"accountId": "111111111111",
"data": {
"actionConfiguration": {
"configuration": {
"FunctionName": "MyLambdaFunctionForAWSCodePipeline",
"UserParameters": "...."
}
},
"inputArtifacts": [
{
"location": {
"s3Location": {
"bucketName": "codepipeline-us-east-2-1234567890",
"objectKey": "rj90jda90ja90j09tj09jaf.zip"
},
"type": "S3"
},
"revision": null,
"name": "ArtifactName"
}
],
"outputArtifacts": [],
"artifactCredentials": {
"secretAccessKey": "....",
"sessionToken": "....",
"accessKeyId": "...."
},
"continuationToken": "A continuation token if continuing job"
}
}
}
```
Public Members
public artifacts: String source
An array of Artifact objects which have been made available to the CodePipeline action definition.
public parameters: Object source
The parsed contents of the UserParameters
string as defined inside the
action in the CodePipeline resource. This should be a valid array of objects,
similar to the example below:
[
{
"roleArn": {
"Fn::GetParam": ["DeployOutput", "Outputs.json", "AssetS3BucketTransferRole"]
},
"bucket": {
"Fn::GetParam": ["DeployOutput", "Outputs.json", "AssetS3Bucket"]
},
"prefix": "s3/key/prefix/",
"src": [
"BuildOutput::*.js"
]
}
]
Public Methods
public async destinations(): Array[Destination] source
Maps all defined src/dest combinations (from Uploader#userParameters) to destination objects ready for upload.
Return:
Array[Destination] | an array of Destination objects |