Skip to content

Commit

Permalink
chore: add example for transition_to_archive and remove from common r…
Browse files Browse the repository at this point in the history
…eadme

transition_to_archive don't work with provisioned throughput_mode
  • Loading branch information
glavk committed Jan 19, 2024
1 parent 531a3b3 commit 624fd3c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module "efs" {
lifecycle_policy = {
transition_to_ia = "AFTER_30_DAYS"
transition_to_archive = "AFTER_60_DAYS"
}
# File system policy
Expand Down
1 change: 1 addition & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Note that this example may create resources which will incur monetary charges on
| Name | Source | Version |
|------|--------|---------|
| <a name="module_efs"></a> [efs](#module\_efs) | ../.. | n/a |
| <a name="module_efs_archive"></a> [efs\_archive](#module\_efs\_archive) | ../.. | n/a |
| <a name="module_efs_default"></a> [efs\_default](#module\_efs\_default) | ../.. | n/a |
| <a name="module_efs_disabled"></a> [efs\_disabled](#module\_efs\_disabled) | ../.. | n/a |
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-aws-modules/kms/aws | ~> 1.0 |
Expand Down
84 changes: 84 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,90 @@ module "efs" {
tags = local.tags
}

module "efs_archive" {
source = "../.."

# File system
name = local.name
creation_token = local.name
encrypted = true
kms_key_arn = module.kms.key_arn

performance_mode = "maxIO"
throughput_mode = "elastic"

lifecycle_policy = {
transition_to_archive = "AFTER_60_DAYS"
transition_to_ia = "AFTER_30_DAYS"
transition_to_primary_storage_class = "AFTER_1_ACCESS"
}

# File system policy
attach_policy = true
bypass_policy_lockout_safety_check = false
policy_statements = [
{
sid = "Example"
actions = ["elasticfilesystem:ClientMount"]
principals = [
{
type = "AWS"
identifiers = [data.aws_caller_identity.current.arn]
}
]
}
]

# Mount targets / security group
mount_targets = { for k, v in zipmap(local.azs, module.vpc.private_subnets) : k => { subnet_id = v } }
security_group_description = "Example EFS security group"
security_group_vpc_id = module.vpc.vpc_id
security_group_rules = {
vpc = {
# relying on the defaults provdied for EFS/NFS (2049/TCP + ingress)
description = "NFS ingress from VPC private subnets"
cidr_blocks = module.vpc.private_subnets_cidr_blocks
}
}

# Access point(s)
access_points = {
posix_example = {
name = "posix-example"
posix_user = {
gid = 1001
uid = 1001
secondary_gids = [1002]
}

tags = {
Additionl = "yes"
}
}
root_example = {
root_directory = {
path = "/example"
creation_info = {
owner_gid = 1001
owner_uid = 1001
permissions = "755"
}
}
}
}

# Backup policy
enable_backup_policy = true

# Replication configuration
create_replication_configuration = true
replication_configuration_destination = {
region = "eu-west-2"
}

tags = local.tags
}

module "efs_default" {
source = "../.."

Expand Down

0 comments on commit 624fd3c

Please sign in to comment.