Skip to content

AWS EFS Terraform module for Rackspace customers

License

Notifications You must be signed in to change notification settings

rackspace-infrastructure-automation/aws-terraform-efs

Repository files navigation

aws-terraform-efs

This module sets up a basic Elastic File System on AWS for an account in a specific region.

Basic Usage

module "efs" {
  source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-efs//?ref=v0.0.7"

  encrypted       = "false"
  name            = "EFSTest-minimal-options-unencrypted"
  security_groups = ["${aws_security_group.efs.id}"]
  vpc_id          = "${module.vpc.vpc_id}"
}

Full working references are available at examples

Other TF Modules Used

Using aws-terraform-cloudwatch_alarm to create the following CloudWatch Alarms: - efs_burst_credits

Terraform 0.12 upgrade

Several changes were required while adding terraform 0.12 compatibility. The following changes should be
made when upgrading from a previous release to version 0.12.0 or higher.

Module variables

The following module variables were updated to better meet current Rackspace style guides:

  • custom_tags -> tags
  • create_internal_dns_record -> create_internal_zone_record

Requirements

Name Version
terraform >= 0.12
aws >= 2.7.0

Providers

Name Version
aws >= 2.7.0

Modules

Name Source Version
efs_burst_credits git@github.com:rackspace-infrastructure-automation/aws-terraform-cloudwatch_alarm//?ref=v0.12.6

Resources

Name
aws_caller_identity
aws_efs_file_system
aws_efs_mount_target
aws_region
aws_route53_record
aws_ssm_parameter

Inputs

Name Description Type Default Required
create_internal_zone_record Create Route 53 internal zone record for the resource Default is "false". bool false no
create_parameter_store_entries Whether or not to create EC2 Parameter Store entries to expose the EFS DNS name and Filesystem ID. bool true no
cw_burst_credit_period The number of periods over which the EFS Burst Credit level is compared to the specified threshold. number 12 no
cw_burst_credit_threshold The minimum EFS Burst Credit level before generating an alarm. number 1000000000000 no
encrypted Whether or not the disk should be encrypted. bool true no
environment A field used to set the Environment tag on created resources. string "Development" no
internal_record_name Record Name for the new Resource Record in the Internal Hosted Zone. string "" no
internal_zone_id The zone id for the internal records i.e. Z2QHD5YD1WXE9M string "" no
kms_key_arn The ARN for the KMS key to use for encrypting the disk. If specified, encrypted must be set to "true". If left<br>blank and encryptedis set to \"true\", Terraform will use the defaultaws/elasticfilesystem KMS key.<br> string "" no
mount_target_subnets Subnets in which the EFS mount target will be created. list(string) [] no
mount_target_subnets_count Number of mount_target_subnets (workaround for count not working fully within modules) number 0 no
name A Name prefix to use for created resources string n/a yes
notification_topic The SNS topic to use for customer notifications. list(string) [] no
performance_mode The file system performance mode. Can be either "generalPurpose" or "maxIO". string "generalPurpose" no
provisioned_throughput_in_mibps The throughput, measured in MiB/s, that you want to provision for the file system.
NOTE: Setting a non-zero value will automatically enable "provisioned" throughput mode. To use "bursting"
throughput mode, leave this value set to \"0\".<br>
number 0 no
rackspace_alarms_enabled Specifies whether alarms will create a Rackspace ticket. Ignored if rackspace_managed is set to false. bool false no
rackspace_managed Boolean parameter controlling if instance will be fully managed by Rackspace support teams, created CloudWatch alarms that generate tickets, and utilize Rackspace managed SSM documents. bool true no
security_groups List of security groups to apply to created resources. list(string) n/a yes
tags A mapping of tags applied to resources created by the module map(string) {} no
vpc_id The VPC ID where resources should be created. string n/a yes

Outputs

Name Description
filesystem_arn The ARN for the filesystem
filesystem_dns_name The DNS name for the filesystem
filesystem_dns_name_ssm_parameter Name of the SSM parameter containing the captured filesystem DNS name
filesystem_id The ID that identifies the file system
filesystem_id_ssm_parameter Name of the SSM parameter containing the captured filesystem ID
mount_target_dns_name The DNS name for the mount target in a given subnet/AZ
mount_target_id The ID of the mount target
mount_target_internal_r53_record Internal Route 53 record FQDN for the EFS mount target
mount_target_network_interface_id The ID of the network interface automatically created for the mount target