Skip to content

Commit

Permalink
Remove imports for WAFs
Browse files Browse the repository at this point in the history
  • Loading branch information
theseanything committed Jan 27, 2025
1 parent f41a8bf commit 195fe2b
Showing 1 changed file with 0 additions and 111 deletions.
111 changes: 0 additions & 111 deletions terraform/deployments/govuk-publishing-infrastructure/wafs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -587,114 +587,3 @@ resource "aws_wafv2_web_acl_logging_configuration" "public_cache_waf" {
}
}
}

# Import existing resources - using the data object retrieve the exsiting WAF ids

data "aws_wafv2_ip_set" "existing_govuk_requesting_ips" {
name = "govuk_requesting_ips"
scope = "REGIONAL"
}

import {
to = aws_wafv2_ip_set.govuk_requesting_ips
id = "${data.aws_wafv2_ip_set.existing_govuk_requesting_ips.id}/govuk_requesting_ips/REGIONAL"
}

data "aws_wafv2_ip_set" "existing_high_request_rate" {
name = "high_request_rate"
scope = "REGIONAL"
}

import {
to = aws_wafv2_ip_set.high_request_rate
id = "${data.aws_wafv2_ip_set.existing_high_request_rate.id}/high_request_rate/REGIONAL"
}

data "aws_wafv2_web_acl" "existing_default" {
name = "x-always-block_web_acl"
scope = "REGIONAL"
}

import {
to = aws_wafv2_web_acl.default
id = "${data.aws_wafv2_web_acl.existing_default.id}/x-always-block_web_acl/REGIONAL"
}

data "aws_wafv2_regex_pattern_set" "existing_x_always_block" {
name = "x-always-block_pattern"
scope = "REGIONAL"
}

import {
to = aws_wafv2_regex_pattern_set.x_always_block
id = "${data.aws_wafv2_regex_pattern_set.existing_x_always_block.id}/x-always-block_pattern/REGIONAL"
}

data "aws_wafv2_rule_group" "existing_x_always_block" {
name = "x-always-block_rule_group"
scope = "REGIONAL"
}

import {
to = aws_wafv2_rule_group.x_always_block
id = "${data.aws_wafv2_rule_group.existing_x_always_block.id}/x-always-block_rule_group/REGIONAL"
}

data "aws_wafv2_web_acl" "existing_backend_public" {
name = "backend_public_web_acl"
scope = "REGIONAL"
}

import {
to = aws_wafv2_web_acl.backend_public
id = "${data.aws_wafv2_web_acl.existing_backend_public.id}/backend_public_web_acl/REGIONAL"
}

import {
to = aws_cloudwatch_log_group.public_backend_waf
id = "aws-waf-logs-backend-public-${var.govuk_environment}"
}

data "aws_wafv2_web_acl" "existing_bouncer_public" {
name = "bouncer_public_web_acl"
scope = "REGIONAL"
}

import {
to = aws_wafv2_web_acl.bouncer_public
id = "${data.aws_wafv2_web_acl.existing_bouncer_public.id}/bouncer_public_web_acl/REGIONAL"
}

import {
to = aws_cloudwatch_log_group.public_bouncer_waf
id = "aws-waf-logs-bouncer-public-${var.govuk_environment}"
}

data "aws_wafv2_web_acl" "existing_cache_public" {
name = "cache_public_web_acl"
scope = "REGIONAL"
}

import {
to = aws_wafv2_web_acl.cache_public
id = "${data.aws_wafv2_web_acl.existing_cache_public.id}/cache_public_web_acl/REGIONAL"
}

import {
to = aws_cloudwatch_log_group.public_cache_waf
id = "aws-waf-logs-cache-public-${var.govuk_environment}"
}

import {
to = aws_wafv2_web_acl_logging_configuration.public_backend_waf
id = data.aws_wafv2_web_acl.existing_backend_public.arn
}

import {
to = aws_wafv2_web_acl_logging_configuration.public_bouncer_waf
id = data.aws_wafv2_web_acl.existing_bouncer_public.arn
}
import {
to = aws_wafv2_web_acl_logging_configuration.public_cache_waf
id = data.aws_wafv2_web_acl.existing_cache_public.arn
}

0 comments on commit 195fe2b

Please sign in to comment.