-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #649 from aws-samples/fsx-restructure
Port FSxN lab to new workshop structure
- Loading branch information
Showing
17 changed files
with
129 additions
and
86 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/addon.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
module "fsxn_driver" { | ||
source = "github.com/NetApp/terraform-aws-netapp-fsxn-eks-addon.git?ref=v1.0" | ||
} | ||
|
||
data "aws_vpc" "selected_vpc_fsx" { | ||
tags = { | ||
created-by = "eks-workshop-v2" | ||
env = local.addon_context.eks_cluster_id | ||
} | ||
} | ||
|
||
data "aws_subnets" "private_subnets_fsx" { | ||
tags = { | ||
created-by = "eks-workshop-v2" | ||
env = local.addon_context.eks_cluster_id | ||
} | ||
|
||
filter { | ||
name = "tag:Name" | ||
values = ["*Private*"] | ||
} | ||
} | ||
|
||
resource "random_string" "fsx_password" { | ||
length = 10 | ||
special = false | ||
} | ||
|
||
data "aws_route_table" "private" { | ||
count = length(data.aws_subnets.private_subnets_fsx.ids) | ||
|
||
vpc_id = data.aws_vpc.selected_vpc_fsx.id | ||
subnet_id = data.aws_subnets.private_subnets_fsx.ids[count.index] | ||
} | ||
|
||
resource "aws_fsx_ontap_file_system" "fsxnassets" { | ||
storage_capacity = 2048 | ||
subnet_ids = slice(data.aws_subnets.private_subnets_fsx.ids, 0, 2) | ||
deployment_type = "MULTI_AZ_1" | ||
throughput_capacity = 512 | ||
preferred_subnet_id = data.aws_subnets.private_subnets_fsx.ids[0] | ||
security_group_ids = [aws_security_group.fsxn.id] | ||
fsx_admin_password = random_string.fsx_password.result | ||
route_table_ids = data.aws_route_table.private.*.id | ||
|
||
tags = merge( | ||
local.tags, | ||
{ | ||
Name = "${local.addon_context.eks_cluster_id}-fsxn-assets" | ||
} | ||
) | ||
} | ||
|
||
resource "aws_fsx_ontap_storage_virtual_machine" "fsxnsvm" { | ||
file_system_id = aws_fsx_ontap_file_system.fsxnassets.id | ||
name = "fsxnsvm" | ||
} | ||
|
||
resource "aws_security_group" "fsxn" { | ||
name_prefix = "security group for fsx access" | ||
vpc_id = data.aws_vpc.selected_vpc_fsx.id | ||
tags = merge( | ||
local.tags, | ||
{ | ||
Name = "${local.addon_context.eks_cluster_id}-fsxnsecuritygroup" | ||
} | ||
) | ||
} | ||
|
||
resource "aws_security_group_rule" "fsxn_inbound" { | ||
description = "allow inbound traffic to eks" | ||
from_port = 0 | ||
protocol = "-1" | ||
to_port = 0 | ||
security_group_id = aws_security_group.fsxn.id | ||
type = "ingress" | ||
cidr_blocks = [data.aws_vpc.selected_vpc_fsx.cidr_block] | ||
} | ||
|
||
resource "aws_security_group_rule" "fsxn_outbound" { | ||
description = "allow outbound traffic to anywhere" | ||
from_port = 0 | ||
protocol = "-1" | ||
security_group_id = aws_security_group.fsxn.id | ||
to_port = 0 | ||
type = "egress" | ||
cidr_blocks = [data.aws_vpc.selected_vpc_fsx.cidr_block] | ||
} | ||
|
||
output "environment" { | ||
value = <<EOF | ||
export FSXN_ID=${aws_fsx_ontap_file_system.fsxnassets.id} | ||
export FSXN_ADMIN_PASSWORD=${random_string.fsx_password.result} | ||
export FSXN_IP="${tolist(aws_fsx_ontap_file_system.fsxnassets.endpoints[0].management[0].ip_addresses)[0]}" | ||
EOF | ||
} |
23 changes: 0 additions & 23 deletions
23
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/locals.tf
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/main.tf
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/outputs.tf
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/variables.tf
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
manifests/modules/fundamentals/storage/fsxn/.workshop/terraform/versions.tf
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
manifests/modules/fundamentals/storage/fsxn/backend/config.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
FSXN_IP | ||
FSXN_IP | ||
FSXN_ADMIN_PASSWORD |
4 changes: 3 additions & 1 deletion
4
manifests/modules/fundamentals/storage/fsxn/backend/env-var-transformer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
varReference: | ||
- kind: TridentBackendConfig | ||
path: spec/managementLIF | ||
path: spec/managementLIF | ||
- kind: Secret | ||
path: stringData/password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ metadata: | |
type: Opaque | ||
stringData: | ||
username: fsxadmin | ||
password: Netapp1! | ||
password: $(FSXN_ADMIN_PASSWORD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
manifests/modules/fundamentals/storage/fsxn/deployment/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters