Skip to content

Commit 59eda4c

Browse files
authored
fix: remove ip address variables (#8)
1 parent 77598ab commit 59eda4c

File tree

4 files changed

+1
-28
lines changed

4 files changed

+1
-28
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This module creates all the proper policies, roles and S3 buckets so that Fullstory can connect to the Redshift Cluster or Workgroup and load data. For more information checkout [this KB article](https://help.fullstory.com/hc/en-us/articles/18791516308887-Amazon-Redshift).
88

9-
**This module does not** create the permissions in your database that are required for Fullstory to create schemas. See [this guide](https://help.fullstory.com/hc/en-us/articles/18791516308887-Amazon-Redshift#h_01HNGMBXC344AM02MR35QFZJ2T) for instructions on how to grant your IAM role the correct permissions on your database objects.
9+
**This module does not** create the permissions in your database that are required for Fullstory to create schemas nor does it add security groups to your cluster or workgroup. See [this guide](https://help.fullstory.com/hc/en-us/articles/18791516308887-Amazon-Redshift#h_01HNGMBXC344AM02MR35QFZJ2T) for instructions on how to grant your IAM role the correct permissions on your database objects.
1010

1111
<!-- BEGIN_TF_DOCS -->
1212
## Requirements
@@ -22,7 +22,6 @@ This module creates all the proper policies, roles and S3 buckets so that Fullst
2222
|------|-------------|------|---------|:--------:|
2323
| <a name="input_cluster_identifier"></a> [cluster\_identifier](#input\_cluster\_identifier) | The identifier of the Redshift cluster. Required if you are using Redshift provisioned. | `string` | `""` | no |
2424
| <a name="input_database_arn"></a> [database\_arn](#input\_database\_arn) | The ARN of the database within Redshift cluster. Required if you are using Redshift provisioned. This is not the cluster ARN, see https://docs.aws.amazon.com/redshift/latest/mgmt/generating-iam-credentials-role-permissions.html for more information. | `string` | `""` | no |
25-
| <a name="input_fullstory_cidr_ipv4s"></a> [fullstory\_cidr\_ipv4s](#input\_fullstory\_cidr\_ipv4s) | The CIDR block that Fullstory will use to connect to the Redshift cluster. | `list(string)` | `[]` | no |
2625
| <a name="input_fullstory_data_center"></a> [fullstory\_data\_center](#input\_fullstory\_data\_center) | The data center where your Fullstory account is hosted. Either 'NA1' or 'EU1'. See https://help.fullstory.com/hc/en-us/articles/8901113940375-Fullstory-Data-Residency for more information. | `string` | `"NA1"` | no |
2726
| <a name="input_fullstory_google_audience"></a> [fullstory\_google\_audience](#input\_fullstory\_google\_audience) | The Google audience identifier that Fullstory will use to assume the role in order to call AWS APIs | `string` | `""` | no |
2827
| <a name="input_is_serverless"></a> [is\_serverless](#input\_is\_serverless) | Whether the Redshift cluster is serverless or not. If true, workgroup\_arn is required. If false, database\_arn is required. | `bool` | n/a | yes |

main.tf

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
locals {
2-
fullstory_cidr_ipv4s = length(var.fullstory_cidr_ipv4s) > 0 ? var.fullstory_cidr_ipv4s : (var.fullstory_data_center == "EU1" ? ["34.89.210.80/29"] : ["8.35.195.0/29"])
32
fullstory_google_audience = var.fullstory_google_audience != "" ? var.fullstory_google_audience : (var.fullstory_data_center == "EU1" ? "107589159240321051166" : "116984388253902328461")
43
}
54

65
data "aws_vpc" "main" {
76
id = var.vpc_id
87
}
98

10-
resource "aws_security_group" "allow_fullstory_ips" {
11-
name = "${var.prefix}-allow-fullstory-ips"
12-
description = "Allow Redshift traffic from Fullstory IPs"
13-
vpc_id = var.vpc_id
14-
}
15-
16-
resource "aws_vpc_security_group_ingress_rule" "allow_fullstory_ips" {
17-
count = length(local.fullstory_cidr_ipv4s)
18-
security_group_id = aws_security_group.allow_fullstory_ips.id
19-
cidr_ipv4 = local.fullstory_cidr_ipv4s[count.index]
20-
ip_protocol = "tcp"
21-
from_port = var.port
22-
to_port = var.port
23-
}
24-
259
resource "aws_iam_role" "main" {
2610
name = "${var.prefix}_redshift_setup"
2711
assume_role_policy = jsonencode({

main.tftest.hcl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ run "valid_serverless_minimal_details" {
1010
is_serverless = true
1111
}
1212

13-
assert {
14-
condition = aws_vpc_security_group_ingress_rule.allow_fullstory_ips[0].cidr_ipv4 == "8.35.195.0/29"
15-
error_message = "default cidr block is wrong"
16-
}
1713
assert {
1814
condition = jsondecode(aws_iam_role.main.assume_role_policy).Statement[0].Condition.StringEquals["accounts.google.com:aud"] == "116984388253902328461"
1915
error_message = "default oauth id is wrong"

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ variable "cluster_identifier" {
1414
default = ""
1515
}
1616

17-
variable "fullstory_cidr_ipv4s" {
18-
type = list(string)
19-
description = "The CIDR block that Fullstory will use to connect to the Redshift cluster."
20-
default = []
21-
}
22-
2317
variable "fullstory_google_audience" {
2418
type = string
2519
description = "The Google audience identifier that Fullstory will use to assume the role in order to call AWS APIs"

0 commit comments

Comments
 (0)