FIX: added provider default tags validation

This commit is contained in:
xpk 2023-07-12 20:52:01 +08:00
parent ef27e2f320
commit d043b530b8
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
4 changed files with 17 additions and 7 deletions

View File

@ -1,6 +1,4 @@
# vpc-endpoints module
This module uses provider default_tags!
This module deploys VPC endpoints.
Automatically, this module performs the following additional tasks

View File

@ -1,5 +1,12 @@
data "aws_region" "this" {}
data aws_default_tags this {}
data "aws_default_tags" "this" {
lifecycle {
postcondition {
condition = length(self.tags) >= 1
error_message = "Validation failed: Provider default_tags not set."
}
}
}
resource "aws_vpc_endpoint" "vpc-interface-ep" {
for_each = toset(var.interface-ep-services)

View File

@ -1,6 +1,4 @@
# Overview
This module uses provider default_tags!
This module performs the following tasks:
- Create VPC, vpcflow log

View File

@ -1,10 +1,17 @@
data aws_caller_identity this {}
data "aws_caller_identity" "this" {}
data "aws_availability_zones" "available-az" {
state = "available"
}
data "aws_default_tags" "this" {}
data "aws_default_tags" "this" {
lifecycle {
postcondition {
condition = length(self.tags) >= 1
error_message = "Validation failed: Provider default_tags not set."
}
}
}
locals {
no-az = 2 # hard-coding to 2AZ