Skip to main content
Version: 1.26.6

AWS Velero

This terraform module provides an easy way to generate Velero required cloud resources (S3 and IAM) to backup Kubernetes objects and trigger volume snapshots.

Requirements​

NameVersion
terraform0.15.4
aws3.37.0

Providers​

NameVersion
aws3.37.0

Resources​

NameType
aws_iam_access_key.velero_backupresource
aws_iam_policy.velero_backupresource
aws_iam_policy_attachment.velero_backupresource
aws_iam_role.velero_backupresource
aws_iam_role_policy_attachment.velero_backupresource
aws_iam_user.velero_backup_userresource
aws_s3_bucket.backup_bucketresource
aws_caller_identity.currentdata source

Inputs​

NameDescriptionTypeDefaultRequired
backup_bucket_nameBackup Bucket Namestringn/ayes
oidc_provider_urlURL of OIDC issuer discovery documentstring""no
tagsCustom tags to apply to resourcesmap(string){}no

Outputs​

NameDescription
backup_storage_locationVelero Cloud BackupStorageLocation CRD
cloud_credentialsVelero required file with credentials
service_accountVelero ServiceAccount
volume_snapshot_locationVelero Cloud VolumeSnapshotLocation CRD

Usage​

module "velero" {
source = "../vendor/modules/aws-velero"
backup_bucket_name = "my-cluster-staging-velero"
tags = {
"my-key": "my-value"
}
}

To use IAM Roles for Service Accounts (IRSA):

data "aws_eks_cluster" "this" {
name = "my-cluster-staging"
}

module "velero" {
source = "../vendor/modules/aws-velero"
backup_bucket_name = "my-cluster-staging-velero"
oidc_provider_url = replace(data.aws_eks_cluster.this.identity.0.oidc.0.issuer, "https://", "")
tags = {
"my-key": "my-value"
}
}

For more information about IAM Roles for Service Accounts to inject AWS credentials inside Velero's pods, click here