diff --git a/huaweicloud/.terraform.lock.hcl b/huaweicloud/.terraform.lock.hcl index 046d6bd..d941aae 100644 --- a/huaweicloud/.terraform.lock.hcl +++ b/huaweicloud/.terraform.lock.hcl @@ -2,23 +2,23 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/huaweicloud/huaweicloud" { - version = "1.57.0" - constraints = "1.57.0" + version = "1.61.1" + constraints = "1.61.1" hashes = [ - "h1:TtHxul3x5ojWnbSKHlm5beCkzqYDf/15plf6+iOkh6k=", - "zh:0f2451a86c281da344087fb25fc8511194635cb397f00cf319d961cfdf0f1020", - "zh:1527013d486e9ea184892586c5aca7bcd21dc8041cd691e9719fa09168a6e3fd", - "zh:1567975e19202273958d4e5b53d47da9dd9dd6d739cf86d29d3158933e87d875", - "zh:33091fb259d80fc77e956b4fb7a7b2f143b9ca16ba1fa2948eab35de59b8f622", - "zh:44e0d862e05aa169bcd92f29fb99ae27ebe22e8016920ca4c72b23f6cd9f1005", - "zh:6e58b5a72a0fceb70d6bf5ee3b04fc1cc7b0d0032351894a4d04ac2b383c4397", - "zh:7aca35ead66f42e948d8eaaa3bc5137ba355ce41730e08b5ddbeda421af5afd0", - "zh:7acc18b2da7b7972cbdcd51e30ec6a3c45e2daa9c52369f275a9de49a2adf4ea", - "zh:8c38bc70576a13f7aa89b7a40da214bce97d9f47b298de7c29c26a9e5da543a4", - "zh:a9bde7cfb0448c857d653174cf578bc31beee8c529674eb828ec899f27c2304e", - "zh:b068875fa698cb5e3e44a5738b61450ea9760b6805cf035deeb56c740d71374d", - "zh:c30f481c7cf0295744ccaffbecc7656690bb805e083d56f0eddbe355ce2c9501", - "zh:c83023dc4370e12a97b8797b2dd995cbf65d1a9e1b5f032d4535bf71c5b38678", - "zh:fe7541ef1236623188098af4bdde83e4333a1f2fbc375d25574329668d5b167f", + "h1:sefhCh3vvG4tDVOlHzkte/eE1TEcPS1zfMjP6WKyc5I=", + "zh:14ca324d228c5b36e8cb9fd85b8d42cbf5dc9e799a453655a7d0cd46f049bcd5", + "zh:31cc666c7a31e08c5bf2178faa68e6a6f796bd8919d422ceded9dfc3a92f8a22", + "zh:37eed9390b17c03a16f2ef1e9c9ea1743706eb7f4f93e3a4bfad5b16ad244274", + "zh:3f2e21b337c33b9b59384b8a67e0a39c3b2960fe4cf03251dfb7baaf42c71a92", + "zh:597af79897ee51f02be8ac70c1b6b870947992d853d0233250920f5de42865c9", + "zh:788fbcc53c3a71214020aeb535636f7bfa9871e7a25a92a83463b7fc9f4b8c6b", + "zh:7d8b0a595c00e4b3325cdcb314f2d2a563f8a388dbfa323c348eef5658430210", + "zh:81396ea34efbcd9b1186bcaf174755668a622c039c863ea19d72c495d56cea86", + "zh:b04bc8ca5253308cd280ce63cf11f1a8ed3652eb47a5b49dc2da75d230af1ad4", + "zh:ba92909471b6a35dee18afbc536f04a13d94ae901e87b2219d5f6078c9d975ca", + "zh:d262652751d75ee5cc1617013a75ab6044a5d2a5e2cfd207731827e4cf3b5a93", + "zh:d5b451dfea3213322f75544485d95fe9e4535b3f25a5d30a7233444be1fe9f17", + "zh:f8e58fc2c7a533aa28b1766dc3e843a5e86fc95b6f2d4aa95621c0f8563fd47c", + "zh:f9263ac266aa717a340875f6ca94143251d66742a76e875f7403fd4e54b5d690", ] } diff --git a/huaweicloud/iam.tf b/huaweicloud/iam.tf new file mode 100644 index 0000000..6addcca --- /dev/null +++ b/huaweicloud/iam.tf @@ -0,0 +1,10 @@ +data "huaweicloud_identity_users" "all" {} + +data "huaweicloud_identity_permissions" "custom" { + type = "custom" +} + +locals { + iam_users = data.huaweicloud_identity_users.all.users + iam_permissions = data.huaweicloud_identity_permissions.custom.permissions +} diff --git a/huaweicloud/nat.tf b/huaweicloud/nat.tf index ed83eff..c39fe0a 100644 --- a/huaweicloud/nat.tf +++ b/huaweicloud/nat.tf @@ -1,17 +1,7 @@ -data "huaweicloud_nat_gateway" "all" { - # WARN: unstable - # HuaweiCloud provider does not have list of nat and private nat data source - # So here we get it from route table - for_each = toset(distinct(flatten([ - for v in data.huaweicloud_vpc_route_table.all : [ - for r in v.route : - r.nexthop if r.type == "nat" && r.destination == "0.0.0.0/0" - ] - ]))) - - id = each.key -} +data "huaweicloud_nat_gateways" "all" {} +data "huaweicloud_nat_private_gateways" "all" {} locals { - nat = values(data.huaweicloud_nat_gateway.all) + nat_gateways = data.huaweicloud_nat_gateways.all.gateways + nat_private_gateways = data.huaweicloud_nat_private_gateways.all.gateways } diff --git a/huaweicloud/output.tf b/huaweicloud/output.tf index 08ca14b..9641f13 100644 --- a/huaweicloud/output.tf +++ b/huaweicloud/output.tf @@ -38,8 +38,18 @@ output "evs_attachments" { value = local.evs_attachments } -output "nat" { - value = local.nat +output "iam_users" { + value = local.iam_users +} +output "iam_permission" { + value = local.iam_permissions +} + +output "nat_gateways" { + value = local.nat_gateways +} +output "nat_private_gateways" { + value = local.nat_private_gateways } output "obs" { @@ -78,3 +88,7 @@ output "vpc_subnets" { output "vpc_route_tables" { value = local.vpc_route_tables } + +output "waf_domains" { + value = local.waf_domains +} diff --git a/huaweicloud/version.tf b/huaweicloud/version.tf index ccdab57..aef3e7a 100644 --- a/huaweicloud/version.tf +++ b/huaweicloud/version.tf @@ -2,7 +2,7 @@ terraform { required_providers { huaweicloud = { source = "huaweicloud/huaweicloud" - version = "1.57.0" + version = "1.61.1" } } } diff --git a/huaweicloud/waf.tf b/huaweicloud/waf.tf new file mode 100644 index 0000000..f414221 --- /dev/null +++ b/huaweicloud/waf.tf @@ -0,0 +1,5 @@ +data "huaweicloud_waf_domains" "all" {} + +locals { + waf_domains = data.huaweicloud_waf_domains.all.domains +} diff --git a/query.sh b/query.sh index 13b8883..a445866 100755 --- a/query.sh +++ b/query.sh @@ -4,7 +4,7 @@ set -euo pipefail dir=${1:-"."} trap "rm '$dir/terraform.tfstate'" EXIT -terraform -chdir="$dir" init -reconfigure >/dev/null +terraform -chdir="$dir" init -reconfigure -upgrade >/dev/null terraform -chdir="$dir" refresh >/dev/null terraform -chdir="$dir" output -json | jq 'with_entries(.value = .value.value)'