Skip to content

Commit

Permalink
Merge pull request #73 from f5devcentral/gwlb4
Browse files Browse the repository at this point in the history
Gwlb4
  • Loading branch information
yossi-r authored Mar 3, 2021
2 parents 92e0390 + 61be8d2 commit 5ecb7b1
Show file tree
Hide file tree
Showing 20 changed files with 263 additions and 159 deletions.
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@ fileignoreconfig:
checksum: fafd6af57c6f67439afaf5e9493fb8e393a4a2fbe30252944c644264871e88a8
- filename: solutions/security/ingress-egress-inter-vpc-fw-gwlb/README.md
checksum: 5ed655b3812b7993ac0a6d074abece9ab2fc99c58f843d11376e9c7c10422814
- filename: modules/aws/terraform/gwlb-bigip-vpc/main.tf
checksum: 90999ce57eba4fafee5b4b64fb2102613594b09b76b8fbbfa00451aef6bf5cff
1 change: 0 additions & 1 deletion modules/aws/terraform/gwlb-bigip-vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ No requirements.
| allowedMgmtIps | n/a | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| awsAz1 | will use a dynamic az if left empty | `any` | `null` | no |
| awsAz2 | will use a dynamic az if left empty | `any` | `null` | no |
| awsRegion | n/a | `string` | `"us-west-2"` | no |
| bigipPassword | password for the bigip admin account | `any` | `null` | no |
| buildSuffix | random build suffix for tagging | `string` | `"f5-dcec"` | no |
| createGwlbEndpoint | Controls the creation of gwlb endpoints in the provided vpc, if true creates subnets and endpoints | `bool` | `false` | no |
Expand Down
8 changes: 5 additions & 3 deletions modules/aws/terraform/gwlb-bigip-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@

# VPCs

data "aws_region" "current" {}
data "aws_availability_zones" "available" {
state = "available"
}

data "aws_caller_identity" "current" {}

locals {
awsAz1 = var.awsAz1 != null ? var.awsAz1 : data.aws_availability_zones.available.names[0]
awsAz2 = var.awsAz2 != null ? var.awsAz1 : data.aws_availability_zones.available.names[1]
awsAz1 = var.awsAz1 != null ? var.awsAz1 : data.aws_availability_zones.available.names[0]
awsAz2 = var.awsAz2 != null ? var.awsAz1 : data.aws_availability_zones.available.names[1]
awsRegion = data.aws_region.current.name
}
resource "aws_vpc" "vpcGwlb" {
cidr_block = var.vpcCidr
Expand Down Expand Up @@ -238,7 +240,7 @@ resource "aws_iam_role_policy" "BigIpPolicy" {
"secretsmanager:UpdateSecretVersionStage"
],
"Resource": [
"arn:aws:secretsmanager:${var.awsRegion}:${data.aws_caller_identity.current.account_id}:secret:*"
"arn:aws:secretsmanager:${local.awsRegion}:${data.aws_caller_identity.current.account_id}:secret:*"
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions modules/aws/terraform/gwlb-bigip-vpc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ output "gwlbEndpointService" {
}
output "gwlbeAz1" {
description = "Id of the GWLB endpoint in AZ1"
value = aws_vpc_endpoint.vpcGwlbeAz1[0].id
value = length(aws_vpc_endpoint.vpcGwlbeAz1) > 0 ? aws_vpc_endpoint.vpcGwlbeAz1[0].id : null
}
output "gwlbeAz2" {
description = "Id of the GWLB endpoint in AZ2"
value = aws_vpc_endpoint.vpcGwlbeAz2[0].id
value = length(aws_vpc_endpoint.vpcGwlbeAz2) > 0 ? aws_vpc_endpoint.vpcGwlbeAz2[0].id : null
}
output "subnetGwlbeAz1" {
value = aws_subnet.subnetGwlbeAz1[0].id
value = length(aws_subnet.subnetGwlbeAz1) > 0 ? aws_subnet.subnetGwlbeAz1[0].id : null
}
output "subnetGwlbeAz2" {
value = aws_subnet.subnetGwlbeAz2[0].id
value = length(aws_subnet.subnetGwlbeAz2) > 0 ? aws_subnet.subnetGwlbeAz2[0].id : null
}
3 changes: 0 additions & 3 deletions modules/aws/terraform/gwlb-bigip-vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ variable "awsAz2" {
description = "will use a dynamic az if left empty"
default = null
}
variable "awsRegion" {
default = "us-west-2"
}
variable "keyName" {
default = null
}
Expand Down
29 changes: 0 additions & 29 deletions solutions/security/gwlb-ingress-fw/DO_1nic.json

This file was deleted.

66 changes: 0 additions & 66 deletions solutions/security/gwlb-ingress-fw/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions solutions/security/gwlb-ingress-fw/outputs.tf

This file was deleted.

42 changes: 0 additions & 42 deletions solutions/security/gwlb-ingress-fw/variables.tf

This file was deleted.

Loading

0 comments on commit 5ecb7b1

Please sign in to comment.