---
# System prepended metadata

title: AWS Utilities

---

# AWS Utilities

AWS Utilities is a shared library for interacting with Amazon Web Services.

## Requirements

- Must be running on an environment that has AWS CLI installed.
- Include in the Jenkinsfile:
```
    @Library('PairingPipelineUtilities') _
    import nice.aws.cloudformation.Stack
```

- The `assumeRole()` method must be called prior to creating the Builder.
- The builder requires these parameters:  
> **name** (*_string_* stackName)
> **template** (*_string_* templatePath)
> **profile** (*_string_* profile)
> **account** (*_string_* account)
> **region** (*_string_* region)
> **publishToS3** (*_string_* deployBucketName, *_string_* deployS3Prefix, *_string_* deployBucketAuditLoggingBucket)
- During a stage in the Jenkinsfile, `.build()` must be called.  
Then, `.deploy()` must be called on the resulting object.
> Example usage:
```
    def builder = awsUtilities.CloudFormationBuilder(this)
        .name("container-MIDR-test")
        .template('template.yaml')
        .profile('matr-pipeline')
        .account('matr-pipeline')
        .region('us-west-2')
        .publishToS3("matr-pipeline-us-west-2-mattersight-deployments", "container-MIDR-test", "audit-logging-matr-pipeline-us-west-2")

    def deployment = builder.build()
    deployment.deploy()
```

## Methods

>**getStreamRecords**(*_string_* streamName, *_string_* accountName, *_string_* region)
**assumeRole**(*_string_* assumedRoleArn, *_string_* account)
**CloudFormationBuilder**(*_object_* jenkinsCtx)
