azure-devops-repository-archiver
Project description
Azure DevOps Git Repository Archiver
Allows to backup regularly git repositories hosted in Azure DevOps to an S3 Bucket.
Features
The S3 bucket is configured as below
-
enabled versioning of objects
-
enabled encryption using an S3 managed Key
-
disallowing publich access
-
A lifecycle configuration for the archived repositories. They transistion through different storage classes
- Infrequent Access after 30 days
- Glacier after 90 days
- Deep Archive 180 days
- Expiry after 365 days
The CodeBuild projects are configured as below
-
Logging to CloudWatch
- Configurable retention period. Default is one month.
- Encryption using customer-managed KMS key
-
Notifications to SNS about uploaded objects
Planned Features
- Tagging of created AWS resources
Prerequisites
The connection to the Azure DevOps organization requires a personal access token. The PAT needs to have "Code read" permission and stored in a SecretsManager secret
aws secretsmanager create-secret --name rwest_archiver_rwest_platform --description "RWEST Archiver for RWEST-Platform organization" --secret-string "{\"pat\":\"<your_pat>\"}"
Example (Typescript)
-
Add the library to your dependencies, e.g to the
package.json
file"dependencies": { [...], "azure-devops-repository-archiver": "0.0.9", },
-
Per
BackupConfiguration
a secret containing the Azure DevOps PAT needs to be specified. It can e.g. be importedconst secret = Secret.fromSecretAttributes(this, 'azure-devops-pat', { secretCompleteArn: 'arn:aws:secretsmanager:eu-central-1:<aws_account_id>:secret:<secret_name>', });
-
When creating the construct the required
BackupConfiguration
s can be passed as below. The grouping is per organization and project.const backupConfigurations: BackupConfiguration[] = [ { organizationName: 'MyOrganization', projectName: 'project-1', repositoryNames: [ 'repository-1-a', 'repository-1-b', ], secretArn: secret.secretArn, }, { organizationName: 'MyOrganization', projectName: 'project-2', repositoryNames: [ 'repository-2-a', 'repository-2-b', ], secretArn: secret.secretArn, }, ]
-
The archiver properties and the archiver can then be created as
const archiverProps: ArchiverProperties = { retention: RetentionDays.ONE_WEEK, backupConfigurations: backupConfigurations, }; new Archiver(this, 'archiver', archiverProps);
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for azure-devops-repository-archiver-0.0.23.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d0c56a0f454e87e9cd3a052cb5accb23623079cc6a205f1a3e75d97ca81374b |
|
MD5 | 0bf25451ea211645323acd1657dfe48d |
|
BLAKE2b-256 | 1cf4cd0145a315d2839d933ed722c47c05109f25069f1400b702edace145d2c0 |
Hashes for azure_devops_repository_archiver-0.0.23-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 862f90580adcf63a89b04036dcac38c4537064fca125a83146872d98d836a146 |
|
MD5 | 9bb4342157f7bdbeb13e76fcb1f2e26f |
|
BLAKE2b-256 | 816f753cb20599d8380d350c4f1e3724871ad5d26452803d1602e32eb4b8ccad |