Skip to content

Commit

Permalink
Add support for loggroup ARN's in Transfer Server (#18)
Browse files Browse the repository at this point in the history
* Update main.tf

* Add Loggroup variable

* fix: Correct name of variable

* Code Cleanup
  • Loading branch information
oc-christopher-billett committed May 1, 2024
1 parent 7f7ae4f commit 7197763
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ To create any user to connect to this AWS Transfer server, use [this other modul
| <a name="input_python_runtime"></a> [python\_runtime](#input\_python\_runtime) | Python version used for lambda function | `string` | `"python3.7"` | no |
| <a name="input_region"></a> [region](#input\_region) | AWS Region | `string` | n/a | yes |
| <a name="input_secrets_prefix"></a> [secrets\_prefix](#input\_secrets\_prefix) | Prefix used to create AWS Secrets | `string` | `"SFTP"` | no |
| <a name="input_server_loggroup_arns"></a> [server\_loggroup\_arns](#input\_server\_loggroup\_arns) | List of LogGroup arns for Transfer Server | `list(any)` | `[]` | no |
| <a name="input_xray_enabled"></a> [xray\_enabled](#input\_xray\_enabled) | Bool to determine if Xray tracing is enabled | `bool` | `false` | no |

## Outputs
Expand Down
7 changes: 7 additions & 0 deletions inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ variable "custom_log_group_name" {
type = string
default = ""
}

variable "apigw_caching_enable" {
description = "Bool to enable the cache in the APIGW"
type = bool
default = false
}

variable "server_loggroup_arns" {
description = "List of LogGroup arns for Transfer Server"
type = list(any)
default = []
}
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ POLICY
}

resource "aws_transfer_server" "sftp_transfer_server" {
identity_provider_type = "API_GATEWAY"
logging_role = aws_iam_role.sftp_transfer_server.arn
invocation_role = aws_iam_role.sftp_transfer_server_invocation.arn
url = aws_api_gateway_stage.prod.invoke_url
identity_provider_type = "API_GATEWAY"
logging_role = aws_iam_role.sftp_transfer_server.arn
invocation_role = aws_iam_role.sftp_transfer_server_invocation.arn
url = aws_api_gateway_stage.prod.invoke_url
structured_log_destinations = var.server_loggroup_arns

tags = merge(
var.input_tags,
Expand Down

0 comments on commit 7197763

Please sign in to comment.