TeamCity comes bundled with the Amazon S3 Artifact Storage plugin which allows storing build artifacts in Amazon S3 buckets, as well as S3-compatible buckets such as MinIO, Backblaze B2, and others. S3-compatible storages can be hosted in both AWS and non-AWS environments.
Create and Set Up a New AWS S3 Storage
Navigate to the Administration | <Your_Project> page and switch to the Artifacts Storage tab.
Open settings of a <Root project> if you want your new storage to be available for all TeamCity projects.
Edit one specific project if your new storage should be available only for this project and its sub-projects.
The built-in TeamCity artifacts storage is displayed by default and marked as active. Click Add new storage button to create a new storage.
Specify the custom storage name and, if needed, its internally used ID.
Set the Type field to "AWS S3".
Choose an existing AWS Connection that TeamCity should use to access your Amazon resources. If no suitable AWS connection exists, click the "+" icon to add one.
tip
You cannot use AWS Connections that belong to a parent project and have their Available for sub-projects settings disabled.
However, if a parent project has an S3 storage configured using a non-shared connection, this storage is still available to child projects.
A user whose credentials the selected AWS Connection uses (or an IAM Role it assumes) to access the S3 buckets should have the following permissions:
In previous TeamCity versions, the Artifacts Storage dialog allowed you to explicitly specify connection settings: access key credentials, user IAM role, and whether TeamCity should look for credentials in the default AWS locations (the Default provider chain setting).
Starting with version 2023.11, these settings are exclusive to AWS Connections. If you're migrating from an older version of TeamCity and your existing AWS S3 storages used any of these settings, click the Convert to AWS Connection link. This action transfers AWS-related settings to a new AWS Connection, and selects this new connection as the source connection of your storage.
TeamCity uses the selected AWS Connection to retrieve the list of available S3 buckets. Open the Bucket drop-down menu to choose a specific item from the list.
(Optional) Specify the path prefix if you want to use the same S3 bucket for all TeamCity projects and configure prefix-based permissions.
Amazon S3 buckets support two options to speed up file uploads and downloads:
AWS CloudFront — a content delivery network (CDN) that allows TeamCity to transfer arifacts using low-latency CloudFront servers nearby.
Transfer Acceleration — a bucket-level feature designed to optimize transfer speeds from across the world into centralized S3 buckets. It enables fast, easy, and secure transfers of files over long distances between your client and an S3 bucket.
If your bucket is configured to use Transfer Acceleration or CloudFront, choose the corresponding option under the Transfer speed-up section. Otherwise, if you wish TeamCity to transfer files in the regular mode, choose the None type.
note
Choosing the AWS CloudFront option requires setting up additional fields. See this section for more information: Transferring Artifacts via CloudFront.
note
Using Transfer Acceleration applies the following restrictions:
User credentials or IAM role the AWS Connection uses to access your bucket must include the GetAccelerateConfiguration permission.
To optimize the upload of large files to the storage, you can enable the multipart upload. To do this, tick the Customize threshold and part size setting and set the multipart upload threshold. The minimum allowed value is 5MB. Supported suffixes: KB, MB, GB, TB. If you leave this field empty, multipart upload will be initiated automatically for all files larger than 8 MB (8MB is the default value).
Additionally, you can configure the maximum allowed size of each uploaded file part. The minimum value is 5MB. If left empty, TeamCity will use 8MB as the default value.
tip
We recommend that you configure a bucket lifecycle policy to prevent incomplete multipart uploads.
Uncheck the Force virtual host addressing option to turn off the corresponding feature (enabled by default). Currently, both hosted-style and path-style requests are supported by TeamCity. Note that Amazon stopped supporting path-style access for new buckets since September 2020.
Tick Verify file integrity after upload to allow TeamCity to perform an additional check-up on uploaded files. If the integrity verification fails, TeamCity writes a corresponding message to the build log.
Click Save to save your new storage and return to the list of available storages.
When viewing a list of storages available for a project, click Make Active to start using the corresponding storage for all new builds of this project. The has N usages link allows you to view which builds used this storage to upload their artifacts.
Create and Set Up a New S3-Compatible Storage
Navigate to the Administration | <Your_Project> page and switch to the Artifacts Storage tab.
Open settings of a <Root project> if you want your new storage to be available for all TeamCity projects.
Edit one specific project if your new storage should be available only for this project and its sub-projects.
The built-in TeamCity artifacts storage is displayed by default and marked as active. Click Add new storage button to create a new storage.
Specify the custom storage name and, if needed, its internally used ID.
Set the Type field to "Custom S3".
Specify the Access key ID and Secret access key values. See documentation for your S3-compatible storage vendor for the information on how to issue access keys.
Specify the storage endpoint TeamCity should use to access your bucket.
(Optional) Specify the path prefix if you want to use the same S3 bucket for all TeamCity projects and configure prefix-based permissions.
To optimize the upload of large files to the storage, you can enable the multipart upload. To do this, tick the Customize threshold and part size setting and set the multipart upload threshold. The minimum allowed value is 5MB. Supported suffixes: KB, MB, GB, TB. If you leave this field empty, multipart upload will be initiated automatically for all files larger than 8 MB (8MB is the default value).
Additionally, you can configure the maximum allowed size of each uploaded file part. The minimum value is 5MB. If left empty, TeamCity will use 8MB as the default value.
Uncheck the Force virtual host addressing option to turn off the corresponding feature (enabled by default). Currently, both hosted-style and path-style requests are supported by TeamCity. Note that Amazon stopped supporting path-style access for new buckets since September 2020.
Tick Verify file integrity after upload to allow TeamCity to perform an additional check-up on uploaded files. If the integrity verification fails, TeamCity writes a corresponding message to the build log.
Click Save to save your new storage and return to the list of available storages.
When viewing a list of storages available for a project, click Make Active to start using the corresponding storage for all new builds of this project. The has N usages link allows you to view which builds used this storage to upload their artifacts.
S3 Storage Classes
Amazon S3 Storage Classes allow you to fine-tune your storage based on its desired performance, as well as availability and resilience of its data.
There are two ways to enable the required storage class:
On TeamCity side. When uploading artifacts to an S3 bucket, TeamCity adds the x-amz-storage-class header to its PUT requests. The header value depends on the corresponding storage setting in TeamCity (for example, x-amz-storage-class: INTELLIGENT_TIERING). This mode does not require any additional setup on the AWS side.
Although this approach is not currently supported, we hope to implement this functionality in our future release cycles. Upvote and comment on this YouTrack ticket to support the feature and share your feedback: TW-79992.
On AWS side. In this mode, TeamCity uploads artifacts in a regular manner and the required storage class is applied by a pre-configured lifecycle rule after the artifacts were uploaded. To set up this rule, do the following:
Open the required S3 storage and switch to the Management tab.
Click Create lifecycle rule.
Check Move current versions of objects between storage classes under the Lifecycle rule actions section.
Choose the required storage class and the delay between the upload and transition dates. Set the Days after object creation to "0" to transition your artifacts as soon as TeamCity uploads them.
tip
TeamCity does not support archive storage classes since their files are not immediately available and require additional unpack/warmup actions before they can be fetched.
Enable additional rules for stored artifacts. For example, you can check Expire current versions of objects to label previously uploaded artifacts as expired, and Permanently delete noncurrent versions of objects to periodically clean your storage.
Specify the rule scope to choose whether it should apply to the entire storage or only those artifacts that match the required filter.
Review your rule at the bottom of the page. It may look like the following:
Amazon CloudFront is a content delivery network that offers low latency and high transfer speeds. Enabling its support for an S3 storage will allow TeamCity to transfer artifacts through the closest CloudFront server. If your S3 bucket is located in a different region than your TeamCity infrastructure, this could significantly speed up the artifacts' upload/download and reduce expenses.
tip
If you use EC2 build agents located in the same region as the target S3 bucket, these agents will communicate with the bucket directly, omitting CloudFront.
To quickly get an ID of an AWS Connection that should be used to retrieve a required bucket, navigate to the required Administration | <Your_Project> | Connections page.
Migrating Artifacts To a Different Storage
TeamCity server ships with a command-line tool that transfers build artifacts from one storage to another. You can download this tool on the Project Settings | Artifacts Storage page.
Currently, the tool supports the following migration routes:
From a local directory to an Amazon S3 bucket and vice versa
From one Amazon S3 bucket to another
We're working on supporting other cloud storage options as well.
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions. Learn more.
With your consent, JetBrains may also use cookies and your IP address to collect individual statistics and provide you with personalized offers and ads subject to the Privacy Notice and the Terms of Use. JetBrains may use third-party services for this purpose. You can adjust or withdraw your consent at any time by visiting the Opt-Out page.