Skip to content

Commit

Permalink
feat: update tf.checks step name and tf and aws version (#37)
Browse files Browse the repository at this point in the history
* feat: update tf.checks step name and tf and aws version

* feat: update tf.checks step name and tf and aws version

* feat: update tf.checks step name and tf and aws version

* feat: update tf.checks step name and tf and aws version

---------

Co-authored-by: anmolnagpal <anmol@clouddrove.com>
  • Loading branch information
theprashantyadav and anmolnagpal committed Jan 9, 2024
1 parent 1eac805 commit b962617
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'example / Evaluate Terraform versions (1.5.0, ./_example/public)'
tfcheck: 'public / Check code format'
...
6 changes: 5 additions & 1 deletion .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ on:
pull_request:
workflow_dispatch:
jobs:
example:
public:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9
with:
working_directory: './_example/public'
vpc:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9
with:
working_directory: './_example/vpc'
4 changes: 2 additions & 2 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
workflow_dispatch:
jobs:
tflint:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.9
secrets:
GITHUB: ${{ secrets.GITHUB }}
GITHUB: ${{ secrets.GITHUB }}
1 change: 0 additions & 1 deletion _example/public/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module "sftp" {
label_order = ["environment", "name"]
enable_sftp = true
s3_bucket_name = module.s3_bucket.id
endpoint_type = "PUBLIC"
workflow_details = {
on_upload = {
execution_role = "arn:aws:iam::1234567890:role/test-sftp-transfer-role"
Expand Down
14 changes: 0 additions & 14 deletions _example/public/variables.tf
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
variable "sftp_users" {
type = list(object({
username = string
password = string
home_dir = string
}))
default = []
}

variable "eip_enabled" {
type = bool
description = "Whether to provision and attach an Elastic IP to be used as the SFTP endpoint. An EIP will be provisioned per subnet."
default = false
}
4 changes: 2 additions & 2 deletions _example/public/versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.6.6"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
version = ">= 5.31.0"
}
}
}
1 change: 0 additions & 1 deletion _example/vpc/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ module "sftp" {
label_order = ["environment", "name"]
eip_enabled = false
s3_bucket_name = module.s3_bucket.id
sftp_users = var.sftp_users
subnet_ids = module.subnets.private_subnet_id
vpc_id = module.vpc.vpc_id
restricted_home = true
Expand Down
31 changes: 0 additions & 31 deletions _example/vpc/variables.tf
Original file line number Diff line number Diff line change
@@ -1,31 +0,0 @@
variable "sftp_users" {
type = list(object({
username = string
password = string
home_dir = string
}))
default = []
}

variable "eip_enabled" {
type = bool
description = "Whether to provision and attach an Elastic IP to be used as the SFTP endpoint. An EIP will be provisioned per subnet."
default = false
}


variable "workflow_details" {
type = object({
on_upload = object({
execution_role = string
workflow_id = string
})
})
description = "Workflow details for triggering the execution on file upload."
default = {
on_upload = {
execution_role = null
workflow_id = null
}
}
}
4 changes: 2 additions & 2 deletions _example/vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.6.6"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
version = ">= 5.31.0"
}
}
}
5 changes: 1 addition & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ module "labels" {
# LOCALS
##----------------------------------------------------------------------------------
locals {
count = var.enabled
s3_arn_prefix = "arn:${one(data.aws_partition.default[*].partition)}:s3:::"
is_vpc = var.vpc_id != null

user_names = length(var.sftp_users) > 0 ? [for user in var.sftp_users : user.user_name] : []

user_names_map = length(var.sftp_users) > 0 ? {
for user in var.sftp_users :
user.user_name => merge(user, {
Expand Down Expand Up @@ -201,7 +198,7 @@ resource "aws_transfer_server" "transfer_server" {
subnet_ids = var.subnet_ids
security_group_ids = var.vpc_security_group_ids
vpc_id = var.vpc_id
address_allocation_ids = var.eip_enabled ? aws_eip.sftp.*.id : var.address_allocation_ids
address_allocation_ids = var.eip_enabled ? aws_eip.sftp[*].id : var.address_allocation_ids
}
}
lifecycle {
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,4 @@ variable "workflow_details" {
variable "enable_workflow" {
type = bool
default = false
}

variable "endpoint_type" {
type = string
default = "PUBLIC"
description = "The type of endpoint that you want your SFTP server connect to. If you connect to a VPC (or VPC_ENDPOINT), your SFTP server isn't accessible over the public internet. If you want to connect your SFTP server via public internet, set PUBLIC. Defaults to PUBLIC"
}
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.6.6"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
version = ">= 5.31.0"
}
}
}

0 comments on commit b962617

Please sign in to comment.