Skip to content

Commit

Permalink
Groundwork new workflows (#122)
Browse files Browse the repository at this point in the history
* Groundwork new workflows

* fix regex
  • Loading branch information
max-lobur authored Mar 28, 2023
1 parent c568530 commit f5ba5bd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down Expand Up @@ -401,7 +401,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]

<!-- markdownlint-disable -->
[logo]: https://cloudposse.com/logo-300x69.svg
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-efs&utm_content=docs
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-efs&utm_content=website
Expand Down Expand Up @@ -432,3 +432,4 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-efs
[share_email]: mailto:?subject=terraform-aws-efs&body=https://github.com/cloudposse/terraform-aws-efs
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-efs?pixel&cs=github&cm=readme&an=terraform-aws-efs
<!-- markdownlint-restore -->
9 changes: 0 additions & 9 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,3 @@ variable "availability_zones" {
error_message = "Availability zones must be greater than zero."
}
}

variable "security_group_suffix" {
type = string
default = ""
description = <<-EOT
DEPRECATED: Use the module's attributes instead.
A suffix of `efs` was used in versions 0.30.1 and earlier.
EOT
}
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
enabled = module.this.enabled
security_group_enabled = local.enabled && var.create_security_group

dns_name = format("%s.efs.%s.amazonaws.com", join("", aws_efs_file_system.default.*.id), var.region)
dns_name = format("%s.efs.%s.amazonaws.com", join("", aws_efs_file_system.default[*].id), var.region)
# Returning null in the lookup function gives type errors and is not omitting the parameter.
# This work around ensures null is returned.
posix_users = {
Expand Down Expand Up @@ -43,7 +43,7 @@ resource "aws_efs_file_system" "default" {

resource "aws_efs_mount_target" "default" {
count = local.enabled && length(var.subnets) > 0 ? length(var.subnets) : 0
file_system_id = join("", aws_efs_file_system.default.*.id)
file_system_id = join("", aws_efs_file_system.default[*].id)
ip_address = var.mount_target_ip_address
subnet_id = var.subnets[count.index]
security_groups = compact(
Expand All @@ -57,7 +57,7 @@ resource "aws_efs_mount_target" "default" {
resource "aws_efs_access_point" "default" {
for_each = local.enabled ? var.access_points : {}

file_system_id = join("", aws_efs_file_system.default.*.id)
file_system_id = join("", aws_efs_file_system.default[*].id)

dynamic "posix_user" {
for_each = local.posix_users[each.key] != null ? ["true"] : []
Expand Down Expand Up @@ -136,7 +136,7 @@ module "dns" {
resource "aws_efs_backup_policy" "policy" {
count = module.this.enabled ? 1 : 0

file_system_id = join("", aws_efs_file_system.default.*.id)
file_system_id = join("", aws_efs_file_system.default[*].id)

backup_policy {
status = var.efs_backup_policy_enabled ? "ENABLED" : "DISABLED"
Expand Down
12 changes: 6 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ output "access_point_ids" {
}

output "arn" {
value = local.enabled ? join("", aws_efs_file_system.default.*.arn) : null
value = local.enabled ? join("", aws_efs_file_system.default[*].arn) : null
description = "EFS ARN"
}

output "id" {
value = local.enabled ? join("", aws_efs_file_system.default.*.id) : null
value = local.enabled ? join("", aws_efs_file_system.default[*].id) : null
description = "EFS ID"
}

Expand All @@ -29,22 +29,22 @@ output "dns_name" {
}

output "mount_target_dns_names" {
value = local.enabled ? coalescelist(aws_efs_mount_target.default.*.mount_target_dns_name, [""]) : null
value = local.enabled ? coalescelist(aws_efs_mount_target.default[*].mount_target_dns_name, [""]) : null
description = "List of EFS mount target DNS names"
}

output "mount_target_ids" {
value = local.enabled ? coalescelist(aws_efs_mount_target.default.*.id, [""]) : null
value = local.enabled ? coalescelist(aws_efs_mount_target.default[*].id, [""]) : null
description = "List of EFS mount target IDs (one per Availability Zone)"
}

output "mount_target_ips" {
value = local.enabled ? coalescelist(aws_efs_mount_target.default.*.ip_address, [""]) : null
value = local.enabled ? coalescelist(aws_efs_mount_target.default[*].ip_address, [""]) : null
description = "List of EFS mount target IPs (one per Availability Zone)"
}

output "network_interface_ids" {
value = local.enabled ? coalescelist(aws_efs_mount_target.default.*.network_interface_id, [""]) : null
value = local.enabled ? coalescelist(aws_efs_mount_target.default[*].network_interface_id, [""]) : null
description = "List of mount target network interface IDs"
}

Expand Down

0 comments on commit f5ba5bd

Please sign in to comment.