Skip to content

Commit

Permalink
Merge pull request #63 from NetApp/kerensMac
Browse files Browse the repository at this point in the history
Kerens mac
  • Loading branch information
kerentraht authored Jan 25, 2024
2 parents 101d54c + 02a1bd7 commit e94c35b
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:
# VALIDATE_MARKDOWN: true
# VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_POWERSHELL: true
VALIDATE_TERRAFORM_FMT: true
# VALIDATE_TERRAFORM_FMT: true
VALIDATE_YAML: true

12 changes: 6 additions & 6 deletions Terraform/deploy-fsx-ontap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,24 @@ terraform apply -y
|------|-------------|------|---------|:--------:|
| fsx_admin_password | The ONTAP administrative password for the fsxadmin user that you can use to administer your file system using the ONTAP CLI and REST API | `string` | n/a | yes |
| kms_key_id | ARN for the KMS Key to encrypt the file system at rest, Defaults to an AWS managed KMS Key. | `string` | n/a | yes |
| route_table_ids | Specifies the VPC route tables in which your file system's endpoints will be created. You should specify all VPC route tables associated with the subnets in which your clients are located. | `list` | n/a | yes |
| route_table_ids | Specifies the VPC route tables in which your file system's endpoints will be created. You should specify all VPC route tables associated with the subnets in which your clients are located. | `list(any)` | n/a | yes |
| backup_retention_days | The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days. | `number` | `0` | no |
| cidr_for_sg | cide block to be used for the ingress rules | `string` | `"0.0.0.0/0"` | no |
| create_sg | Determines whether the SG should be deployed as part of this execution or not | `bool` | `false` | no |
| daily_backup_start_time | A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set. | `string` | `"00:00"` | no |
| disk_iops_configuration | The SSD IOPS configuration for the Amazon FSx for NetApp ONTAP file system | `map` | <pre>{<br> "iops": 3000,<br> "mode": "AUTOMATIC"<br>}</pre> | no |
| disk_iops_configuration | The SSD IOPS configuration for the Amazon FSx for NetApp ONTAP file system | `map(any)` | <pre>{<br> "iops": 3000,<br> "mode": "AUTOMATIC"<br>}</pre> | no |
| fsx_capacity_size_gb | The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608 | `number` | `1024` | no |
| fsx_deploy_type | The filesystem deployment type. Supports MULTI_AZ_1 and SINGLE_AZ_1 | `string` | `"SINGLE_AZ_1"` | no |
| fsx_maintenance_start_time | The preferred start time (in d:HH:MM format) to perform weekly maintenance, in the UTC time zone. | `string` | `"00:00:00"` | no |
| fsx_name | The deployed filesystem name | `string` | `"terraform-fsxn"` | no |
| fsx_subnets | The IDs of the subnets fro which the FSxN filesystem will be assigned IP addresses | `map` | <pre>{<br> "primarysub": "",<br> "secondarysub": ""<br>}</pre> | no |
| fsx_subnets | The IDs of the subnets fro which the FSxN filesystem will be assigned IP addresses | `map(any)` | <pre>{<br> "primarysub": "",<br> "secondarysub": ""<br>}</pre> | no |
| fsx_tput_in_MBps | The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096. | `number` | `256` | no |
| root_vol_sec_style | Specifies the root volume security style, Valid values are UNIX, NTFS, and MIXED. All volumes created under this SVM will inherit the root security style unless the security style is specified on the volume. | `string` | `"UNIX"` | no |
| storage_type | The filesystem storage type | `string` | `"SSD"` | no |
| svm_name | The name of the Storage Virtual Machine | `string` | `"first_svm"` | no |
| tags | Tags to be applied to the resources | `map` | <pre>{<br> "Name": "terraform-fsxn"<br>}</pre> | no |
| vol_info | Details for the volume creation | `map` | <pre>{<br> "bypass_sl_retention": false,<br> "cooling_period": 31,<br> "copy_tags_to_backups": false,<br> "efficiency": true,<br> "junction_path": "/vol1",<br> "sec_style": "UNIX",<br> "size_mg": 1024,<br> "skip_final_backup": false,<br> "tier_policy_name": "AUTO",<br> "vol_name": "vol1",<br> "vol_type": "RW"<br>}</pre> | no |
| vol_snapshot_policy | Specifies the snapshot policy for the volume | `map` | <pre>{<br> "Name": "terraform-fsxn"<br>}</pre> | no |
| tags | Tags to be applied to the resources | `map(any)` | <pre>{<br> "Name": "terraform-fsxn"<br>}</pre> | no |
| vol_info | Details for the volume creation | `map(any)` | <pre>{<br> "bypass_sl_retention": false,<br> "cooling_period": 31,<br> "copy_tags_to_backups": false,<br> "efficiency": true,<br> "junction_path": "/vol1",<br> "sec_style": "UNIX",<br> "size_mg": 1024,<br> "skip_final_backup": false,<br> "tier_policy_name": "AUTO",<br> "vol_name": "vol1",<br> "vol_type": "RW"<br>}</pre> | no |
| vol_snapshot_policy | Specifies the snapshot policy for the volume | `map(any)` | <pre>{<br> "Name": "terraform-fsxn"<br>}</pre> | no |
| vpc_id | The ID of the VPC in which the FSxN fikesystem should be deployed | `string` | `"vpc-111111111"` | no |
### Outputs
Expand Down
22 changes: 9 additions & 13 deletions Terraform/deploy-fsx-ontap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ resource "aws_vpc_security_group_ingress_rule" "nfs_mount_udp" {
}

resource "aws_vpc_security_group_egress_rule" "allow_all_traffic" {
count = var.create_sg ? 1 : 0
count = var.create_sg ? 1 : 0
security_group_id = aws_security_group.fsx_sg[count.index].id
cidr_ipv4 = "0.0.0.0/0"
ip_protocol = "-1"
Expand All @@ -133,13 +133,10 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" {
preferred_subnet_id = var.fsx_subnets["primarysub"]

// OPTIONAL PARAMETERS
storage_capacity = var.fsx_capacity_size_gb
security_group_ids = var.create_sg ? [element(aws_security_group.fsx_sg.*.id, 0)] : []
deployment_type = var.fsx_deploy_type
throughput_capacity = var.fsx_tput_in_MBps
tags = {
Name = var.fsx_name
}
storage_capacity = var.fsx_capacity_size_gb
security_group_ids = var.create_sg ? [element(aws_security_group.fsx_sg.*.id, 0)] : []
deployment_type = var.fsx_deploy_type
throughput_capacity = var.fsx_tput_in_MBps
weekly_maintenance_start_time = var.fsx_maintenance_start_time
kms_key_id = var.kms_key_id
automatic_backup_retention_days = var.backup_retention_days
Expand All @@ -151,19 +148,18 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" {
}
fsx_admin_password = var.fsx_admin_password
route_table_ids = var.route_table_ids
tags = var.tags
# endpoint_ip_address_range = ""
}

resource "aws_fsx_ontap_storage_virtual_machine" "mysvm" {
// REQUIRED PARAMETERS
file_system_id = aws_fsx_ontap_file_system.terraform-fsxn.id
name = var.svm_name
file_system_id = aws_fsx_ontap_file_system.terraform-fsxn.id
name = var.svm_name

// OPTIONAL PARAMETERS
root_volume_security_style = var.root_vol_sec_style
tags = {
Name = var.svm_name
}
tags = var.tags
# active_directory_configuration {}
}

Expand Down
162 changes: 81 additions & 81 deletions Terraform/deploy-fsx-ontap/variables.tf
Original file line number Diff line number Diff line change
@@ -1,144 +1,144 @@
variable "create_sg" {
description = "Determines whether the SG should be deployed as part of this execution or not"
type = bool
default = false
description = "Determines whether the SG should be deployed as part of this execution or not"
type = bool
default = false
}

variable "cidr_for_sg" {
description = "cide block to be used for the ingress rules"
type = string
default = "0.0.0.0/0"
description = "cide block to be used for the ingress rules"
type = string
default = "0.0.0.0/0"
}

variable "fsx_name" {
description = "The deployed filesystem name"
type = string
default = "terraform-fsxn"
description = "The deployed filesystem name"
type = string
default = "terraform-fsxn"
}

variable "vpc_id" {
description = "The ID of the VPC in which the FSxN fikesystem should be deployed"
type = string
default = "vpc-111111111"
description = "The ID of the VPC in which the FSxN fikesystem should be deployed"
type = string
default = "vpc-111111111"
}

variable "fsx_subnets" {
description = "The IDs of the subnets fro which the FSxN filesystem will be assigned IP addresses"
type = map
default = {
"primarysub" = ""
"secondarysub" = ""
description = "The IDs of the subnets fro which the FSxN filesystem will be assigned IP addresses"
type = map(any)
default = {
"primarysub" = ""
"secondarysub" = ""
}
}

variable "fsx_capacity_size_gb" {
description = "The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608"
type = number
default = 1024
description = "The storage capacity (GiB) of the FSxN file system. Valid values between 1024 and 196608"
type = number
default = 1024
}

variable "fsx_deploy_type" {
description = "The filesystem deployment type. Supports MULTI_AZ_1 and SINGLE_AZ_1"
type = string
default = "SINGLE_AZ_1"
description = "The filesystem deployment type. Supports MULTI_AZ_1 and SINGLE_AZ_1"
type = string
default = "SINGLE_AZ_1"
}

variable "fsx_tput_in_MBps" {
description = "The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096."
type = number
default = 256
description = "The throughput capacity (in MBps) for the file system. Valid values are 128, 256, 512, 1024, 2048, and 4096."
type = number
default = 256
}

variable "fsx_maintenance_start_time" {
description = "The preferred start time (in d:HH:MM format) to perform weekly maintenance, in the UTC time zone."
type = string
default = "00:00:00"
description = "The preferred start time (in d:HH:MM format) to perform weekly maintenance, in the UTC time zone."
type = string
default = "00:00:00"
}

variable "kms_key_id" {
description = "ARN for the KMS Key to encrypt the file system at rest, Defaults to an AWS managed KMS Key."
type = string
description = "ARN for the KMS Key to encrypt the file system at rest, Defaults to an AWS managed KMS Key."
type = string
}

variable "backup_retention_days" {
description = "The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days."
type = number
default = 0
description = "The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days."
type = number
default = 0
}

variable "daily_backup_start_time" {
description = "A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set."
type = string
default = "00:00"
description = "A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. Requires automatic_backup_retention_days to be set."
type = string
default = "00:00"
}

variable "disk_iops_configuration" {
description = "The SSD IOPS configuration for the Amazon FSx for NetApp ONTAP file system"
type = map
default = {
"iops" = 3000
"mode" = "AUTOMATIC"
}
description = "The SSD IOPS configuration for the Amazon FSx for NetApp ONTAP file system"
type = map(any)
default = {
"iops" = 3000
"mode" = "AUTOMATIC"
}
}

variable "fsx_admin_password" {
description = "The ONTAP administrative password for the fsxadmin user that you can use to administer your file system using the ONTAP CLI and REST API"
type = string
description = "The ONTAP administrative password for the fsxadmin user that you can use to administer your file system using the ONTAP CLI and REST API"
type = string
}

variable "storage_type" {
description = "The filesystem storage type"
type = string
default = "SSD"
description = "The filesystem storage type"
type = string
default = "SSD"
}

variable "route_table_ids" {
description = "Specifies the VPC route tables in which your file system's endpoints will be created. You should specify all VPC route tables associated with the subnets in which your clients are located."
type = list
description = "Specifies the VPC route tables in which your file system's endpoints will be created. You should specify all VPC route tables associated with the subnets in which your clients are located."
type = list(any)
}

variable "svm_name" {
description = "The name of the Storage Virtual Machine"
type = string
default = "first_svm"
description = "The name of the Storage Virtual Machine"
type = string
default = "first_svm"
}

variable "root_vol_sec_style" {
description = "Specifies the root volume security style, Valid values are UNIX, NTFS, and MIXED. All volumes created under this SVM will inherit the root security style unless the security style is specified on the volume."
type = string
default = "UNIX"
description = "Specifies the root volume security style, Valid values are UNIX, NTFS, and MIXED. All volumes created under this SVM will inherit the root security style unless the security style is specified on the volume."
type = string
default = "UNIX"
}

variable "vol_info" {
description = "Details for the volume creation"
type = map
default = {
"vol_name" = "vol1"
"junction_path" = "/vol1"
"size_mg" = 1024
"efficiency" = true
"tier_policy_name" = "AUTO"
"cooling_period" = 31
"vol_type" = "RW"
"bypass_sl_retention" = false
"copy_tags_to_backups" = false
"sec_style" = "UNIX"
"skip_final_backup" = false
}
description = "Details for the volume creation"
type = map(any)
default = {
"vol_name" = "vol1"
"junction_path" = "/vol1"
"size_mg" = 1024
"efficiency" = true
"tier_policy_name" = "AUTO"
"cooling_period" = 31
"vol_type" = "RW"
"bypass_sl_retention" = false
"copy_tags_to_backups" = false
"sec_style" = "UNIX"
"skip_final_backup" = false
}
}

variable "vol_snapshot_policy" {
description = "Specifies the snapshot policy for the volume"
type = map
default = {
"Name" = "terraform-fsxn"
}
description = "Specifies the snapshot policy for the volume"
type = map(any)
default = {
"Name" = "terraform-fsxn"
}
}

variable "tags" {
description = "Tags to be applied to the resources"
type = map
default = {
"Name" = "terraform-fsxn"
}
description = "Tags to be applied to the resources"
type = map(any)
default = {
"Name" = "terraform-fsxn"
}
}

0 comments on commit e94c35b

Please sign in to comment.