Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for argument availability_zone_name #89

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
resource "aws_efs_file_system" "default" {
count = module.this.enabled ? 1 : 0
tags = module.this.tags
availability_zone_name = var.availability_zone_name
Copy link

@bridgecrew bridgecrew bot Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW   Amazon EFS does not have an AWS Backup backup plan
    Resource: aws_efs_file_system.default | ID: BC_AWS_GENERAL_48

How to Fix

resource "aws_backup_plan" "example" {
  name = "tf_example_backup_plan"

  rule {
    rule_name         = "tf_example_backup_rule"
    target_vault_name = aws_backup_vault.test.name
    schedule          = "cron(0 12 * * ? *)"
  }

  advanced_backup_setting {
    backup_options = {
      WindowsVSS = "enabled"
    }
    resource_type = "EC2"
  }
}

resource "aws_backup_selection" "ok_backup" {
  iam_role_arn = aws_iam_role.example.arn
  name         = "tf_example_backup_selection"
  plan_id      = aws_backup_plan.example.id

  resources = [
    aws_db_instance.example.arn,
    aws_ebs_volume.example.arn,
    aws_efs_file_system.ok_efs.arn,
  ]
}

resource "aws_efs_file_system" "ok_efs" {
  creation_token = "my-product"

  tags = {
    Name = "MyProduct"
  }
}



Description

Ensure that Elastic File System (Amazon EFS) file systems are included in your backup plans for the AWS Backup.

Dependent Resources



Path Resource Connecting Attribute
/main.tf aws_efs_mount_target.default file_system_id
/main.tf aws_efs_access_point.default file_system_id

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auebergang can you do us a favor and add the following above line 7?

#bridgecrew:skip=BC_AWS_GENERAL_48 - Skipping as backup plan can be added via https://github.com/cloudposse/terraform-aws-backup

See here for an example: https://github.com/cloudposse/terraform-aws-alb/blob/master/main.tf#L140

encrypted = var.encrypted
kms_key_id = var.kms_key_id
performance_mode = var.performance_mode
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,9 @@ variable "transition_to_ia" {
description = "Indicates how long it takes to transition files to the IA storage class. Valid values: AFTER_7_DAYS, AFTER_14_DAYS, AFTER_30_DAYS, AFTER_60_DAYS and AFTER_90_DAYS"
default = ""
}

variable "availability_zone_name" {
type = string
description = "AWS Availability Zone in which to create the file system. Used to create a file system that uses One Zone storage classes."
default = null
}